From 0930f60f0371b875dda3f970ac98b2e707fdea20 Mon Sep 17 00:00:00 2001 From: James McCarthy Date: Wed, 5 Apr 2017 16:21:29 +0700 Subject: [PATCH] Rubocop cleanup (#264) * Ignore some project files. * Add .rubocop.yml. * Autofix some Rubocop errors. * Autogenerate .rubocop_todo.yml. * Add CHANGELOG entry for Rubocop. * Updated gemspec to rubocop ~> 0.48 and rubocop Target to 2.4. * Frozen string literals. --- .gitignore | 3 ++ .rubocop.yml | 24 ++++++++++++++++ .rubocop_todo.yml | 28 +++++++++---------- CHANGELOG.md | 1 + Dangerfile | 2 ++ Gemfile | 2 ++ Rakefile | 3 +- bench/serializing.rb | 2 ++ grape-entity.gemspec | 4 ++- lib/grape-entity.rb | 2 ++ lib/grape_entity.rb | 2 ++ lib/grape_entity/condition.rb | 2 ++ lib/grape_entity/condition/base.rb | 2 ++ lib/grape_entity/condition/block_condition.rb | 2 ++ lib/grape_entity/condition/hash_condition.rb | 2 ++ .../condition/symbol_condition.rb | 2 ++ lib/grape_entity/delegator.rb | 2 ++ lib/grape_entity/delegator/base.rb | 2 ++ .../delegator/fetchable_object.rb | 2 ++ lib/grape_entity/delegator/hash_object.rb | 2 ++ .../delegator/openstruct_object.rb | 2 ++ lib/grape_entity/delegator/plain_object.rb | 2 ++ lib/grape_entity/entity.rb | 8 ++++-- lib/grape_entity/exposure.rb | 2 ++ lib/grape_entity/exposure/base.rb | 2 ++ lib/grape_entity/exposure/block_exposure.rb | 2 ++ .../exposure/delegator_exposure.rb | 2 ++ .../exposure/formatter_block_exposure.rb | 2 ++ .../exposure/formatter_exposure.rb | 2 ++ lib/grape_entity/exposure/nesting_exposure.rb | 2 ++ .../nesting_exposure/nested_exposures.rb | 26 +++++++++-------- .../nesting_exposure/output_builder.rb | 2 ++ .../exposure/represent_exposure.rb | 2 ++ lib/grape_entity/options.rb | 2 ++ lib/grape_entity/version.rb | 4 ++- spec/grape_entity/entity_spec.rb | 22 ++++++++------- .../nesting_exposure/nested_exposures_spec.rb | 2 ++ .../exposure/represent_exposure_spec.rb | 2 ++ spec/grape_entity/exposure_spec.rb | 2 ++ spec/grape_entity/hash_spec.rb | 2 ++ spec/spec_helper.rb | 2 ++ 41 files changed, 143 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index a400dbb5..d72efff3 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,9 @@ dist Gemfile.lock tmp coverage/ +.byebug_history +.ruby-version +.ruby-gemset ## Rubinius .rbx diff --git a/.rubocop.yml b/.rubocop.yml index 67742690..5214e723 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,30 @@ AllCops: + TargetRubyVersion: 2.4 + Include: + - Dangerfile + Exclude: - vendor/**/* + - bin/**/* - Guardfile inherit_from: .rubocop_todo.yml + +Style/FileName: + Exclude: + - 'Gemfile' + - 'Rakefile' + - 'grape-entity.gemspec' + - 'lib/grape-entity.rb' + +Style/Documentation: + Enabled: false + +Style/MultilineIfModifier: + Enabled: false + +Style/RaiseArgs: + Enabled: false + +Lint/UnneededDisable: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 82baf659..bbb822d5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,15 +1,25 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2016-11-20 10:04:42 -0500 using RuboCop version 0.45.0. +# on 2017-04-05 10:30:29 +0700 using RuboCop version 0.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 1 +Lint/AmbiguousBlockAssociation: + Exclude: + - 'spec/grape_entity/exposure/represent_exposure_spec.rb' + # Offense count: 6 Metrics/AbcSize: Max: 32 +# Offense count: 35 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/BlockLength: + Max: 1499 + # Offense count: 2 # Configuration parameters: CountComments. Metrics/ClassLength: @@ -19,13 +29,13 @@ Metrics/ClassLength: Metrics/CyclomaticComplexity: Max: 11 -# Offense count: 237 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives. +# Offense count: 238 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: Max: 146 -# Offense count: 6 +# Offense count: 7 # Configuration parameters: CountComments. Metrics/MethodLength: Max: 28 @@ -33,13 +43,3 @@ Metrics/MethodLength: # Offense count: 2 Metrics/PerceivedComplexity: Max: 13 - -# Offense count: 33 -Style/Documentation: - Enabled: false - -# Offense count: 1 -# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts. -Style/FileName: - Exclude: - - 'lib/grape-entity.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 875a10c5..a64428e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### Features +* [#264](https://github.com/ruby-grape/grape-entity/pull/264): Adds Rubocop config and todo list - [@james2m](https://github.com/james2m). * [#255](https://github.com/ruby-grape/grape-entity/pull/255): Adds code coverage w/ coveralls - [@LeFnord](https://github.com/LeFnord). * Your contribution here. diff --git a/Dangerfile b/Dangerfile index f05fedd6..82881902 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1 +1,3 @@ +# frozen_string_literal: true + danger.import_dangerfile(gem: 'ruby-grape-danger') diff --git a/Gemfile b/Gemfile index 4ecd3dc0..754f1e49 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'http://rubygems.org' gemspec diff --git a/Rakefile b/Rakefile index d37a3052..8d272fa0 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true require 'rubygems' require 'bundler' @@ -17,4 +18,4 @@ RSpec::Core::RakeTask.new(:spec) require 'rubocop/rake_task' RuboCop::RakeTask.new(:rubocop) -task default: [:spec, :rubocop] +task default: %i[spec rubocop] diff --git a/bench/serializing.rb b/bench/serializing.rb index 2572b21a..17367eeb 100644 --- a/bench/serializing.rb +++ b/bench/serializing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'grape-entity' require 'benchmark' diff --git a/grape-entity.gemspec b/grape-entity.gemspec index 54eeae4a..36be2425 100644 --- a/grape-entity.gemspec +++ b/grape-entity.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.push File.expand_path('../lib', __FILE__) require 'grape_entity/version' @@ -21,7 +23,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'bundler' s.add_development_dependency 'rake' - s.add_development_dependency 'rubocop', '~> 0.40' + s.add_development_dependency 'rubocop', '~> 0.48' s.add_development_dependency 'rspec', '~> 3.0' s.add_development_dependency 'rack-test' s.add_development_dependency 'maruku' diff --git a/lib/grape-entity.rb b/lib/grape-entity.rb index 25d23d28..40cb0187 100644 --- a/lib/grape-entity.rb +++ b/lib/grape-entity.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require 'grape_entity' diff --git a/lib/grape_entity.rb b/lib/grape_entity.rb index cc728d4b..3d37fb3e 100644 --- a/lib/grape_entity.rb +++ b/lib/grape_entity.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/version' require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/hash/reverse_merge' diff --git a/lib/grape_entity/condition.rb b/lib/grape_entity/condition.rb index bf7b2088..68c6d81e 100644 --- a/lib/grape_entity/condition.rb +++ b/lib/grape_entity/condition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'grape_entity/condition/base' require 'grape_entity/condition/block_condition' require 'grape_entity/condition/hash_condition' diff --git a/lib/grape_entity/condition/base.rb b/lib/grape_entity/condition/base.rb index 0142a22c..c179b83f 100644 --- a/lib/grape_entity/condition/base.rb +++ b/lib/grape_entity/condition/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Condition diff --git a/lib/grape_entity/condition/block_condition.rb b/lib/grape_entity/condition/block_condition.rb index e15ab9f9..22eb4faa 100644 --- a/lib/grape_entity/condition/block_condition.rb +++ b/lib/grape_entity/condition/block_condition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Condition diff --git a/lib/grape_entity/condition/hash_condition.rb b/lib/grape_entity/condition/hash_condition.rb index 18cba98f..f9ed8a14 100644 --- a/lib/grape_entity/condition/hash_condition.rb +++ b/lib/grape_entity/condition/hash_condition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Condition diff --git a/lib/grape_entity/condition/symbol_condition.rb b/lib/grape_entity/condition/symbol_condition.rb index 9c4be7fc..d9fef2ce 100644 --- a/lib/grape_entity/condition/symbol_condition.rb +++ b/lib/grape_entity/condition/symbol_condition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Condition diff --git a/lib/grape_entity/delegator.rb b/lib/grape_entity/delegator.rb index d1033778..0bc0fce5 100644 --- a/lib/grape_entity/delegator.rb +++ b/lib/grape_entity/delegator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'grape_entity/delegator/base' require 'grape_entity/delegator/hash_object' require 'grape_entity/delegator/openstruct_object' diff --git a/lib/grape_entity/delegator/base.rb b/lib/grape_entity/delegator/base.rb index 5422e5ab..4f9b9ff4 100644 --- a/lib/grape_entity/delegator/base.rb +++ b/lib/grape_entity/delegator/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Delegator diff --git a/lib/grape_entity/delegator/fetchable_object.rb b/lib/grape_entity/delegator/fetchable_object.rb index ff3af94a..e43d11c5 100644 --- a/lib/grape_entity/delegator/fetchable_object.rb +++ b/lib/grape_entity/delegator/fetchable_object.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Delegator diff --git a/lib/grape_entity/delegator/hash_object.rb b/lib/grape_entity/delegator/hash_object.rb index aab555cc..42b6f4df 100644 --- a/lib/grape_entity/delegator/hash_object.rb +++ b/lib/grape_entity/delegator/hash_object.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Delegator diff --git a/lib/grape_entity/delegator/openstruct_object.rb b/lib/grape_entity/delegator/openstruct_object.rb index 4d90609f..8d7fa536 100644 --- a/lib/grape_entity/delegator/openstruct_object.rb +++ b/lib/grape_entity/delegator/openstruct_object.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Delegator diff --git a/lib/grape_entity/delegator/plain_object.rb b/lib/grape_entity/delegator/plain_object.rb index 4d0178c0..db7ed43f 100644 --- a/lib/grape_entity/delegator/plain_object.rb +++ b/lib/grape_entity/delegator/plain_object.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Delegator diff --git a/lib/grape_entity/entity.rb b/lib/grape_entity/entity.rb index 4dc988be..17e310ba 100644 --- a/lib/grape_entity/entity.rb +++ b/lib/grape_entity/entity.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'multi_json' require 'set' @@ -506,8 +508,8 @@ def to_xml(options = {}) end # All supported options. - OPTIONS = [ - :rewrite, :as, :if, :unless, :using, :with, :proc, :documentation, :format_with, :safe, :attr_path, :if_extras, :unless_extras, :merge + OPTIONS = %i[ + rewrite as if unless using with proc documentation format_with safe attr_path if_extras unless_extras merge ].to_set.freeze # Merges the given options with current block options. @@ -517,7 +519,7 @@ def self.merge_options(options) opts = {} merge_logic = proc do |key, existing_val, new_val| - if [:if, :unless].include?(key) + if %i[if unless].include?(key) if existing_val.is_a?(Hash) && new_val.is_a?(Hash) existing_val.merge(new_val) elsif new_val.is_a?(Hash) diff --git a/lib/grape_entity/exposure.rb b/lib/grape_entity/exposure.rb index 6a4aba39..bbe8bdac 100644 --- a/lib/grape_entity/exposure.rb +++ b/lib/grape_entity/exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'grape_entity/exposure/base' require 'grape_entity/exposure/represent_exposure' require 'grape_entity/exposure/block_exposure' diff --git a/lib/grape_entity/exposure/base.rb b/lib/grape_entity/exposure/base.rb index 40adee9f..94814f20 100644 --- a/lib/grape_entity/exposure/base.rb +++ b/lib/grape_entity/exposure/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/block_exposure.rb b/lib/grape_entity/exposure/block_exposure.rb index 268eeec8..b0ad0e7d 100644 --- a/lib/grape_entity/exposure/block_exposure.rb +++ b/lib/grape_entity/exposure/block_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/delegator_exposure.rb b/lib/grape_entity/exposure/delegator_exposure.rb index 1f24d989..9201f801 100644 --- a/lib/grape_entity/exposure/delegator_exposure.rb +++ b/lib/grape_entity/exposure/delegator_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/formatter_block_exposure.rb b/lib/grape_entity/exposure/formatter_block_exposure.rb index b0dabe13..9c074940 100644 --- a/lib/grape_entity/exposure/formatter_block_exposure.rb +++ b/lib/grape_entity/exposure/formatter_block_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/formatter_exposure.rb b/lib/grape_entity/exposure/formatter_exposure.rb index 79038f34..2f00e279 100644 --- a/lib/grape_entity/exposure/formatter_exposure.rb +++ b/lib/grape_entity/exposure/formatter_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/nesting_exposure.rb b/lib/grape_entity/exposure/nesting_exposure.rb index 0c0f9776..9186626b 100644 --- a/lib/grape_entity/exposure/nesting_exposure.rb +++ b/lib/grape_entity/exposure/nesting_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb b/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb index 2a714216..0dca7aa6 100644 --- a/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb +++ b/lib/grape_entity/exposure/nesting_exposure/nested_exposures.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure @@ -30,18 +32,18 @@ def clear @exposures.clear end - [ - :each, - :to_ary, :to_a, - :all?, - :select, - :each_with_object, - :[], - :==, - :size, - :count, - :length, - :empty? + %i[ + each + to_ary to_a + all? + select + each_with_object + \[\] + == + size + count + length + empty? ].each do |name| class_eval <<-RUBY, __FILE__, __LINE__ def #{name}(*args, &block) diff --git a/lib/grape_entity/exposure/nesting_exposure/output_builder.rb b/lib/grape_entity/exposure/nesting_exposure/output_builder.rb index 9dc1d726..86b6b4ab 100644 --- a/lib/grape_entity/exposure/nesting_exposure/output_builder.rb +++ b/lib/grape_entity/exposure/nesting_exposure/output_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/exposure/represent_exposure.rb b/lib/grape_entity/exposure/represent_exposure.rb index 1fbcfd52..0c4b93f6 100644 --- a/lib/grape_entity/exposure/represent_exposure.rb +++ b/lib/grape_entity/exposure/represent_exposure.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity module Exposure diff --git a/lib/grape_entity/options.rb b/lib/grape_entity/options.rb index 65ab974f..2bbbf219 100644 --- a/lib/grape_entity/options.rb +++ b/lib/grape_entity/options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Grape class Entity class Options diff --git a/lib/grape_entity/version.rb b/lib/grape_entity/version.rb index e9d04e05..707d0184 100644 --- a/lib/grape_entity/version.rb +++ b/lib/grape_entity/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module GrapeEntity - VERSION = '0.6.1'.freeze + VERSION = '0.6.1' end diff --git a/spec/grape_entity/entity_spec.rb b/spec/grape_entity/entity_spec.rb index d00cb18c..50ac4731 100644 --- a/spec/grape_entity/entity_spec.rb +++ b/spec/grape_entity/entity_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'ostruct' @@ -653,7 +655,7 @@ class Parent < Person context 'with specified fields' do it 'returns only specified fields with only option' do subject.expose(:id, :name, :phone) - representation = subject.represent(OpenStruct.new, only: [:id, :name], serializable: true) + representation = subject.represent(OpenStruct.new, only: %i[id name], serializable: true) expect(representation).to eq(id: nil, name: nil) end @@ -666,7 +668,7 @@ class Parent < Person it 'returns only fields specified in the only option and not specified in the except option' do subject.expose(:id, :name, :phone) representation = subject.represent(OpenStruct.new, - only: [:name, :phone], + only: %i[name phone], except: [:phone], serializable: true) expect(representation).to eq(name: nil) end @@ -736,7 +738,7 @@ class Parent < Person subject.expose(:id, :name, :phone) subject.expose(:user, using: user_entity) - representation = subject.represent(OpenStruct.new(user: {}), only: [:id, :name, { user: [:name, :email] }], serializable: true) + representation = subject.represent(OpenStruct.new(user: {}), only: [:id, :name, { user: %i[name email] }], serializable: true) expect(representation).to eq(id: nil, name: nil, user: { name: nil, email: nil }) end @@ -759,7 +761,7 @@ class Parent < Person subject.expose(:user, using: user_entity) representation = subject.represent(OpenStruct.new(user: {}), - only: [:id, :name, :phone, user: [:id, :name, :email]], + only: [:id, :name, :phone, user: %i[id name email]], except: [:phone, { user: [:id] }], serializable: true) expect(representation).to eq(id: nil, name: nil, user: { name: nil, email: nil }) end @@ -771,7 +773,7 @@ class Parent < Person subject.expose(:name) end - representation = subject.represent(OpenStruct.new, condition: true, only: [:id, :name], serializable: true) + representation = subject.represent(OpenStruct.new, condition: true, only: %i[id name], serializable: true) expect(representation).to eq(id: nil, name: nil) end @@ -781,7 +783,7 @@ class Parent < Person subject.expose(:name, :mobile_phone) end - representation = subject.represent(OpenStruct.new, condition: true, except: [:phone, :mobile_phone], serializable: true) + representation = subject.represent(OpenStruct.new, condition: true, except: %i[phone mobile_phone], serializable: true) expect(representation).to eq(id: nil, name: nil) end @@ -863,7 +865,7 @@ class Parent < Person subject.expose(:id) subject.expose(:name, as: :title) - representation = subject.represent(OpenStruct.new, condition: true, only: [:id, :title], serializable: true) + representation = subject.represent(OpenStruct.new, condition: true, only: %i[id title], serializable: true) expect(representation).to eq(id: nil, title: nil) end @@ -890,7 +892,7 @@ class Parent < Person subject.expose(:nephew, using: nephew_entity) representation = subject.represent(OpenStruct.new(user: {}), - only: [:id, :name, :user], except: [:nephew], serializable: true) + only: %i[id name user], except: [:nephew], serializable: true) expect(representation).to eq(id: nil, name: nil, user: { id: nil, name: nil, email: nil }) end end @@ -1341,8 +1343,8 @@ class NoPathCharacterEntity < Grape::Entity it 'allows to pass different :only and :except params using the same instance' do fresh_class.expose :a, :b, :c presenter = fresh_class.new(a: 1, b: 2, c: 3) - expect(presenter.serializable_hash(only: [:a, :b])).to eq(a: 1, b: 2) - expect(presenter.serializable_hash(only: [:b, :c])).to eq(b: 2, c: 3) + expect(presenter.serializable_hash(only: %i[a b])).to eq(a: 1, b: 2) + expect(presenter.serializable_hash(only: %i[b c])).to eq(b: 2, c: 3) end end end diff --git a/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb b/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb index 4cfe06a0..7d9c2afb 100644 --- a/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb +++ b/spec/grape_entity/exposure/nesting_exposure/nested_exposures_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Grape::Entity::Exposure::NestingExposure::NestedExposures do diff --git a/spec/grape_entity/exposure/represent_exposure_spec.rb b/spec/grape_entity/exposure/represent_exposure_spec.rb index 660a245a..4da76a83 100644 --- a/spec/grape_entity/exposure/represent_exposure_spec.rb +++ b/spec/grape_entity/exposure/represent_exposure_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Grape::Entity::Exposure::RepresentExposure do diff --git a/spec/grape_entity/exposure_spec.rb b/spec/grape_entity/exposure_spec.rb index dc318320..f4696b68 100644 --- a/spec/grape_entity/exposure_spec.rb +++ b/spec/grape_entity/exposure_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Grape::Entity::Exposure do diff --git a/spec/grape_entity/hash_spec.rb b/spec/grape_entity/hash_spec.rb index 43b21218..749ff691 100644 --- a/spec/grape_entity/hash_spec.rb +++ b/spec/grape_entity/hash_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Grape::Entity do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b4737a15..ceb15095 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'simplecov' require 'coveralls'