Skip to content

Commit

Permalink
Merge pull request #44641 from SkipKayhil/fix-rubocop-errors
Browse files Browse the repository at this point in the history
fix rubocop errors
  • Loading branch information
tenderlove authored and rafaelfranca committed Mar 9, 2022
1 parent 1afe117 commit c67e8d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def operations
end

def validate_transformation(name, argument)
method_name = name.to_s.gsub("-","_")
method_name = name.to_s.tr("-", "_")

unless SUPPORTED_IMAGE_PROCESSING_METHODS.any? { |method| method_name == method }
raise UnsupportedImageProcessingMethod, <<~ERROR.squish
Expand Down
8 changes: 4 additions & 4 deletions activestorage/test/models/variant_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
end

assert_raise(ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingArgument) do
blob.variant(resize: [123, {"-write /tmp/file.erb": "something"}, "/tmp/file.erb"]).processed
blob.variant(resize: [123, { "-write /tmp/file.erb": "something" }, "/tmp/file.erb"]).processed
end
end
end
Expand All @@ -246,7 +246,7 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
process_variants_with :mini_magick do
blob = create_file_blob(filename: "racecar.jpg")
assert_raise(ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingArgument) do
blob.variant(saver: {"-write": "/tmp/file.erb"}).processed
blob.variant(saver: { "-write": "/tmp/file.erb" }).processed
end
end
end
Expand All @@ -255,11 +255,11 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
process_variants_with :mini_magick do
blob = create_file_blob(filename: "racecar.jpg")
assert_raise(ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingArgument) do
blob.variant(saver: {"something": {"-write": "/tmp/file.erb"}}).processed
blob.variant(saver: { "something": { "-write": "/tmp/file.erb" } }).processed
end

assert_raise(ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingArgument) do
blob.variant(saver: {"something": ["-write", "/tmp/file.erb"]}).processed
blob.variant(saver: { "something": ["-write", "/tmp/file.erb"] }).processed
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion railties/test/application/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,7 @@ class MyLogger < ::Logger
app "development"

assert ActiveStorage.unsupported_image_processing_arguments.include?("-danger")
refute ActiveStorage.unsupported_image_processing_arguments.include?("-set")
assert_not ActiveStorage.unsupported_image_processing_arguments.include?("-set")
end

test "hosts include .localhost in development" do
Expand Down

0 comments on commit c67e8d8

Please sign in to comment.