Skip to content
This repository
Browse code

A test to prevent regression of the E2BIG problem

  • Loading branch information...
commit 69bcf6e499105f86f5ee116c644de6c60fcdeb57 1 parent a16a50a
Jon Yurek authored
2  lib/paperclip/helpers.rb
@@ -24,7 +24,7 @@ def interpolates key, &block
24 24
     #
25 25
     def run(cmd, arguments = "", local_options = {})
26 26
       command_path = options[:command_path]
27  
-      Cocaine::CommandLine.path = ( Cocaine::CommandLine.path ? [Cocaine::CommandLine.path].flatten | [command_path] : command_path )
  27
+      Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq
28 28
       local_options = local_options.merge(:logger => logger) if logging? && (options[:log_command] || local_options[:log_command])
29 29
       Cocaine::CommandLine.new(cmd, arguments, local_options).run
30 30
     end
8  test/paperclip_test.rb
@@ -33,6 +33,14 @@ class PaperclipTest < Test::Unit::TestCase
33 33
     end
34 34
   end
35 35
 
  36
+  should 'not raise errors when doing a lot of running' do
  37
+    Paperclip.options[:command_path] = ["/usr/local/bin"] * 1024
  38
+    Cocaine::CommandLine.path = "/something/else"
  39
+    100.times do |x|
  40
+      Paperclip.run("echo", x.to_s)
  41
+    end
  42
+  end
  43
+
36 44
   context "Calling Paperclip.log without options[:logger] set" do
37 45
     setup do
38 46
       Paperclip.logger = nil

0 notes on commit 69bcf6e

Please sign in to comment.
Something went wrong with that request. Please try again.