stator 0.3.4 → 0.4.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: 3d680c518e970462c590c98580c2d53fbde45bfe7a6caeecdcf9cc061986a8a8
4
- data.tar.gz: 25ac4b8cd95b28b07f1335d58ce5adb5a2dcf059f0c8e2f4b555de7aa7465387
3
+ metadata.gz: bd6df35f26ca3ad5d575a7ca144abf6bd17ab7eb24b5ada82fb46e499998ce99
4
+ data.tar.gz: 5e67fc30ac3a46248afee90f68781afb1628a8145ec6da935573a1ee4e29d573
5
5
  SHA512:
6
- metadata.gz: 33221bc724169bb503c83c6ae72da5acf009f63ce37e4d366ebf4b0668f8c93735fed301159d7ef344af27793cb55934f9e92e21a6e16841cc0c6105f39ea6ef
7
- data.tar.gz: 23036f52c40f2f10818f0b03b530a754fcd01c71f022c7ff0d863c6981085b6b89c2777e3eff48545627b2dc8e73fae73fe865c5a4d8f91f0d898f6393e5ec7a
6
+ metadata.gz: d1d45f5f4797c75bc8b124041cab91b0e85bec9e936ec76fdfc15b53a5f3c88db2cd733546f20f50fdf2ec3edb7f5b3cffeb93996053afc0a2784de6fd9d17e5
7
+ data.tar.gz: 779f3a8c8b04b04acb5abdf84722a7418a0c5a8c35f859d02d8c35419ac6398bd5b64b9a80cadf329f4ae9fde4f666664da2075d500187ea1ba144557c240f47
@@ -118,7 +118,7 @@ module Stator
118
118
  integration.state == #{state.to_s.inspect}
119
119
  end
120
120
 
121
- def #{method_name}_by?(time)
121
+ def #{method_name}_state_by?(time)
122
122
  integration = self._stator(#{@namespace.inspect}).integration(self)
123
123
  integration.state_by?(#{state.to_s.inspect}, time)
124
124
  end
@@ -3,8 +3,8 @@
3
3
  module Stator
4
4
 
5
5
  MAJOR = 0
6
- MINOR = 3
7
- PATCH = 4
6
+ MINOR = 4
7
+ PATCH = 0
8
8
  PRERELEASE = nil
9
9
 
10
10
  VERSION = [MAJOR, MINOR, PATCH, PRERELEASE].compact.join(".")
data/spec/model_spec.rb CHANGED
@@ -311,40 +311,40 @@ describe Stator::Model do
311
311
  t = Time.now
312
312
  u = User.create!( email: "doug@example.com", activated_state_at: t)
313
313
  u.state_by?(:activated, Time.at(t.to_i + 1)).should be true
314
- u.activated_by?(Time.at(t.to_i + 1)).should be true
314
+ u.activated_state_by?(Time.at(t.to_i + 1)).should be true
315
315
  end
316
316
 
317
317
  it "should be true when the transition is at the same time" do
318
318
  t = Time.now
319
319
  u = User.create!( email: "doug@example.com", activated_state_at: t)
320
320
  u.state_by?(:activated, t).should be true
321
- u.activated_by?(t).should be true
321
+ u.activated_state_by?(t).should be true
322
322
  end
323
323
 
324
324
  it "should be false when the transition is later" do
325
325
  t = Time.now
326
326
  u = User.create!( email: "doug@example.com", activated_state_at: t)
327
327
  u.state_by?(:activated, Time.at(t.to_i - 1)).should be false
328
- u.activated_by?(Time.at(t.to_i - 1)).should be false
328
+ u.activated_state_by?(Time.at(t.to_i - 1)).should be false
329
329
  end
330
330
 
331
331
  it "should be false when the transition is nil" do
332
332
  t = Time.now
333
333
  u = User.create!( email: "doug@example.com", activated_state_at: nil)
334
334
  u.state_by?(:activated, t).should be false
335
- u.activated_by?(t).should be false
335
+ u.activated_state_by?(t).should be false
336
336
  end
337
337
 
338
338
  it "should be true when the transition is not nil and the time is nil" do
339
339
  u = User.create!( email: "doug@example.com", activated_state_at: Time.now)
340
340
  u.state_by?(:activated, nil).should be true
341
- u.activated_by?(nil).should be true
341
+ u.activated_state_by?(nil).should be true
342
342
  end
343
343
 
344
344
  it "should be false when both are nil" do
345
345
  u = User.create!(email: "doug@example.com", activated_state_at: nil)
346
346
  u.state_by?(:activated, nil).should be false
347
- u.activated_by?(nil).should be false
347
+ u.activated_state_by?(nil).should be false
348
348
  end
349
349
  end
350
350
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord