Skip to content

Commit

Permalink
Revert "Paperclip#run now respects swallow_stderr setting. Fix for th…
Browse files Browse the repository at this point in the history
…oughtbot#741"

This reverts commit 58671eb.

I am reverting this because the tests broke and because the code itself
looks hideous.
  • Loading branch information
mike-burns committed Feb 24, 2012
1 parent eb314d5 commit 04c9514
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion lib/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 0 additions & 13 deletions test/paperclip_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 04c9514

Please sign in to comment.