Commit 47b540d5 by Tute Costa

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

Fix GeometryParser for '@>' special case
parents c819d5da b0e515ee
module Paperclip
class GeometryParser
FORMAT = /\b(\d*)x?(\d*)\b(?:,(\d?))?([\>\<\#\@\%^!])?/i
FORMAT = /\b(\d*)x?(\d*)\b(?:,(\d?))?(\@\>|\>\@|[\>\<\#\@\%^!])?/i
def initialize(string)
@string = string
end
......
......@@ -82,7 +82,7 @@ describe Paperclip::Geometry do
assert_equal 456, @upper.height
end
['>', '<', '#', '@', '%', '^', '!', nil].each do |mod|
['>', '<', '#', '@', '@>', '>@', '%', '^', '!', nil].each do |mod|
it "ensures the modifier #{description} is preserved" do
assert @geo = Paperclip::Geometry.parse("123x456#{mod}")
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