Skip to content

Commit

Permalink
Add frozen_string_literal pragma to ruby files
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiek1507 committed Dec 17, 2018
1 parent 17d0e6b commit 873cf4a
Show file tree
Hide file tree
Showing 157 changed files with 313 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
#
# Add a Gemfile.local to locally bundle gems outside of version control
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

begin
require 'bundler/setup'
rescue LoadError
Expand Down
1 change: 1 addition & 0 deletions active_model_serializers.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Expand Down
2 changes: 2 additions & 0 deletions lib/action_controller/serialization.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/class/attribute'
require 'active_model_serializers/serialization_context'

Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializable_resource.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'thread_safe'
require 'jsonapi/include_directive'
require 'active_model/serializer/collection_serializer'
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model_serializers/adapter'
require 'active_model_serializers/deprecate'

Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter/attributes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Adapter
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Adapter
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter/json.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Adapter
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter/json_api.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Adapter
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/adapter/null.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Adapter
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/array_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/collection_serializer'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/association.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/lazy_association'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/attribute.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/field'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/belongs_to_reflection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
# @api private
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/collection_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
class CollectionSerializer
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/concerns/caching.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
UndefinedCacheKey = Class.new(StandardError)
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/error_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
class ErrorSerializer < ActiveModel::Serializer
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/errors_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/error_serializer'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/field.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
# Holds all the meta-data about a field (i.e. attribute or association) as it was
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/fieldset.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
class Fieldset
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/has_many_reflection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
# @api private
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/has_one_reflection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
# @api private
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/lazy_association.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
# @api private
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/link.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/field'

module ActiveModel
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/lint.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
module Lint
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/null.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
class Null < Serializer
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/reflection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model/serializer/field'
require 'active_model/serializer/association'

Expand Down
2 changes: 2 additions & 0 deletions lib/active_model/serializer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModel
class Serializer
VERSION = '0.10.8'.freeze
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_model'
require 'active_support'
require 'active_support/core_ext/object/with_options'
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
UnknownAdapterError = Class.new(ArgumentError)
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/attributes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class Attributes < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'case_transform'

module ActiveModelSerializers
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class Json < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# {http://jsonapi.org/format/ JSON API specification}
# rubocop:disable Style/AsciiComments
# TODO: implement!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api/error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api/jsonapi.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api/link.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api/meta.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/json_api/relationship.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class JsonApi
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/adapter/null.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Adapter
class Null < Base
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/callbacks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Adapted from
# https://github.com/rails/rails/blob/7f18ea14c8/activejob/lib/active_job/callbacks.rb
require 'active_support/callbacks'
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/deprecate.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

##
# Provides a single method +deprecate+ to be used to declare when
# something is going away.
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/deserialization.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Deserialization
module_function
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/json_pointer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module JsonPointer
module_function
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

##
# ActiveModelSerializers::Logging
#
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/lookup_chain.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module LookupChain
# Standard appending of Serializer to the resource name.
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/model.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# ActiveModelSerializers::Model is a convenient superclass for making your models
# from Plain-Old Ruby Objects (PORO). It also serves as a reference implementation
# that satisfies ActiveModel::Serializer::Lint::Tests.
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails/railtie'
require 'action_controller'
require 'action_controller/railtie'
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/register_jsonapi_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Based on discussion in https://github.com/rails/rails/pull/23712#issuecomment-184977238,
# the JSON API media type will have its own format/renderer.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/serializable_resource.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'

module ActiveModelSerializers
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/serialization_context.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/array/extract_options'
module ActiveModelSerializers
class SerializationContext
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Test
extend ActiveSupport::Autoload
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/test/schema.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ActiveModelSerializers
module Test
module Schema
Expand Down
2 changes: 2 additions & 0 deletions lib/active_model_serializers/test/serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'
module ActiveModelSerializers
module Test
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/rails/resource_override.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails/generators'
require 'rails/generators/rails/resource/resource_generator'

Expand Down
2 changes: 2 additions & 0 deletions lib/generators/rails/serializer_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rails
module Generators
class SerializerGenerator < NamedBase
Expand Down
2 changes: 2 additions & 0 deletions lib/grape/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# To add Grape support, require 'grape/active_model_serializers' in the base of your Grape endpoints
# Then add 'include Grape::ActiveModelSerializers' to enable the formatter and helpers
require 'active_model_serializers'
Expand Down
2 changes: 2 additions & 0 deletions lib/grape/formatters/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# A Grape response formatter that can be used as 'formatter :json, Grape::Formatters::ActiveModelSerializers'
#
# Serializer options can be passed as a hash from your Grape endpoint using env[:active_model_serializer_options],
Expand Down
2 changes: 2 additions & 0 deletions lib/grape/helpers/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Helpers can be included in your Grape endpoint as: helpers Grape::Helpers::ActiveModelSerializers

module Grape
Expand Down
2 changes: 2 additions & 0 deletions lib/tasks/rubocop.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

begin
require 'rubocop'
require 'rubocop/rake_task'
Expand Down
2 changes: 2 additions & 0 deletions test/action_controller/adapter_selector_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'test_helper'

module ActionController
Expand Down
Loading

0 comments on commit 873cf4a

Please sign in to comment.