Skip to content

Commit

Permalink
Merge pull request thoughtbot#1949 from alassek/geometry-string-fix
Browse files Browse the repository at this point in the history
Fix GeometryParser for '@>' special case
  • Loading branch information
tute committed Aug 3, 2015
2 parents c819d5d + b0e515e commit 47b540d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/paperclip/geometry_parser_factory.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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
Expand Down
2 changes: 1 addition & 1 deletion spec/paperclip/geometry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
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
Expand Down

0 comments on commit 47b540d

Please sign in to comment.