rector 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/rector/job.rb +5 -8
  2. data/rector.gemspec +1 -1
  3. metadata +13 -13
data/lib/rector/job.rb CHANGED
@@ -18,19 +18,16 @@ module Rector
18
18
  end
19
19
  end
20
20
 
21
- attr_reader :workers
21
+ attr_reader :id, :workers
22
22
 
23
- def initialize
23
+ # TODO: Obviously there's a small chance of jobs overlapping here
24
+ # Can do something more reliable for ID generation?
25
+ def initialize(id = SecureRandom.hex(10))
26
+ @id = id
24
27
  @workers = WorkerCollection.new(self)
25
28
  @backend = Rector.backend_for(id)
26
29
  end
27
30
 
28
- def id
29
- # TODO: Obviously there's a small chance of jobs overlapping here
30
- # Can do something more reliable for ID generation?
31
- @id ||= SecureRandom.hex(10)
32
- end
33
-
34
31
  def allocate_worker_id
35
32
  # TODO: Obviously there's a small chance of jobs overlapping here
36
33
  # Can do something more reliable for ID generation?
data/rector.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rector"
6
- s.version = "0.0.3"
6
+ s.version = "0.0.4"
7
7
  s.authors = ["Andy Lindeman"]
8
8
  s.email = ["alindeman@gmail.com"]
9
9
  s.homepage = "https://github.com/alindeman/rector"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
- requirement: &70276889123660 !ruby/object:Gem::Requirement
16
+ requirement: &70106573554300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70276889123660
24
+ version_requirements: *70106573554300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: redis-namespace
27
- requirement: &70276893259020 !ruby/object:Gem::Requirement
27
+ requirement: &70106573553660 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70276893259020
35
+ version_requirements: *70106573553660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70276893284280 !ruby/object:Gem::Requirement
38
+ requirement: &70106573552980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70276893284280
46
+ version_requirements: *70106573552980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70276893134980 !ruby/object:Gem::Requirement
49
+ requirement: &70106573552480 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.8.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70276893134980
57
+ version_requirements: *70106573552480
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &70276893368880 !ruby/object:Gem::Requirement
60
+ requirement: &70106573551980 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.10.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70276893368880
68
+ version_requirements: *70106573551980
69
69
  description: ! " Rector allows coordination of a number of jobs spawned with a
70
70
  mechanism\n like Resque (though any job manager will do). If you are able to
71
71
  parallelize\n the processing of a task, yet all these tasks are generating metrics,\n
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  segments:
110
110
  - 0
111
- hash: 473261746240186499
111
+ hash: 992020878605361290
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  segments:
119
119
  - 0
120
- hash: 473261746240186499
120
+ hash: 992020878605361290
121
121
  requirements: []
122
122
  rubyforge_project:
123
123
  rubygems_version: 1.8.14