Skip to content

Commit

Permalink
Bump rubocop-next to 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
brodyhoskins committed Jun 12, 2024
1 parent 3c458c6 commit 802739f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion freight_kit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency('rake', '~> 13.2.1')
spec.add_development_dependency('redcarpet', '~> 3.6.0') # for yard
spec.add_development_dependency('rspec', '~> 3.12')
spec.add_development_dependency('rubocop-next', '~> 1.0.3')
spec.add_development_dependency('rubocop-next', '~> 1.0.7')
spec.add_development_dependency('yard', '~> 0.9.28')

spec.add_dependency('activemodel', '>= 4.2', '< 7.1.4')
Expand Down
2 changes: 1 addition & 1 deletion lib/freight_kit/carrier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def initialize(credentials, customer_location: nil, tariff: nil)
),
"#{self.class.to_s.split("::")[1].underscore}.yml",
)
@conf = YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol])
@conf = YAML.safe_load_file(conf_path, permitted_classes: [Symbol])

@rates_with_excessive_length_fees = @conf.dig(:attributes, :rates, :with_excessive_length_fees)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/freight_kit/models/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def time_zone
def type=(value)
return @type = nil if value.blank?

raise ArgumentError, "type must be one of :#{TYPES.join(", :")}" unless TYPES.include?(value)
raise ArgumentError, "type must be one of :#{TYPES.join(", :")}" if TYPES.exclude?(value)

@type = value
end
Expand Down
2 changes: 1 addition & 1 deletion lib/freight_kit/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def declared_freight_class
end

def freight_class
(declared_freight_class.presence || calculated_freight_class)
declared_freight_class.presence || calculated_freight_class
end

def length(unit)
Expand Down
2 changes: 1 addition & 1 deletion lib/freight_kit/packaging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize(type, options = {})
options.symbolize_keys!
@options = options

unless VALID_TYPES.include?(type)
if VALID_TYPES.exclude?(type)
raise ArgumentError, "Package#new: `type` should be one of #{VALID_TYPES.join(", ")}"
end

Expand Down
4 changes: 2 additions & 2 deletions lib/freight_kit/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize(credentials, customer_location: nil, tariff: nil)
),
"#{parent_class_name}.yml",
)
@conf = YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol])
@conf = YAML.safe_load_file(conf_path, permitted_classes: [Symbol])

conf_path = File
.join(
Expand All @@ -28,7 +28,7 @@ def initialize(credentials, customer_location: nil, tariff: nil)
),
"#{self.class.to_s.demodulize.underscore}.yml",
)
@conf = @conf.deep_merge(YAML.safe_load(File.read(conf_path), permitted_classes: [Symbol]))
@conf = @conf.deep_merge(YAML.safe_load_file(conf_path, permitted_classes: [Symbol]))

@rates_with_excessive_length_fees = @conf.dig(:attributes, :rates, :with_excessive_length_fees)
end
Expand Down

0 comments on commit 802739f

Please sign in to comment.