sucker_punch 1.0.1 → 1.0.2

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: c3c03a1def39edf99b574f98f08249338ec0ce7a
4
- data.tar.gz: 303200ddaaad23730c952fa9934d4365ffc24592
3
+ metadata.gz: 993f07c48fd24506ec4f6233b141142a3d4584bf
4
+ data.tar.gz: 19e5a661fabd7053db509438cd49980d7260e75b
5
5
  SHA512:
6
- metadata.gz: 8022ea9c0f1ab6c5d98b8b85084a7f5ec919d432388066c2e42c599768523181226dea0bf9f6c13c44e1ebdb2f83880d2aa303e011ae848c0b9dfe9d5a084cc4
7
- data.tar.gz: f98e748043437f7ca9aaee3ef11e55263339d0fc3a5772c6cc08b509229784f60c3a3580fe81755b1f6d04a5a82497a3adba08947a57610386a2fe55680d7a11
6
+ metadata.gz: e8bad658a733babb44d0fb0e8e680bc7b7e23e5e70a1dd2d37c0d23d0d5f3f81d79f7be7cdef5babffe51ac80171a87079aaa64942cbbf1c4499aad07b8142f4
7
+ data.tar.gz: 967146bea4c03054314035ebb06e0eb0a70a355c4042fed10c0d276942172e52670183fffa2c41106a7faf6fe591e2a0056b2cabad91d48b198b129c8e32b1e6
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.0.2
2
+ --------
3
+
4
+ - Update Celluloid dependency to 0.15.1
5
+
1
6
  1.0.1
2
7
  --------
3
8
 
data/README.md CHANGED
@@ -126,11 +126,32 @@ Log.new.async.perform("login") # => Will be synchronous and block until job is f
126
126
 
127
127
  ## Troubleshooting
128
128
 
129
+ ### Initializers for forking servers (Unicorn, Passenger, etc.)
130
+
129
131
  Previously, Sucker Punch required an initializer and that posed problems for Unicorn and Passenger and other servers that fork.
130
132
  Version 1 was rewritten to not require any special code to be executed after forking occurs. Please remove all of that if you're
131
133
  using version `>= 1.0.0`
132
134
 
133
- If you're running tests in transactions (using DatabaseCleaner 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 jojob 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:
135
+ ### Class naming
136
+
137
+ Job classes are ultimately Celluloid Actor classes. As a result, class names are susceptible to being clobbered by Celluloid's internal classes.
138
+ To ensure the intended application class is loaded, preface classes with `::`, or use names like `NotificationsMailer` or
139
+ `UserMailer`. Example:
140
+
141
+ ```Ruby
142
+ class EmailJob
143
+ include SuckerPunch::Job
144
+
145
+ def perform(contact)
146
+ @contact = contact
147
+ ::Notifications.contact_form(@contact).deliver # => If you don't use :: in this case, the notifications class from Celluloid will be loaded
148
+ end
149
+ end
150
+ ```
151
+
152
+ ### Cleaning test data transactions
153
+
154
+ 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 jojob 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:
134
155
 
135
156
  ```Ruby
136
157
  # spec/spec_helper.rb
@@ -1,3 +1,3 @@
1
1
  module SuckerPunch
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -33,7 +33,7 @@ describe SuckerPunch::Job do
33
33
 
34
34
  describe "when pool hasn't been created" do
35
35
  it "registers queue" do
36
- queue = stub("queue")
36
+ queue = double("queue")
37
37
  SuckerPunch::Queue.stub(new: queue)
38
38
  queue.should_receive(:register).with(4)
39
39
  pool = FakeJob.new
data/sucker_punch.gemspec CHANGED
@@ -21,5 +21,5 @@ Gem::Specification.new do |gem|
21
21
  gem.add_development_dependency "rake"
22
22
  gem.add_development_dependency "pry"
23
23
 
24
- gem.add_dependency "celluloid", "~> 0.14.1"
24
+ gem.add_dependency "celluloid", "~> 0.15.1"
25
25
  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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hilkert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-12 00:00:00.000000000 Z
11
+ date: 2013-09-06 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.14.1
61
+ version: 0.15.1
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.14.1
68
+ version: 0.15.1
69
69
  description: Asynchronous processing library for Ruby
70
70
  email:
71
71
  - brandonhilkert@gmail.com