Commit 47b540d5 by Tute Costa

Merge pull request #1949 from alassek/geometry-string-fix

Fix GeometryParser for '@>' special case
parents c819d5da b0e515ee
module Paperclip module Paperclip
class GeometryParser class GeometryParser
FORMAT = /\b(\d*)x?(\d*)\b(?:,(\d?))?([\>\<\#\@\%^!])?/i FORMAT = /\b(\d*)x?(\d*)\b(?:,(\d?))?(\@\>|\>\@|[\>\<\#\@\%^!])?/i
def initialize(string) def initialize(string)
@string = string @string = string
end end
......
...@@ -82,7 +82,7 @@ describe Paperclip::Geometry do ...@@ -82,7 +82,7 @@ describe Paperclip::Geometry do
assert_equal 456, @upper.height assert_equal 456, @upper.height
end end
['>', '<', '#', '@', '%', '^', '!', nil].each do |mod| ['>', '<', '#', '@', '@>', '>@', '%', '^', '!', nil].each do |mod|
it "ensures the modifier #{description} is preserved" do it "ensures the modifier #{description} is preserved" do
assert @geo = Paperclip::Geometry.parse("123x456#{mod}") assert @geo = Paperclip::Geometry.parse("123x456#{mod}")
assert_equal mod, @geo.modifier assert_equal mod, @geo.modifier
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment