From 34f2e9492b37cb52ae5ffe69308deecdc4cb7709 Mon Sep 17 00:00:00 2001 From: Alberto Almagro Date: Mon, 8 Oct 2018 23:44:25 +0200 Subject: Add frozen_string_literal: true Adds frozen_string_literal: true comment on top of all currently existing files --- app/helpers/action_text/content_helper.rb | 2 ++ app/helpers/action_text/tag_helper.rb | 2 ++ app/models/action_text/rich_text.rb | 2 ++ bin/test | 1 + lib/action_text.rb | 2 ++ lib/action_text/attachable.rb | 2 ++ lib/action_text/attachables/content_attachment.rb | 2 ++ lib/action_text/attachables/remote_image.rb | 2 ++ lib/action_text/attachment.rb | 2 ++ lib/action_text/attachment_gallery.rb | 2 ++ lib/action_text/attachments/caching.rb | 2 ++ lib/action_text/attachments/minification.rb | 2 ++ lib/action_text/attachments/trix_conversion.rb | 2 ++ lib/action_text/attribute.rb | 2 ++ lib/action_text/content.rb | 2 ++ lib/action_text/engine.rb | 2 ++ lib/action_text/fragment.rb | 2 ++ lib/action_text/html_conversion.rb | 2 ++ lib/action_text/plain_text_conversion.rb | 2 ++ lib/action_text/serialization.rb | 2 ++ lib/action_text/trix_attachment.rb | 2 ++ lib/action_text/version.rb | 2 ++ test/test_helper.rb | 2 ++ test/unit/attachment_test.rb | 2 ++ test/unit/content_test.rb | 2 ++ test/unit/model_test.rb | 2 ++ test/unit/plain_text_conversion_test.rb | 2 ++ test/unit/trix_attachment_test.rb | 2 ++ 28 files changed, 55 insertions(+) diff --git a/app/helpers/action_text/content_helper.rb b/app/helpers/action_text/content_helper.rb index 99255494b1..b3335601f9 100644 --- a/app/helpers/action_text/content_helper.rb +++ b/app/helpers/action_text/content_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module ContentHelper SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer diff --git a/app/helpers/action_text/tag_helper.rb b/app/helpers/action_text/tag_helper.rb index 8d1ff0aaad..103b65eb97 100644 --- a/app/helpers/action_text/tag_helper.rb +++ b/app/helpers/action_text/tag_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module TagHelper cattr_accessor(:id, instance_accessor: false) { 0 } diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb index 3cedef4d5f..1f8ac0e7f7 100644 --- a/app/models/action_text/rich_text.rb +++ b/app/models/action_text/rich_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # The RichText record holds the content produced by the Trix editor in a serialized `body` attribute. # It also holds all the references to the embedded files, which are stored using Active Storage. # This record is then associated with the Active Record model the application desires to have diff --git a/bin/test b/bin/test index 5516a12bcd..3e28e212ed 100755 --- a/bin/test +++ b/bin/test @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $: << File.expand_path("../test", __dir__) require "bundler/setup" diff --git a/lib/action_text.rb b/lib/action_text.rb index 4182cacb8a..d723508e74 100644 --- a/lib/action_text.rb +++ b/lib/action_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_record" require "action_text/engine" require "nokogiri" diff --git a/lib/action_text/attachable.rb b/lib/action_text/attachable.rb index 1209f17e77..fce3d6d9c3 100644 --- a/lib/action_text/attachable.rb +++ b/lib/action_text/attachable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachable extend ActiveSupport::Concern diff --git a/lib/action_text/attachables/content_attachment.rb b/lib/action_text/attachables/content_attachment.rb index 3ebd734786..804f74713f 100644 --- a/lib/action_text/attachables/content_attachment.rb +++ b/lib/action_text/attachables/content_attachment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachables class ContentAttachment diff --git a/lib/action_text/attachables/remote_image.rb b/lib/action_text/attachables/remote_image.rb index 2333427371..650b11862b 100644 --- a/lib/action_text/attachables/remote_image.rb +++ b/lib/action_text/attachables/remote_image.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachables class RemoteImage diff --git a/lib/action_text/attachment.rb b/lib/action_text/attachment.rb index cba421c143..e90a3e7d48 100644 --- a/lib/action_text/attachment.rb +++ b/lib/action_text/attachment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText class Attachment include Attachments::TrixConversion, Attachments::Minification, Attachments::Caching diff --git a/lib/action_text/attachment_gallery.rb b/lib/action_text/attachment_gallery.rb index 6f690551e6..a4694fc359 100644 --- a/lib/action_text/attachment_gallery.rb +++ b/lib/action_text/attachment_gallery.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText class AttachmentGallery include ActiveModel::Model diff --git a/lib/action_text/attachments/caching.rb b/lib/action_text/attachments/caching.rb index b867e2ff91..7c727bfc26 100644 --- a/lib/action_text/attachments/caching.rb +++ b/lib/action_text/attachments/caching.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachments module Caching diff --git a/lib/action_text/attachments/minification.rb b/lib/action_text/attachments/minification.rb index b1ca43b7b8..edc8f876d6 100644 --- a/lib/action_text/attachments/minification.rb +++ b/lib/action_text/attachments/minification.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachments module Minification diff --git a/lib/action_text/attachments/trix_conversion.rb b/lib/action_text/attachments/trix_conversion.rb index 39989ce644..f723d55231 100644 --- a/lib/action_text/attachments/trix_conversion.rb +++ b/lib/action_text/attachments/trix_conversion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attachments module TrixConversion diff --git a/lib/action_text/attribute.rb b/lib/action_text/attribute.rb index 2d520fa541..f226dd21bd 100644 --- a/lib/action_text/attribute.rb +++ b/lib/action_text/attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Attribute extend ActiveSupport::Concern diff --git a/lib/action_text/content.rb b/lib/action_text/content.rb index 4061613e35..b99e9bb49c 100644 --- a/lib/action_text/content.rb +++ b/lib/action_text/content.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText class Content include Serialization diff --git a/lib/action_text/engine.rb b/lib/action_text/engine.rb index 9331ffff5e..25e45bc72a 100644 --- a/lib/action_text/engine.rb +++ b/lib/action_text/engine.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rails/engine" module ActionText diff --git a/lib/action_text/fragment.rb b/lib/action_text/fragment.rb index 63b088f3e1..af276b2b26 100644 --- a/lib/action_text/fragment.rb +++ b/lib/action_text/fragment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText class Fragment class << self diff --git a/lib/action_text/html_conversion.rb b/lib/action_text/html_conversion.rb index 1c70504fb7..1e1062ea3f 100644 --- a/lib/action_text/html_conversion.rb +++ b/lib/action_text/html_conversion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module HtmlConversion extend self diff --git a/lib/action_text/plain_text_conversion.rb b/lib/action_text/plain_text_conversion.rb index ea168f1c4e..0eb4e2e7da 100644 --- a/lib/action_text/plain_text_conversion.rb +++ b/lib/action_text/plain_text_conversion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module PlainTextConversion extend self diff --git a/lib/action_text/serialization.rb b/lib/action_text/serialization.rb index ac2b0602d5..8ecf8c9157 100644 --- a/lib/action_text/serialization.rb +++ b/lib/action_text/serialization.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText module Serialization extend ActiveSupport::Concern diff --git a/lib/action_text/trix_attachment.rb b/lib/action_text/trix_attachment.rb index 0c4a3869d8..c16c1c090d 100644 --- a/lib/action_text/trix_attachment.rb +++ b/lib/action_text/trix_attachment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText class TrixAttachment TAG_NAME = "figure" diff --git a/lib/action_text/version.rb b/lib/action_text/version.rb index bc34656697..631f3d623c 100644 --- a/lib/action_text/version.rb +++ b/lib/action_text/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActionText VERSION = '0.1.0' end diff --git a/test/test_helper.rb b/test/test_helper.rb index 79fde51549..7250cffea3 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Configure Rails Environment ENV["RAILS_ENV"] = "test" diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index 56a4ea1dd8..728742c366 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ActionText::AttachmentTest < ActiveSupport::TestCase diff --git a/test/unit/content_test.rb b/test/unit/content_test.rb index dada9cc714..17bc6c0013 100644 --- a/test/unit/content_test.rb +++ b/test/unit/content_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ActionText::ContentTest < ActiveSupport::TestCase diff --git a/test/unit/model_test.rb b/test/unit/model_test.rb index 50632c19a7..99a249946a 100644 --- a/test/unit/model_test.rb +++ b/test/unit/model_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ActionText::ModelTest < ActiveSupport::TestCase diff --git a/test/unit/plain_text_conversion_test.rb b/test/unit/plain_text_conversion_test.rb index 47c95b6bc3..fd67f8eca8 100644 --- a/test/unit/plain_text_conversion_test.rb +++ b/test/unit/plain_text_conversion_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ActionText::PlainTextConversionTest < ActiveSupport::TestCase diff --git a/test/unit/trix_attachment_test.rb b/test/unit/trix_attachment_test.rb index fe834c8663..9cb338b8c2 100644 --- a/test/unit/trix_attachment_test.rb +++ b/test/unit/trix_attachment_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ActionText::TrixAttachmentTest < ActiveSupport::TestCase -- cgit v1.2.3