barney 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -0
- data/README.md +1 -0
- data/Rakefile +2 -0
- data/lib/barney.rb +1 -1
- data/lib/barney/jobs.rb +8 -1
- metadata +1 -1
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -38,6 +38,7 @@ Documentation
|
|
38
38
|
**API**
|
39
39
|
|
40
40
|
* [master (git)](http://rubydoc.info/github/robgleeson/barney/master/)
|
41
|
+
* [0.15.1](http://rubydoc.info/gems/barney/0.15.0/)
|
41
42
|
* [0.15.0](http://rubydoc.info/gems/barney/0.15.0/)
|
42
43
|
* [0.14.0](http://rubydoc.info/gems/barney/0.14.0/)
|
43
44
|
* [0.13.0](http://rubydoc.info/gems/barney/0.13.0/)
|
data/Rakefile
CHANGED
data/lib/barney.rb
CHANGED
data/lib/barney/jobs.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
|
-
# Returns an Array populated by the return value of
|
1
|
+
# Returns an Array populated by the return value of a block.
|
2
2
|
# Each block is executed in a subprocess.
|
3
3
|
#
|
4
|
+
# @example
|
5
|
+
# results = Jobs(5) { 42 }
|
6
|
+
# p results # [42, 42, 42, 42, 42]
|
7
|
+
#
|
4
8
|
# @param [Proc] Block The block to execute in a subprocess.
|
5
9
|
# @param [Fixnum] Processes The number of subprocesses to spawn.
|
10
|
+
# @raise [ArgumentError] If block is missing.
|
6
11
|
# @return [Array<Object>]
|
7
12
|
def Jobs number, &block
|
13
|
+
raise ArgumentError, 'block expected' unless block_given?
|
14
|
+
|
8
15
|
barney = Barney::Share.new
|
9
16
|
barney.share :queue
|
10
17
|
queue = []
|