reactor 0.9.9 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79a37d4373106a9ecf4726ae5c5cdc144731eb62
4
- data.tar.gz: 9c517481d516795077a95cf778e5a227e39a0549
3
+ metadata.gz: 2b1cd8dc6ba81d280aa248e55ab641a4c2fd71ac
4
+ data.tar.gz: 57f4489af458281ec8917185854d26b3fd8ec811
5
5
  SHA512:
6
- metadata.gz: 49ff1b050b0eb88a050545a2b4a0796bf1ee26565e53ee6c503700226588b4d84e503adde531f46d9bb3ccc9072f72d1c083a335a7056e93ed33e48b8dcd2904
7
- data.tar.gz: cc0ef56ff6fd82481a5dfce05fb4788b1255fcadc4f7a347ea57ff8b11fd10a36f1ece66484f45b2c1a72c12a17bac143619e2a784afa1fa6af7982c87e127e8
6
+ metadata.gz: b76d756f396d9ae0f3e3bf66a540ca03fbcc0a07d4742b10ad41e99a8b3a2ad1c1f12a3c8f7741a29571a7ee4ec3207454ddcfbf7a4c80c5bf93deea6f50e8c3
7
+ data.tar.gz: 51701f10369a18d831a7961932a8a27ecbf8fc176137168f053e236d82e0b8c28cf4b5f4ed6ffcb5704916c5a4e504173f20a7c8ea596b821c27998aea1d0118
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
data/Gemfile.lock ADDED
@@ -0,0 +1,110 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ reactor (0.1.0)
5
+ activerecord (< 5.0)
6
+ sidekiq (< 4.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (4.2.5)
12
+ activesupport (= 4.2.5)
13
+ builder (~> 3.1)
14
+ activerecord (4.2.5)
15
+ activemodel (= 4.2.5)
16
+ activesupport (= 4.2.5)
17
+ arel (~> 6.0)
18
+ activesupport (4.2.5)
19
+ i18n (~> 0.7)
20
+ json (~> 1.7, >= 1.7.7)
21
+ minitest (~> 5.1)
22
+ thread_safe (~> 0.3, >= 0.3.4)
23
+ tzinfo (~> 1.1)
24
+ arel (6.0.3)
25
+ builder (3.2.2)
26
+ byebug (8.2.0)
27
+ celluloid (0.17.2)
28
+ celluloid-essentials
29
+ celluloid-extras
30
+ celluloid-fsm
31
+ celluloid-pool
32
+ celluloid-supervision
33
+ timers (>= 4.1.1)
34
+ celluloid-essentials (0.20.5)
35
+ timers (>= 4.1.1)
36
+ celluloid-extras (0.20.5)
37
+ timers (>= 4.1.1)
38
+ celluloid-fsm (0.20.5)
39
+ timers (>= 4.1.1)
40
+ celluloid-pool (0.20.5)
41
+ timers (>= 4.1.1)
42
+ celluloid-supervision (0.20.5)
43
+ timers (>= 4.1.1)
44
+ coderay (1.1.0)
45
+ connection_pool (2.2.0)
46
+ diff-lcs (1.2.5)
47
+ hitimes (1.2.3)
48
+ i18n (0.7.0)
49
+ json (1.8.3)
50
+ method_source (0.8.2)
51
+ minitest (5.8.3)
52
+ pry (0.10.3)
53
+ coderay (~> 1.1.0)
54
+ method_source (~> 0.8.1)
55
+ slop (~> 3.4)
56
+ pry-byebug (3.3.0)
57
+ byebug (~> 8.0)
58
+ pry (~> 0.10)
59
+ rake (10.4.2)
60
+ redis (3.2.2)
61
+ redis-namespace (1.5.2)
62
+ redis (~> 3.0, >= 3.0.4)
63
+ rspec (3.4.0)
64
+ rspec-core (~> 3.4.0)
65
+ rspec-expectations (~> 3.4.0)
66
+ rspec-mocks (~> 3.4.0)
67
+ rspec-core (3.4.1)
68
+ rspec-support (~> 3.4.0)
69
+ rspec-expectations (3.4.0)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.4.0)
72
+ rspec-its (1.2.0)
73
+ rspec-core (>= 3.0.0)
74
+ rspec-expectations (>= 3.0.0)
75
+ rspec-mocks (3.4.0)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.4.0)
78
+ rspec-support (3.4.1)
79
+ sidekiq (3.5.3)
80
+ celluloid (~> 0.17.2)
81
+ connection_pool (~> 2.2, >= 2.2.0)
82
+ json (~> 1.0)
83
+ redis (~> 3.2, >= 3.2.1)
84
+ redis-namespace (~> 1.5, >= 1.5.2)
85
+ slop (3.6.0)
86
+ sqlite3 (1.3.11)
87
+ test_after_commit (0.4.2)
88
+ activerecord (>= 3.2)
89
+ thread_safe (0.3.5)
90
+ timers (4.1.1)
91
+ hitimes
92
+ tzinfo (1.2.2)
93
+ thread_safe (~> 0.1)
94
+
95
+ PLATFORMS
96
+ ruby
97
+
98
+ DEPENDENCIES
99
+ bundler
100
+ pry
101
+ pry-byebug
102
+ rake
103
+ reactor!
104
+ rspec (< 4.0)
105
+ rspec-its
106
+ sqlite3
107
+ test_after_commit
108
+
109
+ BUNDLED WITH
110
+ 1.11.2
data/lib/reactor/event.rb CHANGED
@@ -54,7 +54,7 @@ class Reactor::Event
54
54
  end
55
55
 
56
56
  def publish(name, data = {})
57
- message = new(data.merge(event: name))
57
+ message = new(data.merge(event: name, uuid: SecureRandom.uuid))
58
58
 
59
59
  if message.at
60
60
  perform_at message.at, name, message.data
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.9.9"
2
+ VERSION = "0.10.0"
3
3
  end
data/reactor.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "bundler"
25
25
  spec.add_development_dependency "rake"
26
- spec.add_development_dependency "rspec", "~> 3.2.0"
26
+ spec.add_development_dependency "rspec", '< 4.0'
27
27
  spec.add_development_dependency "rspec-its"
28
28
  spec.add_development_dependency "pry"
29
29
  spec.add_development_dependency "pry-byebug"
data/spec/event_spec.rb CHANGED
@@ -21,8 +21,17 @@ describe Reactor::Event do
21
21
  let(:event_name) { :user_did_this }
22
22
 
23
23
  describe 'publish' do
24
+ let!(:uuid) { 'uuid' }
25
+ before { allow(SecureRandom).to receive(:uuid).and_return(uuid) }
26
+
27
+
24
28
  it 'fires the first perform and sets message event_id' do
25
- expect(Reactor::Event).to receive(:perform_async).with(event_name, 'actor_id' => '1', 'event' => :user_did_this)
29
+ expect(Reactor::Event).to receive(:perform_async).with(event_name, 'actor_id' => '1', 'event' => :user_did_this, 'uuid' => uuid)
30
+ Reactor::Event.publish(:user_did_this, actor_id: '1')
31
+ end
32
+
33
+ it 'generates and assigns a UUID to the event' do
34
+ expect(Reactor::Event).to receive(:perform_async).with(event_name, 'actor_id' => '1', 'event' => :user_did_this, 'uuid' => uuid)
26
35
  Reactor::Event.publish(:user_did_this, actor_id: '1')
27
36
  end
28
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - winfred
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-16 00:00:00.000000000 Z
14
+ date: 2016-02-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sidekiq
@@ -73,16 +73,16 @@ dependencies:
73
73
  name: rspec
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - "~>"
76
+ - - "<"
77
77
  - !ruby/object:Gem::Version
78
- version: 3.2.0
78
+ version: '4.0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - "~>"
83
+ - - "<"
84
84
  - !ruby/object:Gem::Version
85
- version: 3.2.0
85
+ version: '4.0'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: rspec-its
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -167,6 +167,7 @@ files:
167
167
  - ".rspec"
168
168
  - ".travis.yml"
169
169
  - Gemfile
170
+ - Gemfile.lock
170
171
  - LICENSE.txt
171
172
  - README.md
172
173
  - Rakefile
@@ -216,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
217
  version: '0'
217
218
  requirements: []
218
219
  rubyforge_project:
219
- rubygems_version: 2.4.5.1
220
+ rubygems_version: 2.5.1
220
221
  signing_key:
221
222
  specification_version: 4
222
223
  summary: Sidekiq/ActiveRecord pubsub lib