Skip to content

Commit

Permalink
Enable new cops and autocorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
JDutil committed Jun 18, 2024
1 parent 57afc34 commit ccf931f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Relaxed.Ruby.Style
## Version 2.1
AllCops:
NewCops: enable
TargetRubyVersion: 3.0.0

Gemspec/OrderedDependencies:
Expand Down
1 change: 0 additions & 1 deletion contentful_lite.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 3.0.0'

spec.files = Dir["lib/**/*", "LICENSE", "README.md"]
spec.test_files = Dir["spec/**/*"]
spec.require_paths = ["lib"]

spec.add_dependency "http", '~> 5.0'
Expand Down
2 changes: 1 addition & 1 deletion lib/contentful_lite/assets_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class AssetsArray < BaseArray
# @param raw [Hash] raw response from Contentful API
# @api private
def initialize(raw)
super(raw)
super

# Create the array of asset objects
@items.collect! { |item| ContentfulLite::Asset.new(item) }
Expand Down
2 changes: 1 addition & 1 deletion lib/contentful_lite/entries_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class EntriesArray < BaseArray
# @param raw [Hash] raw response from Contentful API
# @api private
def initialize(raw)
super(raw)
super

# Collect arrays of missing (unresolvable) links
@errors = raw.fetch('errors', []).collect! { |error| error.fetch('details', {}) }.each_with_object({}) do |error_detail, hash|
Expand Down
2 changes: 1 addition & 1 deletion lib/contentful_lite/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Entry
# @param raw [Hash] raw response from Contentful API
# @api private
def initialize(raw)
super(raw)
super
@content_type_id = raw['sys']['contentType']['sys']['id']
@localized_fields.each_value do |fields|
fields.transform_values! { |value| build_link(value) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def validate_each(record, attr_name, value)
private

def record_error(record, attr_name, message)
record.errors.add(attr_name, :invalid, **{ message: message }.merge(options.except(self.class.options_keys)))
record.errors.add(attr_name, :invalid, message: message, **options.except(self.class.options_keys))
end

def validate_array(record, attr_name, value)
Expand Down

0 comments on commit ccf931f

Please sign in to comment.