dispatch_queue 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +17 -20
- data/dispatch_queue.gemspec +1 -0
- data/lib/dispatch_queue.rb +8 -21
- data/test/test_dispatch_queue.rb +0 -3
- metadata +55 -23
data/README.md
CHANGED
@@ -6,6 +6,8 @@ It was done for crawling things, but could be used in any case that you need to
|
|
6
6
|
|
7
7
|
With this line, we get more documentation that real code, so please see the code.
|
8
8
|
|
9
|
+
[](http://travis-ci.org/guillermo/dispatch_queue)
|
10
|
+
|
9
11
|
|
10
12
|
COMPATIBILITY
|
11
13
|
=============
|
@@ -33,34 +35,29 @@ REALCODE
|
|
33
35
|
=======
|
34
36
|
|
35
37
|
```ruby
|
36
|
-
class DispatchQueue
|
37
|
-
include Enumerable
|
38
|
-
|
39
|
-
class << self
|
40
|
-
alias :[] :new
|
41
|
-
end
|
42
|
-
|
43
|
-
def initialize(*array)
|
44
|
-
@procs = array
|
45
|
-
end
|
46
38
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
39
|
+
class DispatchQueue
|
40
|
+
VERSION = "1.0.5"
|
41
|
+
|
42
|
+
def self.[](*procs)
|
43
|
+
procs.map { |proc|
|
44
|
+
Thread.new{ proc.to_proc.call }
|
45
|
+
}.map { |thread|
|
46
|
+
thread.value
|
47
|
+
}
|
57
48
|
end
|
58
49
|
end
|
59
50
|
|
60
51
|
|
61
52
|
DQ = DispatchQueue
|
53
|
+
|
62
54
|
```
|
63
55
|
|
56
|
+
CHANGELOG
|
57
|
+
=========
|
58
|
+
|
59
|
+
* 1.0.5 Reduce implementation
|
60
|
+
|
64
61
|
LICENSE
|
65
62
|
=======
|
66
63
|
|
data/dispatch_queue.gemspec
CHANGED
data/lib/dispatch_queue.rb
CHANGED
@@ -1,25 +1,12 @@
|
|
1
1
|
class DispatchQueue
|
2
|
-
VERSION = "1.0.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@procs = array
|
11
|
-
end
|
12
|
-
|
13
|
-
def <<(new_one)
|
14
|
-
@procs << new_one
|
15
|
-
end
|
16
|
-
|
17
|
-
def each
|
18
|
-
@procs.map do |proc|
|
19
|
-
Thread.new{ proc.call }
|
20
|
-
end.map do |thread|
|
21
|
-
yield thread.value
|
22
|
-
end
|
2
|
+
VERSION = "1.0.5"
|
3
|
+
|
4
|
+
def self.[](*procs)
|
5
|
+
procs.map { |proc|
|
6
|
+
Thread.new{ proc.to_proc.call }
|
7
|
+
}.map { |thread|
|
8
|
+
thread.value
|
9
|
+
}
|
23
10
|
end
|
24
11
|
end
|
25
12
|
|
data/test/test_dispatch_queue.rb
CHANGED
metadata
CHANGED
@@ -1,23 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dispatch_queue
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 5
|
10
|
+
version: 1.0.5
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
- Guillermo A
|
12
|
+
authors:
|
13
|
+
- "Guillermo A\xCC\x81lvarez"
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2011-09-08 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rake
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
14
34
|
description: Little gem to enqueue jobs the easy way
|
15
|
-
email:
|
35
|
+
email:
|
16
36
|
- guillermo@cientifico.net
|
17
37
|
executables: []
|
38
|
+
|
18
39
|
extensions: []
|
40
|
+
|
19
41
|
extra_rdoc_files: []
|
20
|
-
|
42
|
+
|
43
|
+
files:
|
21
44
|
- .gitignore
|
22
45
|
- Gemfile
|
23
46
|
- README.md
|
@@ -25,29 +48,38 @@ files:
|
|
25
48
|
- dispatch_queue.gemspec
|
26
49
|
- lib/dispatch_queue.rb
|
27
50
|
- test/test_dispatch_queue.rb
|
28
|
-
homepage:
|
51
|
+
homepage: ""
|
29
52
|
licenses: []
|
53
|
+
|
30
54
|
post_install_message:
|
31
55
|
rdoc_options: []
|
32
|
-
|
56
|
+
|
57
|
+
require_paths:
|
33
58
|
- lib
|
34
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
60
|
none: false
|
36
|
-
requirements:
|
37
|
-
- -
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
|
40
|
-
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
hash: 3
|
65
|
+
segments:
|
66
|
+
- 0
|
67
|
+
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
69
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
46
77
|
requirements: []
|
78
|
+
|
47
79
|
rubyforge_project: dispatch_queue
|
48
|
-
rubygems_version: 1.8.
|
80
|
+
rubygems_version: 1.8.10
|
49
81
|
signing_key:
|
50
82
|
specification_version: 3
|
51
83
|
summary: Simple way to work enqueue works
|
52
|
-
test_files:
|
84
|
+
test_files:
|
53
85
|
- test/test_dispatch_queue.rb
|