lib/mini_magick.rb in mini_magick-1.3.2 vs lib/mini_magick.rb in mini_magick-1.3.3
- old
+ new
@@ -137,13 +137,15 @@
end
# If an unknown method is called then it is sent through the morgrify program
# Look here to find all the commands (http://www.imagemagick.org/script/mogrify.php)
def method_missing(symbol, *args)
- if MOGRIFY_COMMANDS.include?(symbol.to_s)
+ guessed_command_name = symbol.to_s.gsub('_','-')
+
+ if MOGRIFY_COMMANDS.include?(guessed_command_name)
args.push(@path) # push the path onto the end
- run_command("mogrify", "-#{symbol}", *args)
+ run_command("mogrify", "-#{guessed_command_name}", *args)
self
else
super(symbol, *args)
end
end
@@ -227,10 +229,10 @@
def initialize
@args = []
end
def method_missing(symbol, *args)
- @args << "-#{symbol}"
+ @args << "-#{symbol.to_s.gsub('_','-')}"
@args += args
end
def +(value)
@args << "+#{value}"