Skip to content

Commit

Permalink
Update minimum Ruby version to 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Dec 30, 2023
1 parent 0b98022 commit 24c8593
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
Exclude:
- 'spec/internal/config/**/*'
- 'spec/internal/db/**/*'
Expand Down
2 changes: 1 addition & 1 deletion dynamic_image.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |s|
"README.md"
]

s.required_ruby_version = ">= 2.7.0"
s.required_ruby_version = ">= 3.1.0"

s.add_dependency "dis", "~> 1.1", ">= 1.1.11"
s.add_dependency "rails", "> 5.0"
Expand Down
6 changes: 3 additions & 3 deletions lib/dynamic_image/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def render_image(options)
respond_to do |format|
format.html do
render(template: "dynamic_image/images/show",
layout: false, locals: { options: options })
layout: false, locals: { options: })
end
format.any(:gif, :jpeg, :jpg, :png, :tiff, :webp) do
process_and_send(@record, options)
Expand All @@ -91,9 +91,9 @@ def render_raw_image(disposition: "inline")
respond_to do |format|
format.any(:gif, :jpeg, :jpg, :png, :tiff, :webp) do
send_data(@record.data,
filename: filename,
filename:,
content_type: @record.content_type,
disposition: disposition)
disposition:)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/dynamic_image/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def dynamic_image_tag(record_or_array, options = {})

size = fit_size!(record_or_array, options)
url_options = options.extract!(*allowed_dynamic_image_url_options)
html_options = { size: size }.merge(options)
html_options = { size: }.merge(options)

image_tag(dynamic_image_path_with_size(record_or_array,
size,
Expand Down Expand Up @@ -143,7 +143,7 @@ def dynamic_image_url_with_size(record_or_array, size = nil, options = {})
routing_type: :url,
action: nil,
format: default_format_for_image(record),
size: size
size:
}.merge(options)
options[:digest] =
dynamic_image_digest(record, options[:action], options[:size])
Expand Down Expand Up @@ -179,7 +179,7 @@ def fit_size!(record_or_array, options)

def image_sizing(record, size_opts, uncropped)
ImageSizing
.new(record, uncropped: uncropped)
.new(record, uncropped:)
.fit(size_opts[:size], size_opts).floor.to_s
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/dynamic_image/image_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def write(path)
private

def apply(new_image)
self.class.new(new_image, target_format: target_format)
self.class.new(new_image, target_format:)
end

def blank_image
Expand Down
2 changes: 1 addition & 1 deletion lib/dynamic_image/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def read_metadata
end

{ width: image.get("width"),
height: height,
height:,
colorspace: image.get("interpretation") }
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dynamic_image/images_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def digested(action, options = {})
end

it "raises an error" do
expect { get(:show, params: params) }.to(
expect { get(:show, params:) }.to(
raise_error(DynamicImage::Errors::InvalidSignature)
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each do |f|
Dir[Rails.root.join("spec/support/**/*.rb")].each do |f|
require f
end

Expand Down

0 comments on commit 24c8593

Please sign in to comment.