caffeinate 2.4 → 2.5.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
  SHA256:
3
- metadata.gz: 1f6b0a68bbf6e8ec71e469224fb7d466833ea4506e40798536b77b6af7bcb128
4
- data.tar.gz: 72ebe49b84468147f0455cdcd9986e582a75df9b2b2f7114ef3e76f453a18b94
3
+ metadata.gz: c76dd3d301fbbd11f363162682da9ad258553c6b4608ba399c8cb663db9219cf
4
+ data.tar.gz: 0a012afbc96cb06e7950baf8bdd4722693769f88c8f876e9d646580eb2e977f5
5
5
  SHA512:
6
- metadata.gz: e1d315dab19b59edf7601f43b862648d09867c06218bdb2ff269f49c690087161d195dbd3bbeb465027e46fe1146d4c53a7e820253c11a90f825eba6e027bd3e
7
- data.tar.gz: f06087e9f499f8550438113d907741d8c8164637b09a18acc1412135813a8227dde96a57fb23d3febfa499111d6a2daaa337fbfac0d5e9ee0429cb3bbdb03a9f
6
+ metadata.gz: 93962de68a56db6c627c8641018615591db07c324b25f483bc64b19fd247122b32e4f6f895b3c6d1dbdcecca8b96e014f0275fb055e9d3e4fee676a7e43f5294
7
+ data.tar.gz: 100043354924dbe03d979384a3e9e51584bf10e9d1f96e9045cabd1d2f4acdf24f763fc003073dad7b3681aa43961aa469d5b6b0a4e5b69472b9bb366dafd665
data/README.md CHANGED
@@ -255,7 +255,7 @@ Caffeinate also...
255
255
  * ✅ Tested against large databases at AngelList and is performant as hell
256
256
  * ✅ Effortlessly handles complex workflows
257
257
  - Need to skip a certain mailing? You can!
258
-
258
+
259
259
  ## Documentation
260
260
 
261
261
  * [Getting started, tips and tricks](https://github.com/joshmn/caffeinate/blob/master/docs/README.md)
@@ -131,7 +131,7 @@ module Caffeinate
131
131
  end
132
132
 
133
133
  def end_if_no_mailings!
134
- end! if future_mailings.empty?
134
+ caffeinate_campaign_subscription.end! if caffeinate_campaign_subscription.future_mailings.empty?
135
135
  end
136
136
  end
137
137
  end
@@ -20,6 +20,15 @@ module Caffeinate
20
20
  @registry.values
21
21
  end
22
22
 
23
+ # Caffeinate maintains a couple of class-variables under the hood
24
+ # that don't get reset between specs (while the db records they cache do
25
+ # get truncated). This resets the appropriate class-variables between specs
26
+ def clear_cache!
27
+ drippers.each do |dripper|
28
+ dripper.safe_constantize.class_eval { @caffeinate_campaign = nil }
29
+ end
30
+ end
31
+
23
32
  def clear!
24
33
  @registry = {}
25
34
  end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:each) do
3
+ Caffeinate.dripper_collection.clear_cache!
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Caffeinate
2
- VERSION = "2.4"
2
+ VERSION = "2.5.0"
3
3
  end
data/lib/caffeinate.rb CHANGED
@@ -39,4 +39,8 @@ module Caffeinate
39
39
  def self.setup
40
40
  yield config
41
41
  end
42
+
43
+ def self.test_mode!
44
+
45
+ end
42
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caffeinate
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.4'
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -191,6 +191,7 @@ files:
191
191
  - lib/caffeinate/perform.rb
192
192
  - lib/caffeinate/periodical_drip.rb
193
193
  - lib/caffeinate/rspec.rb
194
+ - lib/caffeinate/rspec/helpers.rb
194
195
  - lib/caffeinate/rspec/matchers.rb
195
196
  - lib/caffeinate/rspec/matchers/be_subscribed_to_caffeinate_campaign.rb
196
197
  - lib/caffeinate/rspec/matchers/end_caffeinate_campaign_subscription.rb