drake 0.8.4.1.0.15 → 0.8.4.1.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.drake CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
2
  = Drake Changelog
3
3
 
4
+ == Version 0.8.4.1.0.16
5
+
6
+ * Merge with latest comp_tree.
7
+
4
8
  == Version 0.8.4.1.0.15
5
9
 
6
10
  * Merge with mainline rake-0.8.4.1.
data/Rakefile.drake CHANGED
@@ -46,9 +46,9 @@ task :drake_prerelease => [:clean, :gemspec] do
46
46
  raise "New stuff from remote repository"
47
47
  end
48
48
  %w[github.com rubyforge.org].each { |server|
49
- unless `ping -c2 #{server}` =~ %r!0% packet loss!
50
- raise "No ping for #{server}"
51
- end
49
+ #unless `ping -c2 #{server}` =~ %r!0% packet loss!
50
+ # raise "No ping for #{server}"
51
+ #end
52
52
  }
53
53
  end
54
54
 
data/bin/drake CHANGED
File without changes
File without changes
data/drake.gemspec ADDED
@@ -0,0 +1,201 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: drake
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.4.1.0.16
5
+ platform: ruby
6
+ authors:
7
+ - James M. Lawrence
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-29 00:00:00 -04:00
13
+ default_executable: drake
14
+ dependencies: []
15
+
16
+ description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
17
+ email: quixoticsycophant@gmail.com
18
+ executables:
19
+ - drake
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - MIT-LICENSE
25
+ - TODO
26
+ - CHANGES
27
+ - doc/command_line_usage.rdoc
28
+ - doc/glossary.rdoc
29
+ - doc/proto_rake.rdoc
30
+ - doc/rakefile.rdoc
31
+ - doc/rational.rdoc
32
+ - doc/release_notes/rake-0.4.14.rdoc
33
+ - doc/release_notes/rake-0.4.15.rdoc
34
+ - doc/release_notes/rake-0.5.0.rdoc
35
+ - doc/release_notes/rake-0.5.3.rdoc
36
+ - doc/release_notes/rake-0.5.4.rdoc
37
+ - doc/release_notes/rake-0.6.0.rdoc
38
+ - doc/release_notes/rake-0.7.0.rdoc
39
+ - doc/release_notes/rake-0.7.1.rdoc
40
+ - doc/release_notes/rake-0.7.2.rdoc
41
+ - doc/release_notes/rake-0.7.3.rdoc
42
+ - doc/release_notes/rake-0.8.0.rdoc
43
+ - doc/release_notes/rake-0.8.2.rdoc
44
+ - doc/release_notes/rake-0.8.3.rdoc
45
+ - doc/release_notes/rake-0.8.4.rdoc
46
+ files:
47
+ - install.rb
48
+ - CHANGES
49
+ - CHANGES.drake
50
+ - MIT-LICENSE
51
+ - README
52
+ - Rakefile
53
+ - Rakefile.drake
54
+ - TODO
55
+ - bin/drake
56
+ - lib/rake/alt_system.rb
57
+ - lib/rake/classic_namespace.rb
58
+ - lib/rake/clean.rb
59
+ - lib/rake/contrib/compositepublisher.rb
60
+ - lib/rake/contrib/ftptools.rb
61
+ - lib/rake/contrib/publisher.rb
62
+ - lib/rake/contrib/rubyforgepublisher.rb
63
+ - lib/rake/contrib/sshpublisher.rb
64
+ - lib/rake/contrib/sys.rb
65
+ - lib/rake/gempackagetask.rb
66
+ - lib/rake/loaders/makefile.rb
67
+ - lib/rake/packagetask.rb
68
+ - lib/rake/parallel.rb
69
+ - lib/rake/rake_test_loader.rb
70
+ - lib/rake/rdoctask.rb
71
+ - lib/rake/ruby182_test_unit_fix.rb
72
+ - lib/rake/runtest.rb
73
+ - lib/rake/tasklib.rb
74
+ - lib/rake/testtask.rb
75
+ - lib/rake/win32.rb
76
+ - lib/rake.rb
77
+ - lib/rake/comp_tree/algorithm.rb
78
+ - lib/rake/comp_tree/diagnostic.rb
79
+ - lib/rake/comp_tree/driver.rb
80
+ - lib/rake/comp_tree/error.rb
81
+ - lib/rake/comp_tree/node.rb
82
+ - test/capture_stdout.rb
83
+ - test/check_expansion.rb
84
+ - test/check_no_expansion.rb
85
+ - test/contrib/test_sys.rb
86
+ - test/data/rakelib/test1.rb
87
+ - test/data/rbext/rakefile.rb
88
+ - test/filecreation.rb
89
+ - test/functional.rb
90
+ - test/in_environment.rb
91
+ - test/parallel.rb
92
+ - test/rake_test_setup.rb
93
+ - test/reqfile.rb
94
+ - test/reqfile2.rb
95
+ - test/session_functional.rb
96
+ - test/shellcommand.rb
97
+ - test/single_threaded.rb
98
+ - test/test_application.rb
99
+ - test/test_clean.rb
100
+ - test/test_definitions.rb
101
+ - test/test_earlytime.rb
102
+ - test/test_extension.rb
103
+ - test/test_file_creation_task.rb
104
+ - test/test_file_task.rb
105
+ - test/test_filelist.rb
106
+ - test/test_fileutils.rb
107
+ - test/test_ftp.rb
108
+ - test/test_invocation_chain.rb
109
+ - test/test_makefile_loader.rb
110
+ - test/test_multitask.rb
111
+ - test/test_namespace.rb
112
+ - test/test_package_task.rb
113
+ - test/test_parallel.rb
114
+ - test/test_pathmap.rb
115
+ - test/test_pseudo_status.rb
116
+ - test/test_rake.rb
117
+ - test/test_rdoc_task.rb
118
+ - test/test_require.rb
119
+ - test/test_rules.rb
120
+ - test/test_task_arguments.rb
121
+ - test/test_task_manager.rb
122
+ - test/test_tasklib.rb
123
+ - test/test_tasks.rb
124
+ - test/test_test_task.rb
125
+ - test/test_top_level_functions.rb
126
+ - test/test_win32.rb
127
+ - test/data/imports/deps.mf
128
+ - test/data/sample.mf
129
+ - test/Rakefile.seq
130
+ - test/Rakefile.simple
131
+ - test/data/chains/Rakefile
132
+ - test/data/default/Rakefile
133
+ - test/data/dryrun/Rakefile
134
+ - test/data/file_creation_task/Rakefile
135
+ - test/data/imports/Rakefile
136
+ - test/data/multidesc/Rakefile
137
+ - test/data/namespace/Rakefile
138
+ - test/data/statusreturn/Rakefile
139
+ - test/data/unittest/Rakefile
140
+ - test/data/unittest/subdir
141
+ - doc/command_line_usage.rdoc
142
+ - doc/example
143
+ - doc/example/Rakefile1
144
+ - doc/example/Rakefile2
145
+ - doc/example/a.c
146
+ - doc/example/b.c
147
+ - doc/example/main.c
148
+ - doc/glossary.rdoc
149
+ - doc/jamis.rb
150
+ - doc/proto_rake.rdoc
151
+ - doc/rake.1.gz
152
+ - doc/rakefile.rdoc
153
+ - doc/rational.rdoc
154
+ - doc/release_notes
155
+ - doc/release_notes/rake-0.4.14.rdoc
156
+ - doc/release_notes/rake-0.4.15.rdoc
157
+ - doc/release_notes/rake-0.5.0.rdoc
158
+ - doc/release_notes/rake-0.5.3.rdoc
159
+ - doc/release_notes/rake-0.5.4.rdoc
160
+ - doc/release_notes/rake-0.6.0.rdoc
161
+ - doc/release_notes/rake-0.7.0.rdoc
162
+ - doc/release_notes/rake-0.7.1.rdoc
163
+ - doc/release_notes/rake-0.7.2.rdoc
164
+ - doc/release_notes/rake-0.7.3.rdoc
165
+ - doc/release_notes/rake-0.8.0.rdoc
166
+ - doc/release_notes/rake-0.8.2.rdoc
167
+ - doc/release_notes/rake-0.8.3.rdoc
168
+ - doc/release_notes/rake-0.8.4.rdoc
169
+ has_rdoc: true
170
+ homepage: http://drake.rubyforge.org
171
+ post_install_message:
172
+ rdoc_options:
173
+ - --line-numbers
174
+ - --inline-source
175
+ - --main
176
+ - README
177
+ - --title
178
+ - "Drake: Distributed Rake"
179
+ require_paths:
180
+ - lib
181
+ required_ruby_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: "0"
186
+ version:
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: "0"
192
+ version:
193
+ requirements: []
194
+
195
+ rubyforge_project: drake
196
+ rubygems_version: 1.3.1
197
+ signing_key:
198
+ specification_version: 2
199
+ summary: A fork of Rake supporting parallel task execution.
200
+ test_files: []
201
+
data/lib/rake.rb CHANGED
@@ -29,7 +29,7 @@
29
29
  # as a library via a require statement, but it can be distributed
30
30
  # independently as an application.
31
31
 
32
- RAKEVERSION = '0.8.4.1.0.15'
32
+ RAKEVERSION = '0.8.4.1.0.16'
33
33
 
34
34
  require 'rbconfig'
35
35
  require 'fileutils'
@@ -1,100 +1,112 @@
1
1
 
2
2
  require 'rake/comp_tree/diagnostic'
3
3
 
4
+ module Rake end
4
5
  module Rake::CompTree
5
6
  module Algorithm
6
7
  include Diagnostic
7
8
 
8
- def compute_multithreaded(root, num_threads, use_fork, buckets)
9
+ module_function
10
+
11
+ def loop_with(leave, again)
12
+ catch(leave) {
13
+ while true
14
+ catch(again) {
15
+ yield
16
+ }
17
+ end
18
+ }
19
+ end
20
+
21
+ def compute_multithreaded(root, num_threads)
9
22
  trace "Computing #{root.name} with #{num_threads} threads"
23
+
10
24
  result = nil
11
- mutex = Mutex.new
25
+
26
+ tree_mutex = Mutex.new
12
27
  node_finished_condition = ConditionVariable.new
13
28
  thread_wake_condition = ConditionVariable.new
14
- threads = []
15
-
16
- # workaround: jruby gives "run" status for waiting on
17
- # condition variable
18
- num_threads_ready = 0
19
-
20
- num_threads.times { |thread_index|
21
- threads << Thread.new {
29
+ num_threads_in_use = 0
30
+
31
+ threads = (0...num_threads).map { |thread_index|
32
+ Thread.new {
22
33
  #
23
34
  # wait for main thread
24
35
  #
25
- mutex.synchronize {
36
+ tree_mutex.synchronize {
26
37
  trace "Thread #{thread_index} waiting to start"
27
- num_threads_ready += 1
28
- thread_wake_condition.wait(mutex)
38
+ num_threads_in_use += 1
39
+ thread_wake_condition.wait(tree_mutex)
29
40
  }
30
41
 
31
- while true
32
- trace "Thread #{thread_index} node search"
33
-
34
- #
35
- # Done! Thread will exit.
36
- #
37
- break if mutex.synchronize {
38
- result
39
- }
40
-
41
- #
42
- # Lock the tree and find a node. The node we
43
- # obtain, if any, is already locked.
44
- #
45
- node = mutex.synchronize {
46
- find_node(root)
42
+ loop_with(:leave, :again) {
43
+ node = tree_mutex.synchronize {
44
+ trace "Thread #{thread_index} aquired tree lock; begin node search"
45
+ if result
46
+ trace "Thread #{thread_index} detected finish"
47
+ num_threads_in_use -= 1
48
+ throw :leave
49
+ else
50
+ #
51
+ # Find a node. The node we obtain, if any, will be locked.
52
+ #
53
+ if node = find_node(root)
54
+ trace "Thread #{thread_index} found node #{node.name}"
55
+ node
56
+ else
57
+ trace "Thread #{thread_index}: no node found; sleeping."
58
+ thread_wake_condition.wait(tree_mutex)
59
+ throw :again
60
+ end
61
+ end
47
62
  }
48
63
 
49
- if node
50
- trace "Thread #{thread_index} found node #{node.name}"
51
-
52
- node_result =
53
- compute_node(
54
- node,
55
- use_fork,
56
- buckets ? buckets[thread_index] : nil)
57
-
58
- mutex.synchronize {
59
- node.result = node_result
64
+ trace "Thread #{thread_index} computing node"
65
+ node_result = compute_node(node)
66
+ trace "Thread #{thread_index} node computed; waiting for tree lock"
67
+
68
+ tree_mutex.synchronize {
69
+ trace "Thread #{thread_index} acquired tree lock"
70
+ debug {
71
+ name = "#{node.name}" + ((node == root) ? " (ROOT NODE)" : "")
72
+ initial = "Thread #{thread_index} compute result for #{name}: "
73
+ status = node_result.is_a?(Exception) ? "error" : "success"
74
+ trace initial + status
75
+ trace "Thread #{thread_index} node result: #{node_result}"
60
76
  }
61
77
 
78
+ node.result = node_result
79
+
62
80
  #
63
81
  # remove locks for this node (shared lock and own lock)
64
82
  #
65
- mutex.synchronize {
66
- node.unlock
67
- if node == root
68
- #
69
- # Root node was computed; we are done.
70
- #
71
- trace "Thread #{thread_index} got final answer"
72
- result = root.result
73
- end
74
- node_finished_condition.signal
75
- }
76
- else
77
- trace "Thread #{thread_index}: no node found; sleeping."
78
- mutex.synchronize {
79
- thread_wake_condition.wait(mutex)
80
- }
81
- end
82
- end
83
+ node.unlock
84
+
85
+ if node == root or node_result.is_a? Exception
86
+ #
87
+ # Root node was computed or error occurred; we are done.
88
+ #
89
+ result = node_result
90
+ end
91
+
92
+ #
93
+ # Tell the main thread that another node was computed.
94
+ #
95
+ node_finished_condition.signal
96
+ }
97
+ }
83
98
  trace "Thread #{thread_index} exiting"
84
99
  }
85
100
  }
86
101
 
87
102
  trace "Main: waiting for threads to launch and block."
88
- while true
89
- break if mutex.synchronize {
90
- num_threads_ready == num_threads
91
- }
103
+ until tree_mutex.synchronize { num_threads_in_use == num_threads }
92
104
  Thread.pass
93
105
  end
94
-
95
- trace "Main: entering main loop"
96
- mutex.synchronize {
97
- while true
106
+
107
+ tree_mutex.synchronize {
108
+ trace "Main: entering main loop"
109
+ until num_threads_in_use == 0
98
110
  trace "Main: waking threads"
99
111
  thread_wake_condition.broadcast
100
112
 
@@ -104,30 +116,32 @@ module Rake::CompTree
104
116
  end
105
117
 
106
118
  trace "Main: waiting for a node"
107
- node_finished_condition.wait(mutex)
119
+ node_finished_condition.wait(tree_mutex)
108
120
  trace "Main: got a node"
109
121
  end
110
122
  }
111
123
 
112
124
  trace "Main: waiting for threads to finish."
113
- catch(:done) {
114
- while true
115
- mutex.synchronize {
116
- throw :done if threads.all? { |thread|
117
- thread.status == false
118
- }
119
- thread_wake_condition.broadcast
120
- }
121
- Thread.pass
122
- end
125
+ loop_with(:leave, :again) {
126
+ tree_mutex.synchronize {
127
+ if threads.all? { |thread| thread.status == false }
128
+ throw :leave
129
+ end
130
+ thread_wake_condition.broadcast
131
+ }
132
+ Thread.pass
123
133
  }
124
134
 
125
135
  trace "Main: computation done."
126
- result
136
+ if result.is_a? Exception
137
+ raise result
138
+ else
139
+ result
140
+ end
127
141
  end
128
142
 
129
143
  def find_node(node)
130
- # --- only called inside mutex
144
+ # --- only called inside shared tree mutex
131
145
  trace "Looking for a node, starting with #{node.name}"
132
146
  if node.result
133
147
  #
@@ -135,11 +149,12 @@ module Rake::CompTree
135
149
  #
136
150
  trace "#{node.name} has been computed"
137
151
  nil
138
- elsif node.children_results and node.try_lock
152
+ elsif (children_results = node.find_children_results) and node.try_lock
139
153
  #
140
154
  # Node is not computed and its children are computed;
141
155
  # and we have the lock. Ready to compute.
142
156
  #
157
+ node.children_results = children_results
143
158
  node
144
159
  else
145
160
  #
@@ -155,55 +170,13 @@ module Rake::CompTree
155
170
  end
156
171
  end
157
172
 
158
- def compute_node(node, use_fork, bucket)
159
- if use_fork
160
- trace "About to fork for node #{node.name}"
161
- if bucket
162
- #
163
- # Use our assigned bucket to transfer the result.
164
- #
165
- fork_node(node) {
166
- node.trace_compute
167
- bucket.contents = node.compute
168
- }
169
- bucket.contents
170
- else
171
- #
172
- # No bucket -- discarding result
173
- #
174
- fork_node(node) {
175
- node.trace_compute
176
- node.compute
177
- }
178
- true
179
- end
180
- else
181
- #
182
- # No fork
183
- #
173
+ def compute_node(node)
174
+ begin
184
175
  node.trace_compute
185
176
  node.compute
177
+ rescue Exception => e
178
+ e
186
179
  end
187
180
  end
188
-
189
- def fork_node(node)
190
- trace "About to fork for node #{node.name}"
191
- process_id = RetriableFork.fork {
192
- trace "Fork: process #{Process.pid}"
193
- node.trace_compute
194
- yield
195
- trace "Fork: computation done"
196
- }
197
- trace "Waiting for process #{process_id}"
198
- Process.wait(process_id)
199
- trace "Process #{process_id} finished"
200
- exitstatus = $?.exitstatus
201
- if exitstatus != 0
202
- trace "Process #{process_id} returned #{exitstatus}; exiting."
203
- exit(1)
204
- end
205
- end
206
-
207
- extend self
208
181
  end
209
182
  end
@@ -1,18 +1,18 @@
1
1
 
2
- require 'rake/comp_tree/tap'
3
-
4
- module Rake ; end
2
+ module Rake end
5
3
  module Rake::CompTree
6
4
  module Diagnostic
5
+ module_function
6
+
7
7
  def show(desc = nil, stream = STDOUT, &block)
8
8
  if desc
9
9
  stream.puts(desc)
10
10
  end
11
11
  if block
12
12
  expression = block.call
13
- eval(expression, block.binding).tap { |result|
14
- stream.printf("%-16s => %s\n", expression, result.inspect)
15
- }
13
+ result = eval(expression, block.binding)
14
+ stream.printf("%-16s => %s\n", expression, result.inspect)
15
+ result
16
16
  end
17
17
  end
18
18
 
@@ -26,20 +26,13 @@ module Rake::CompTree
26
26
  end
27
27
 
28
28
  def trace(desc = nil, &block)
29
- if desc
30
- show("#{desc}.".sub(%r!\.\.+\Z!, ""), STDERR, &block)
31
- else
32
- show(nil, STDERR, &block)
33
- end
29
+ show(desc, STDERR, &block)
34
30
  end
35
31
  else
36
- # non-$DEBUG
37
32
  def debug ; end
38
33
  def debugging? ; end
39
34
  def trace(*args) ; end
40
35
  end
41
-
42
- extend self
43
36
  end
44
37
  end
45
38
 
@@ -1,57 +1,33 @@
1
1
 
2
2
  require 'rake/comp_tree/diagnostic'
3
- require 'rake/comp_tree/misc'
4
3
  require 'rake/comp_tree/algorithm'
5
4
  require 'rake/comp_tree/node'
6
- require 'rake/comp_tree/task_node'
7
5
  require 'rake/comp_tree/error'
8
6
 
9
7
  require 'thread'
10
8
 
9
+ module Rake end
11
10
  module Rake::CompTree
12
11
  #
13
12
  # Driver is the main interface to the computation tree. It is
14
13
  # responsible for defining nodes and running computations.
15
14
  #
16
15
  class Driver
17
- DEFAULTS = {
18
- :threads => 1,
19
- :fork => false,
20
- :timeout => 5.0,
21
- :wait_interval => 0.02,
22
- }
23
-
24
16
  include Diagnostic
25
- include Misc
17
+ include Algorithm
26
18
 
27
19
  #
28
20
  # Begin a new computation tree.
29
21
  #
30
22
  # Options hash:
31
23
  #
32
- # <tt>:node_class</tt> -- (Class) Rake::CompTree::Node subclass from
24
+ # <tt>:node_class</tt> -- (Class) CompTree::Node subclass from
33
25
  # which nodes are created.
34
26
  #
35
- # <tt>:discard_result</tt> -- (boolean) If you are <em>not</em>
36
- # interested in the final answer, but only in the actions which
37
- # complete the computation, then set this to +true+. This is
38
- # equivalent to saying <tt>:node_class => Rake::CompTree::TaskNode</tt>.
39
- # (If you are forking processes, it is good to know that IPC is
40
- # not needed to communicate the result.)
41
- #
42
27
  def initialize(opts = nil)
43
- if opts and opts[:node_class] and opts[:discard_result]
44
- raise(
45
- Error::ArgumentError,
46
- "#{self.class.name}.new: :discard_result and :node_class " +
47
- "are mutually exclusive")
48
- end
49
-
50
28
  @node_class =
51
29
  if opts and opts[:node_class]
52
30
  opts[:node_class]
53
- elsif opts and opts[:discard_result]
54
- TaskNode
55
31
  else
56
32
  Node
57
33
  end
@@ -180,7 +156,7 @@ module Rake::CompTree
180
156
 
181
157
  #
182
158
  # Check for a cyclic graph below the given node. Raises
183
- # Rake::CompTree::Error::CircularError if found.
159
+ # CompTree::Error::CircularError if found.
184
160
  #
185
161
  # Arguments:
186
162
  #
@@ -206,60 +182,19 @@ module Rake::CompTree
206
182
  #
207
183
  # +name+ -- (Symbol) node name.
208
184
  #
209
- # Options hash:
185
+ # +threads+ -- (Integer) number of threads.
210
186
  #
211
- # <tt>:threads</tt> -- (Integer) Number of parallel threads.
212
- #
213
- # <tt>:fork</tt> -- (boolean) Whether to fork each computation
214
- # node into its own process.
215
- #
216
- # Defaults options are taken from Driver::DEFAULTS.
217
- #
218
- def compute(name, opts = nil)
219
- #
220
- # Undocumented options:
221
- #
222
- # <tt>:wait_interval</tt> -- (seconds) (Obscure) How long to
223
- # wait after an IPC failure.
224
- #
225
- # <tt>:timeout</tt> -- (seconds) (Obscure) Give up after this
226
- # period of persistent IPC failures.
227
- #
228
-
229
- abort_on_exception {
230
- compute_private(name, opts || Hash.new)
231
- }
232
- end
233
-
234
- private
235
-
236
- def compute_private(name, opts_in)
237
- opts = DEFAULTS.merge(opts_in)
187
+ def compute(name, threads)
238
188
  root = @nodes[name]
239
189
 
240
- if opts[:threads] < 1
241
- raise Error::ArgumentError, "threads is #{opts[:threads]}"
190
+ if threads < 1
191
+ raise Error::ArgumentError, "threads is #{threads}"
242
192
  end
243
193
 
244
- if opts[:threads] == 1
194
+ if threads == 1
245
195
  root.result = root.compute_now
246
- elsif opts[:fork] and not @node_class.discard_result?
247
- #
248
- # Use buckets to send results across forks.
249
- #
250
- result = nil
251
- BucketIPC::Driver.new(opts[:threads], opts) { |buckets|
252
- result =
253
- Algorithm.compute_multithreaded(
254
- root, opts[:threads], opts[:fork], buckets)
255
- }
256
- result
257
196
  else
258
- #
259
- # Multithreaded computation without fork.
260
- #
261
- Algorithm.compute_multithreaded(
262
- root, opts[:threads], opts[:fork], nil)
197
+ compute_multithreaded(root, threads)
263
198
  end
264
199
  end
265
200
  end
@@ -1,10 +1,11 @@
1
1
 
2
+ module Rake end
2
3
  module Rake::CompTree
3
4
  module Error
4
- # Base class for Rake::CompTree errors.
5
+ # Base class for CompTree errors.
5
6
  class Base < StandardError ; end
6
7
 
7
- # Internal error inside Rake::CompTree. Please send a bug report.
8
+ # Internal error inside CompTree. Please send a bug report.
8
9
  class AssertionFailed < Base ; end
9
10
 
10
11
  # Bad arguments were passed to a method.
@@ -2,6 +2,7 @@
2
2
  require 'rake/comp_tree/diagnostic'
3
3
  require 'thread'
4
4
 
5
+ module Rake end
5
6
  module Rake::CompTree
6
7
  #
7
8
  # Base class for nodes in the computation tree.
@@ -83,21 +84,20 @@ module Rake::CompTree
83
84
  # If all children have been computed, return their results;
84
85
  # otherwise return nil.
85
86
  #
86
- def children_results #:nodoc:
87
+ def find_children_results #:nodoc:
87
88
  if @children_results
88
89
  @children_results
89
90
  else
90
- results = @children.map { |child|
91
- if child_result = child.result
92
- child_result
93
- else
94
- return nil
95
- end
91
+ @children.map { |child|
92
+ child.result or return nil
96
93
  }
97
- @children_results = results
98
94
  end
99
95
  end
100
96
 
97
+ def children_results=(value) #:nodoc:
98
+ @children_results = value
99
+ end
100
+
101
101
  def trace_compute #:nodoc:
102
102
  debug {
103
103
  # --- own mutex
data/lib/rake/parallel.rb CHANGED
@@ -6,7 +6,7 @@ require 'rake/comp_tree/driver'
6
6
  module Rake
7
7
  module TaskManager
8
8
  def invoke_parallel(root_task_name) # :nodoc:
9
- CompTree::Driver.new(:discard_result => true) { |driver|
9
+ CompTree::Driver.new { |driver|
10
10
  #
11
11
  # Build the computation tree from task prereqs.
12
12
  #
@@ -18,6 +18,7 @@ module Rake
18
18
  }
19
19
  driver.define(task_name.to_sym, *children_names) {
20
20
  task.execute(task_args)
21
+ true
21
22
  }
22
23
  }
23
24
 
@@ -39,10 +40,7 @@ module Rake
39
40
  #
40
41
  # Launch the computation.
41
42
  #
42
- driver.compute(
43
- root_node.name,
44
- :threads => num_threads,
45
- :fork => false)
43
+ driver.compute(root_node.name, num_threads)
46
44
  end
47
45
  }
48
46
  end
File without changes
data/rake.blurb ADDED
@@ -0,0 +1,19 @@
1
+ name: rake
2
+ document: http://rake.rubyforge.org
3
+ download: http://rubyforge.org/project/showfiles.php?group_id=50
4
+ description: >
5
+ <p>This package contains Rake, a simple ruby build program with
6
+ capabilities similar to make.</p>
7
+
8
+ <p> Rake has the following features: </p>
9
+
10
+ <ul>
11
+ <li>Rakefiles (rake&#8217;s version of Makefiles) are completely
12
+ defined in standard Ruby syntax. No XML files to edit. No quirky
13
+ Makefile syntax to worry about (is that a tab or a space?)</li>
14
+ <li>Users can specify tasks with prerequisites.</li>
15
+ <li>Rake supports rule patterns to sythesize implicit tasks.</li>
16
+ <li>Rake is lightweight. It can be distributed with other
17
+ projects as a single file. Projects that depend upon rake do not
18
+ require that rake be installed on target systems.</li>
19
+ </ul>
data/rake.gemspec ADDED
@@ -0,0 +1,186 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rake
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.3.100
5
+ platform: ruby
6
+ authors:
7
+ - Jim Weirich
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-13 00:00:00 -05:00
13
+ default_executable: rake
14
+ dependencies: []
15
+
16
+ description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
17
+ email: jim@weirichhouse.org
18
+ executables:
19
+ - rake
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - MIT-LICENSE
25
+ - TODO
26
+ - CHANGES
27
+ - doc/command_line_usage.rdoc
28
+ - doc/glossary.rdoc
29
+ - doc/proto_rake.rdoc
30
+ - doc/rakefile.rdoc
31
+ - doc/rational.rdoc
32
+ - doc/release_notes/rake-0.4.14.rdoc
33
+ - doc/release_notes/rake-0.4.15.rdoc
34
+ - doc/release_notes/rake-0.5.0.rdoc
35
+ - doc/release_notes/rake-0.5.3.rdoc
36
+ - doc/release_notes/rake-0.5.4.rdoc
37
+ - doc/release_notes/rake-0.6.0.rdoc
38
+ - doc/release_notes/rake-0.7.0.rdoc
39
+ - doc/release_notes/rake-0.7.1.rdoc
40
+ - doc/release_notes/rake-0.7.2.rdoc
41
+ - doc/release_notes/rake-0.7.3.rdoc
42
+ - doc/release_notes/rake-0.8.0.rdoc
43
+ - doc/release_notes/rake-0.8.2.rdoc
44
+ - doc/release_notes/rake-0.8.3.rdoc
45
+ - doc/release_notes/rake-0.8.4.rdoc
46
+ files:
47
+ - install.rb
48
+ - CHANGES
49
+ - MIT-LICENSE
50
+ - Rakefile
51
+ - README
52
+ - TODO
53
+ - bin/rake
54
+ - lib/rake/classic_namespace.rb
55
+ - lib/rake/clean.rb
56
+ - lib/rake/contrib/compositepublisher.rb
57
+ - lib/rake/contrib/ftptools.rb
58
+ - lib/rake/contrib/publisher.rb
59
+ - lib/rake/contrib/rubyforgepublisher.rb
60
+ - lib/rake/contrib/sshpublisher.rb
61
+ - lib/rake/contrib/sys.rb
62
+ - lib/rake/gempackagetask.rb
63
+ - lib/rake/loaders/makefile.rb
64
+ - lib/rake/packagetask.rb
65
+ - lib/rake/rake_test_loader.rb
66
+ - lib/rake/rdoctask.rb
67
+ - lib/rake/repaired_system.rb
68
+ - lib/rake/ruby182_test_unit_fix.rb
69
+ - lib/rake/runtest.rb
70
+ - lib/rake/tasklib.rb
71
+ - lib/rake/testtask.rb
72
+ - lib/rake/win32.rb
73
+ - lib/rake.rb
74
+ - test/capture_stdout.rb
75
+ - test/check_expansion.rb
76
+ - test/contrib/test_sys.rb
77
+ - test/data/rakelib/test1.rb
78
+ - test/data/rbext/rakefile.rb
79
+ - test/filecreation.rb
80
+ - test/functional.rb
81
+ - test/in_environment.rb
82
+ - test/rake_test_setup.rb
83
+ - test/reqfile.rb
84
+ - test/reqfile2.rb
85
+ - test/session_functional.rb
86
+ - test/shellcommand.rb
87
+ - test/test_application.rb
88
+ - test/test_clean.rb
89
+ - test/test_definitions.rb
90
+ - test/test_earlytime.rb
91
+ - test/test_extension.rb
92
+ - test/test_file_creation_task.rb
93
+ - test/test_file_task.rb
94
+ - test/test_filelist.rb
95
+ - test/test_fileutils.rb
96
+ - test/test_ftp.rb
97
+ - test/test_invocation_chain.rb
98
+ - test/test_makefile_loader.rb
99
+ - test/test_multitask.rb
100
+ - test/test_namespace.rb
101
+ - test/test_package_task.rb
102
+ - test/test_pathmap.rb
103
+ - test/test_rake.rb
104
+ - test/test_rdoc_task.rb
105
+ - test/test_require.rb
106
+ - test/test_rules.rb
107
+ - test/test_task_arguments.rb
108
+ - test/test_task_manager.rb
109
+ - test/test_tasklib.rb
110
+ - test/test_tasks.rb
111
+ - test/test_test_task.rb
112
+ - test/test_top_level_functions.rb
113
+ - test/test_win32.rb
114
+ - test/data/imports/deps.mf
115
+ - test/data/sample.mf
116
+ - test/data/chains/Rakefile
117
+ - test/data/default/Rakefile
118
+ - test/data/dryrun/Rakefile
119
+ - test/data/file_creation_task/Rakefile
120
+ - test/data/imports/Rakefile
121
+ - test/data/multidesc/Rakefile
122
+ - test/data/namespace/Rakefile
123
+ - test/data/statusreturn/Rakefile
124
+ - test/data/unittest/Rakefile
125
+ - test/data/unittest/subdir
126
+ - doc/command_line_usage.rdoc
127
+ - doc/example
128
+ - doc/example/a.c
129
+ - doc/example/b.c
130
+ - doc/example/main.c
131
+ - doc/example/Rakefile1
132
+ - doc/example/Rakefile2
133
+ - doc/glossary.rdoc
134
+ - doc/jamis.rb
135
+ - doc/proto_rake.rdoc
136
+ - doc/rake.1.gz
137
+ - doc/rakefile.rdoc
138
+ - doc/rational.rdoc
139
+ - doc/release_notes
140
+ - doc/release_notes/rake-0.4.14.rdoc
141
+ - doc/release_notes/rake-0.4.15.rdoc
142
+ - doc/release_notes/rake-0.5.0.rdoc
143
+ - doc/release_notes/rake-0.5.3.rdoc
144
+ - doc/release_notes/rake-0.5.4.rdoc
145
+ - doc/release_notes/rake-0.6.0.rdoc
146
+ - doc/release_notes/rake-0.7.0.rdoc
147
+ - doc/release_notes/rake-0.7.1.rdoc
148
+ - doc/release_notes/rake-0.7.2.rdoc
149
+ - doc/release_notes/rake-0.7.3.rdoc
150
+ - doc/release_notes/rake-0.8.0.rdoc
151
+ - doc/release_notes/rake-0.8.2.rdoc
152
+ - doc/release_notes/rake-0.8.3.rdoc
153
+ - doc/release_notes/rake-0.8.4.rdoc
154
+ has_rdoc: true
155
+ homepage: http://rake.rubyforge.org
156
+ post_install_message:
157
+ rdoc_options:
158
+ - --line-numbers
159
+ - --inline-source
160
+ - --main
161
+ - README
162
+ - --title
163
+ - Rake -- Ruby Make
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: "0"
171
+ version:
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: "0"
177
+ version:
178
+ requirements: []
179
+
180
+ rubyforge_project: rake
181
+ rubygems_version: 1.3.1
182
+ signing_key:
183
+ specification_version: 2
184
+ summary: Ruby based make-like utility.
185
+ test_files: []
186
+
data/test/shellcommand.rb CHANGED
File without changes
@@ -11,24 +11,23 @@ if Rake.application.num_threads > 1
11
11
  ENV["RUBYLIB"] = lambda {
12
12
  lib = File.expand_path("#{here}/../lib")
13
13
  current = ENV["RUBYLIB"]
14
+ sep = Rake.application.windows? ? ";" : ":"
14
15
  if current
15
- "#{lib}:#{current}"
16
+ "#{lib}#{sep}#{current}"
16
17
  else
17
18
  lib
18
19
  end
19
20
  }.call
20
21
 
21
- Dir.chdir(here) {
22
- [
23
- "Rakefile.simple",
24
- "Rakefile.seq",
25
- ].each { |file|
26
- (1..5).each { |n|
27
- args = [rake, "--threads", n.to_s, "-f", file]
28
- puts("\n" + "-"*40)
29
- puts(args.join(" "))
30
- assert(system(*args))
31
- }
22
+ [
23
+ "Rakefile.simple",
24
+ "Rakefile.seq",
25
+ ].each { |file|
26
+ (1..5).each { |n|
27
+ args = [rake, "--threads", n.to_s, "-f", "test/#{file}"]
28
+ puts("\n" + "-"*40)
29
+ puts(args.join(" "))
30
+ assert(ruby(*args))
32
31
  }
33
32
  }
34
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4.1.0.15
4
+ version: 0.8.4.1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - James M. Lawrence
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-14 00:00:00 -04:00
12
+ date: 2009-03-29 00:00:00 -04:00
13
13
  default_executable: drake
14
14
  dependencies: []
15
15
 
@@ -45,17 +45,32 @@ extra_rdoc_files:
45
45
  - doc/release_notes/rake-0.8.4.rdoc
46
46
  files:
47
47
  - install.rb
48
+ - bin
48
49
  - CHANGES
49
50
  - CHANGES.drake
51
+ - contrib
52
+ - doc
53
+ - drake.gemspec
54
+ - lib
50
55
  - MIT-LICENSE
51
- - README
56
+ - pkg
57
+ - rake.blurb
58
+ - rake.gemspec
52
59
  - Rakefile
53
60
  - Rakefile.drake
61
+ - rakelib
62
+ - README
63
+ - test
54
64
  - TODO
55
65
  - bin/drake
56
66
  - lib/rake/alt_system.rb
57
67
  - lib/rake/classic_namespace.rb
58
68
  - lib/rake/clean.rb
69
+ - lib/rake/comp_tree/algorithm.rb
70
+ - lib/rake/comp_tree/diagnostic.rb
71
+ - lib/rake/comp_tree/driver.rb
72
+ - lib/rake/comp_tree/error.rb
73
+ - lib/rake/comp_tree/node.rb
59
74
  - lib/rake/contrib/compositepublisher.rb
60
75
  - lib/rake/contrib/ftptools.rb
61
76
  - lib/rake/contrib/publisher.rb
@@ -74,14 +89,6 @@ files:
74
89
  - lib/rake/testtask.rb
75
90
  - lib/rake/win32.rb
76
91
  - lib/rake.rb
77
- - lib/rake/comp_tree/algorithm.rb
78
- - lib/rake/comp_tree/diagnostic.rb
79
- - lib/rake/comp_tree/driver.rb
80
- - lib/rake/comp_tree/error.rb
81
- - lib/rake/comp_tree/misc.rb
82
- - lib/rake/comp_tree/node.rb
83
- - lib/rake/comp_tree/tap.rb
84
- - lib/rake/comp_tree/task_node.rb
85
92
  - test/capture_stdout.rb
86
93
  - test/check_expansion.rb
87
94
  - test/check_no_expansion.rb
@@ -103,10 +110,10 @@ files:
103
110
  - test/test_definitions.rb
104
111
  - test/test_earlytime.rb
105
112
  - test/test_extension.rb
106
- - test/test_file_creation_task.rb
107
- - test/test_file_task.rb
108
113
  - test/test_filelist.rb
109
114
  - test/test_fileutils.rb
115
+ - test/test_file_creation_task.rb
116
+ - test/test_file_task.rb
110
117
  - test/test_ftp.rb
111
118
  - test/test_invocation_chain.rb
112
119
  - test/test_makefile_loader.rb
@@ -120,17 +127,15 @@ files:
120
127
  - test/test_rdoc_task.rb
121
128
  - test/test_require.rb
122
129
  - test/test_rules.rb
123
- - test/test_task_arguments.rb
124
- - test/test_task_manager.rb
125
130
  - test/test_tasklib.rb
126
131
  - test/test_tasks.rb
132
+ - test/test_task_arguments.rb
133
+ - test/test_task_manager.rb
127
134
  - test/test_test_task.rb
128
135
  - test/test_top_level_functions.rb
129
136
  - test/test_win32.rb
130
137
  - test/data/imports/deps.mf
131
138
  - test/data/sample.mf
132
- - test/Rakefile.seq
133
- - test/Rakefile.simple
134
139
  - test/data/chains/Rakefile
135
140
  - test/data/default/Rakefile
136
141
  - test/data/dryrun/Rakefile
@@ -140,14 +145,16 @@ files:
140
145
  - test/data/namespace/Rakefile
141
146
  - test/data/statusreturn/Rakefile
142
147
  - test/data/unittest/Rakefile
148
+ - test/Rakefile.seq
149
+ - test/Rakefile.simple
143
150
  - test/data/unittest/subdir
144
151
  - doc/command_line_usage.rdoc
145
152
  - doc/example
146
- - doc/example/Rakefile1
147
- - doc/example/Rakefile2
148
153
  - doc/example/a.c
149
154
  - doc/example/b.c
150
155
  - doc/example/main.c
156
+ - doc/example/Rakefile1
157
+ - doc/example/Rakefile2
151
158
  - doc/glossary.rdoc
152
159
  - doc/jamis.rb
153
160
  - doc/proto_rake.rdoc
@@ -1,62 +0,0 @@
1
-
2
- require 'thread'
3
-
4
- module Rake ; end
5
- module Rake::CompTree
6
- module Misc
7
- def let
8
- yield self
9
- end
10
-
11
- def singleton_class
12
- class << self
13
- self
14
- end
15
- end
16
-
17
- module Gensym
18
- @mutex = Mutex.new
19
- @count = 0
20
-
21
- def gensym(prefix = nil)
22
- count = Gensym.module_eval {
23
- @mutex.synchronize {
24
- @count += 1
25
- }
26
- }
27
- "#{prefix || :G}_#{count}".to_sym
28
- end
29
- end
30
- include Gensym
31
-
32
- def call_private(method, *args, &block)
33
- instance_eval { send(method, *args, &block) }
34
- end
35
-
36
- def with_warnings(value = true)
37
- previous = $VERBOSE
38
- $VERBOSE = value
39
- begin
40
- yield
41
- ensure
42
- $VERBOSE = previous
43
- end
44
- end
45
-
46
- def no_warnings(&block)
47
- with_warnings(false, &block)
48
- end
49
-
50
- def abort_on_exception(value = true)
51
- previous = Thread.abort_on_exception
52
- Thread.abort_on_exception = value
53
- begin
54
- yield
55
- ensure
56
- Thread.abort_on_exception = previous
57
- end
58
- end
59
-
60
- extend self
61
- end
62
- end
@@ -1,9 +0,0 @@
1
-
2
- unless respond_to? :tap
3
- module Kernel
4
- def tap
5
- yield self
6
- self
7
- end
8
- end
9
- end
@@ -1,22 +0,0 @@
1
-
2
- module Rake::CompTree
3
- #
4
- # TaskNode is a Node which discards its results
5
- #
6
- class TaskNode < Node
7
- def compute #:nodoc:
8
- @function.call
9
- true
10
- end
11
-
12
- class << self
13
- #
14
- # TaskNode always returns true.
15
- #
16
- def discard_result?
17
- true
18
- end
19
- end
20
- end
21
- end
22
-