[macruby-changes] [3346] MacRuby/trunk/rakelib/builder.rb

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 26 15:25:12 PST 2010


Revision: 3346
          http://trac.macosforge.org/projects/ruby/changeset/3346
Author:   eloy.de.enige at gmail.com
Date:     2010-01-26 15:25:10 -0800 (Tue, 26 Jan 2010)
Log Message:
-----------
Rename the `j' env variable to `jobs' and add to the rake -T output.

Modified Paths:
--------------
    MacRuby/trunk/rakelib/builder.rb

Modified: MacRuby/trunk/rakelib/builder.rb
===================================================================
--- MacRuby/trunk/rakelib/builder.rb	2010-01-26 23:21:44 UTC (rev 3345)
+++ MacRuby/trunk/rakelib/builder.rb	2010-01-26 23:25:10 UTC (rev 3346)
@@ -36,6 +36,7 @@
 ENABLE_STATIC_LIBRARY = do_option('enable_static_library', 'no') { 'yes' }
 ENABLE_DEBUG_LOGGING = do_option('enable_debug_logging', true) { |x| x == 'true' }
 UNEXPORTED_SYMBOLS_LIST = do_option('unexported_symbols_list', nil)
+SIMULTANEOUS_JOBS = do_option('jobs', 1) { |x| x.to_i }
 
 # Everything below this comment should *not* be modified.
 
@@ -126,15 +127,15 @@
 
 class Builder
   # Runs the given array of +commands+ in parallel. The amount of spawned
-  # simultaneous jobs is determined by the `j' env variable and defaults to 1.
+  # simultaneous jobs is determined by the `jobs' env variable. The default
+  # value is 1.
   #
   # When the members of the +commands+ array are in turn arrays of strings,
   # then those commands will be executed in consecutive order.
   def self.parallel_execute(commands)
-    @jobs ||= ENV['j'] ? ENV['j'].to_i : 1
     commands = commands.dup
 
-    Array.new(@jobs) do |i|
+    Array.new(SIMULTANEOUS_JOBS) do |i|
       Thread.new do
         while c = commands.shift
           Array(c).each { |command| sh(command) }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100126/76e0f8e8/attachment.html>


More information about the macruby-changes mailing list