shoryuken 0.0.1

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.
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Shoryuken::Worker' do
4
+
5
+ describe '.shoryuken_options' do
6
+ it 'registers the worker' do
7
+ class UppercutWorker
8
+ include Shoryuken::Worker
9
+
10
+ shoryuken_options queue: 'uppercut'
11
+ end
12
+
13
+ expect(Shoryuken.workers['uppercut']).to eq UppercutWorker
14
+ end
15
+
16
+ it 'accepts a block as queue name' do
17
+ $queue_prefix = 'production'
18
+
19
+ class UppercutWorker
20
+ include Shoryuken::Worker
21
+
22
+ shoryuken_options queue: ->{ "#{$queue_prefix}_uppercut" }
23
+ end
24
+
25
+ expect(Shoryuken.workers['production_uppercut']).to eq UppercutWorker
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,40 @@
1
+ require 'bundler/setup'
2
+ Bundler.setup
3
+
4
+ require 'pry-byebug'
5
+ require 'shoryuken'
6
+
7
+ options_file = File.join(File.expand_path('../..', __FILE__), 'shoryuken.yml')
8
+
9
+ $options = {}
10
+
11
+ if File.exists? options_file
12
+ $options = YAML.load(File.read(options_file)).deep_symbolize_keys
13
+
14
+ AWS.config $options[:aws]
15
+ end
16
+
17
+ Shoryuken.logger.level = Logger::UNKNOWN
18
+ Celluloid.logger.level = Logger::UNKNOWN
19
+
20
+ RSpec.configure do |config|
21
+ config.filter_run_excluding slow: true unless ENV['SPEC_ALL']
22
+
23
+ config.before do
24
+ # remove doubles, preventing:
25
+ # Double "Queue" was originally created in one example but has leaked into another example and can no longer be used.
26
+ # rspec-mocks' doubles are designed to only last for one example, and you need to create a new one in each example you wish to use it for.
27
+ Shoryuken::Client.reset!
28
+
29
+ Shoryuken.options.clear
30
+ Shoryuken.options.merge!($options)
31
+
32
+ Shoryuken.queues.clear
33
+ Shoryuken.queues << 'shoryuken'
34
+ Shoryuken.options[:concurrency] = 1
35
+ Shoryuken.options[:delay] = 1
36
+ Shoryuken.options[:timeout] = 1
37
+
38
+ Shoryuken.options[:aws] = {}
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,189 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shoryuken
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pablo Cantero
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aws-sdk
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: celluloid
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: multi_json
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Shoryuken is a super efficient AWS SQS thread based message processor
112
+ email:
113
+ - pablo@pablocantero.com
114
+ executables:
115
+ - shoryuken
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - .gitignore
120
+ - .rspec
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - bin/shoryuken
126
+ - examples/all.rb
127
+ - examples/shoryuken_worker.rb
128
+ - examples/sidekiq_worker.rb
129
+ - examples/uppercut_worker.rb
130
+ - lib/shoryuken.rb
131
+ - lib/shoryuken/cli.rb
132
+ - lib/shoryuken/client.rb
133
+ - lib/shoryuken/core_ext.rb
134
+ - lib/shoryuken/fetcher.rb
135
+ - lib/shoryuken/launcher.rb
136
+ - lib/shoryuken/logging.rb
137
+ - lib/shoryuken/manager.rb
138
+ - lib/shoryuken/middleware/chain.rb
139
+ - lib/shoryuken/middleware/server/auto_delete.rb
140
+ - lib/shoryuken/middleware/server/logging.rb
141
+ - lib/shoryuken/processor.rb
142
+ - lib/shoryuken/util.rb
143
+ - lib/shoryuken/version.rb
144
+ - lib/shoryuken/worker.rb
145
+ - shoryuken.gemspec
146
+ - shoryuken.jpg
147
+ - spec/shoryuken/chain_spec.rb
148
+ - spec/shoryuken/client_spec.rb
149
+ - spec/shoryuken/core_ext_spec.rb
150
+ - spec/shoryuken/fetcher_spec.rb
151
+ - spec/shoryuken/integration/launcher_spec.rb
152
+ - spec/shoryuken/manager_spec.rb
153
+ - spec/shoryuken/processor_spec.rb
154
+ - spec/shoryuken/worker_spec.rb
155
+ - spec/spec_helper.rb
156
+ homepage: https://github.com/phstc/shoryuken
157
+ licenses:
158
+ - MIT
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 2.0.14
177
+ signing_key:
178
+ specification_version: 4
179
+ summary: Shoryuken is a super efficient AWS SQS thread based message processor
180
+ test_files:
181
+ - spec/shoryuken/chain_spec.rb
182
+ - spec/shoryuken/client_spec.rb
183
+ - spec/shoryuken/core_ext_spec.rb
184
+ - spec/shoryuken/fetcher_spec.rb
185
+ - spec/shoryuken/integration/launcher_spec.rb
186
+ - spec/shoryuken/manager_spec.rb
187
+ - spec/shoryuken/processor_spec.rb
188
+ - spec/shoryuken/worker_spec.rb
189
+ - spec/spec_helper.rb