From 04c951484fb8fba4951a06ef5eae7e47a7bd3288 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 24 Feb 2012 09:12:05 -0500 Subject: [PATCH] Revert "Paperclip#run now respects swallow_stderr setting. Fix for #741" This reverts commit 58671ebfffe3b03177d9ad248737932441fe4016. I am reverting this because the tests broke and because the code itself looks hideous. --- lib/paperclip.rb | 1 - test/paperclip_test.rb | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/lib/paperclip.rb b/lib/paperclip.rb index 02de02f14..d1bb0efe3 100644 --- a/lib/paperclip.rb +++ b/lib/paperclip.rb @@ -99,7 +99,6 @@ def run(cmd, arguments = "", local_options = {}) command_path = options[:command_path] || options[:image_magick_path] Cocaine::CommandLine.path = ( Cocaine::CommandLine.path ? [Cocaine::CommandLine.path, command_path ].flatten : command_path ) local_options = local_options.merge(:logger => logger) if logging? && (options[:log_command] || local_options[:log_command]) - local_options = local_options.merge(:swallow_stderr => options[:swallow_stderr]) if !local_options[:swallow_stderr] && !options[:swallow_stderr].nil? Cocaine::CommandLine.new(cmd, arguments, local_options).run end diff --git a/test/paperclip_test.rb b/test/paperclip_test.rb index 9cad12c79..c11357c76 100644 --- a/test/paperclip_test.rb +++ b/test/paperclip_test.rb @@ -4,7 +4,6 @@ class PaperclipTest < Test::Unit::TestCase context "Calling Paperclip.run" do setup do Paperclip.options[:log_command] = false - Paperclip.options[:swallow_stderr] = nil Cocaine::CommandLine.expects(:new).with("convert", "stuff", {}).returns(stub(:run)) @original_command_line_path = Cocaine::CommandLine.path end @@ -23,18 +22,6 @@ class PaperclipTest < Test::Unit::TestCase Paperclip.run("convert", "stuff") assert_equal [Cocaine::CommandLine.path].flatten.include?("/opt/my_app/bin"), true end - - should "respect Paperclip.options[:swallow_stderr]" do - Paperclip.options[:swallow_stderr] = false - Cocaine::CommandLine.unstub(:new) - Cocaine::CommandLine.expects(:new).with("convert", "stuff", {:swallow_stderr => false}).returns(stub(:run)) - Paperclip.run("convert", "stuff") - - Paperclip.options[:swallow_stderr] = true - Cocaine::CommandLine.unstub(:new) - Cocaine::CommandLine.expects(:new).with("convert", "stuff", {:swallow_stderr => true}).returns(stub(:run)) - Paperclip.run("convert", "stuff") - end end context "Calling Paperclip.run with a logger" do