Commit 3a35ba9f by Denis Yagofarov Committed by Prem Sichanugrist

Save Cocaine::CommandLine.path that already set

parent 825e1f15
......@@ -97,7 +97,8 @@ module Paperclip
if options[:image_magick_path]
Paperclip.log("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead")
end
Cocaine::CommandLine.path = options[:command_path] || options[:image_magick_path]
command_path = options[:command_path] || options[:image_magick_path]
Cocaine::CommandLine.path = ( Cocaine::CommandLine.path ? [Cocaine::CommandLine.path, command_path ].flatten : command_path )
Cocaine::CommandLine.new(cmd, *params).run
end
......
......@@ -6,6 +6,11 @@ class PaperclipTest < Test::Unit::TestCase
Cocaine::CommandLine.expects(:new).with("convert", "stuff").returns(stub(:run))
Paperclip.run("convert", "stuff")
end
should "save Cocaine::CommandLine.path that set before" do
Cocaine::CommandLine.path = "/opt/my_app/bin"
Paperclip.run("convert", "stuff")
assert_equal [Cocaine::CommandLine.path].flatten.include?("/opt/my_app/bin"), true
end
end
context "Paperclip.each_instance_with_attachment" do
......
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