sucker_punch 1.2.1 → 1.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c321f106a5586b89d4beb8783589b760b0337569
4
- data.tar.gz: 2c40975c23752e56b0a6d267f3232e2a26052059
3
+ metadata.gz: f70cb95da88976f1d553fb0f59738234e405617e
4
+ data.tar.gz: 8f201650b9af9288cdfc1d07888d9f768aa26154
5
5
  SHA512:
6
- metadata.gz: 754e301afcde611cc3032c6f290a9a3a92633be64f8011a6513cfecaa6672e9c625fcadd4b5d8812be224fbd9b03e32725c5fd1fbf4f65d9f285e4dc02d75ae9
7
- data.tar.gz: 4c89f21b80c6141b8b83d5ddcbbbe11f91849ebe879530da82e67f659ed54dbb75b985ee3bc46ea258fc7e8cd846cc9cf6d9ede64c29de543e30ef05cf751828
6
+ metadata.gz: ca78397b7ce5d1e6e10731c2574e15f9ba4f832cad5417bf5978702201234d55318cdcba59cc8a0026cfbfb34467548c6f904307718ed46bd30c721085c0515b
7
+ data.tar.gz: b6c9665c64fb2534dcb56746322defd9b0007998ca35040b6e55ae1b134549b4fe553c2b0aeac2e27fe8ef8e12fd902eae99c74bd9a6a8d93997257db5dbc5af
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.3
2
+ --------
3
+
4
+ - Update to use Celluloid `0.16`
5
+
1
6
  1.2.1
2
7
  --------
3
8
 
data/README.md CHANGED
@@ -105,14 +105,13 @@ If the `workers` method is not set, the default is `2`.
105
105
 
106
106
  Many background processing libraries have methods to perform operations after a
107
107
  certain amount of time. Fortunately, timers are built-in to Celluloid, so you
108
- can take advantage of them with the `after` method:
108
+ can take advantage of them with the `later` method:
109
109
 
110
110
  ``` ruby
111
111
  class Job
112
112
  include SuckerPunch::Job
113
113
 
114
114
  def perform(data)
115
- sleep 2
116
115
  puts data
117
116
  end
118
117
 
@@ -148,6 +147,24 @@ require 'sucker_punch/testing/inline'
148
147
  Log.new.async.perform("login") # => Will be synchronous and block until job is finished
149
148
  ```
150
149
 
150
+ ## Active Job
151
+
152
+ Sucker Punch has been added as an Active job adapter in the upcoming Rails 4.2 release.
153
+ See the [guide](http://edgeguides.rubyonrails.org/active_job_basics.html) for
154
+ configuration and implementation.
155
+
156
+ Add Sucker Punch to your `Gemfile`:
157
+
158
+ ```Ruby
159
+ gem 'sucker_punch'
160
+ ```
161
+
162
+ And then configure the backend to use Sucker Punch:
163
+
164
+ ```Ruby
165
+ Rails.application.config.active_job.queue_adapter = :sucker_punch
166
+ ```
167
+
151
168
  ## Troubleshooting
152
169
 
153
170
  ### Initializers for forking servers (Unicorn, Passenger, etc.)
@@ -177,11 +194,15 @@ end
177
194
 
178
195
  ### Cleaning test data transactions
179
196
 
180
- If you're running tests in transactions (using Database Cleaner or a native solution), Sucker Punch jobs may have trouble finding database records that were created during test setup because the job class is running in a separate thread and the Transaction operates on a different thread so it clears out the data before the job can do its business. The best thing to do is cleanup data created for tests jobs through a truncation strategy by tagging the rspec tests as jobs and then specifying the strategy in `spec_helper` like below:
197
+ If you're running tests in transactions (using Database Cleaner or a native solution), Sucker Punch jobs may have trouble finding database records that were created during test setup because the job class is running in a separate thread and the Transaction operates on a different thread so it clears out the data before the job can do its business. The best thing to do is cleanup data created for tests jobs through a truncation strategy by tagging the rspec tests as jobs and then specifying the strategy in `spec_helper` like below. And do not forget to turn off transactional fixtures (delete, comment or set it to `false`).
181
198
 
182
199
  ```Ruby
183
200
  # spec/spec_helper.rb
184
201
  RSpec.configure do |config|
202
+
203
+ # Turn off transactional fixtures (delete, comment or set it to `false`)
204
+ # config.use_transactional_fixtures = true
205
+
185
206
  config.before(:each) do
186
207
  DatabaseCleaner.strategy = :transaction
187
208
  end
@@ -230,4 +251,3 @@ looking for a name for something, he is the one to go to.
230
251
  3. Commit your changes (`git commit -am 'Add some feature'`)
231
252
  4. Push to the branch (`git push origin my-new-feature`)
232
253
  5. Create new Pull Request
233
-
@@ -14,7 +14,7 @@ module SuckerPunch
14
14
  end
15
15
 
16
16
  def self.exception_handler(&block)
17
- Celluloid.exception_handler(&block)
17
+ Celluloid.exception_handler(&block)
18
18
  end
19
19
  end
20
20
 
@@ -3,7 +3,7 @@ require "celluloid/proxies/sync_proxy"
3
3
  require "celluloid/proxies/actor_proxy"
4
4
 
5
5
  module Celluloid
6
- class ActorProxy < SyncProxy
6
+ class CellProxy < SyncProxy
7
7
  def async(method_name = nil, *args, &block)
8
8
  self
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module SuckerPunch
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_development_dependency "rake"
23
23
  gem.add_development_dependency "pry"
24
24
 
25
- gem.add_dependency "celluloid", "~> 0.15.2"
25
+ gem.add_dependency "celluloid", "~> 0.16.0"
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sucker_punch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hilkert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-12 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.15.2
61
+ version: 0.16.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.15.2
68
+ version: 0.16.0
69
69
  description: Asynchronous processing library for Ruby
70
70
  email:
71
71
  - brandonhilkert@gmail.com