flux_capacitor 0.1.4 → 0.2.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
  SHA1:
3
- metadata.gz: 76a7dee4f3e4464adaebd86fe7a8a0af5f88700a
4
- data.tar.gz: 98a96b818381b2707f80aabf9a1ce703665d3d74
3
+ metadata.gz: 50b20888f09b8a4d3fe988ee6a6beedc07e525e3
4
+ data.tar.gz: b1bd10b79c3a037693ab01adbd4b707b4baee2f6
5
5
  SHA512:
6
- metadata.gz: b0f08d256f5d3519b0fec3956e4a8270e96d22fe5b56b4784c6dd72e14b22d763457f7ac5ce95db3a6dda4f0c6f150f47f39d16b60094f4579ea1ff0e1c8492c
7
- data.tar.gz: 345fbe63eb956576ec934127ead9412c0a59ca20f0abc5d7c761b62240e31fdffecbd6ad639d10bba112f0a1f032b6054c303282d3ced35d1b4aa7737e6ffc02
6
+ metadata.gz: 158cbb65dd3e2fa37e69541fd17873b6c9f6915c97d1e8eb14af636d3ce09784600be1c833e2f8dc34f16b22975c682186ac2501161ec4e73e96380bb45d6c42
7
+ data.tar.gz: aee129ec752be611ad80837c8912582260d4d9a768dd0b89af0419f4942e6b12feb4baf9cd34fc9f607fdf7b0e76739474392601925eb59852e7d324acbde414
data/README.md CHANGED
@@ -65,6 +65,20 @@ end
65
65
 
66
66
  One note about using the string hashing method, new content could get the old feature for a while.
67
67
 
68
+ ### Testing
69
+
70
+ In order to test your code while migrating from one form to the other you can replace `Flux::Capacitor` with `Flux::Truthy` or `Flux::Falsy` They both expose the same API as a regular Capacitor but they `travel_to?` method will always return `true` and `false` respectively.
71
+
72
+ When working with rails you can do something like this:
73
+ ```ruby
74
+ start = DateTime.parse('2017/08/14 00:00:00-000')
75
+ end_point = DateTime.parse('2017/09/14')
76
+ oldest = MyModel.first.created_at
77
+ FEATURE_1_CAPACITOR = Rails.env.test? ? Flux::Falsy.new : Flux::Capacitor.new(start, end_point, oldest)
78
+ ```
79
+
80
+ This will make it so for your tests everything will be treated as before.
81
+
68
82
  ## Development
69
83
 
70
84
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  module Flux
2
- class Falsey < Capacitor
2
+ class Falsy < Capacitor
3
3
  def initialize(*args)
4
4
  @pivot = DateTime.now
5
5
  @time_dilation = 2.0
@@ -10,7 +10,7 @@ module Flux
10
10
  end
11
11
  end
12
12
 
13
- class Truethy < Capacitor
13
+ class Truthy < Capacitor
14
14
  def initialize(*args)
15
15
  @pivot = DateTime.now
16
16
  @time_dilation = 2.0
@@ -1,3 +1,3 @@
1
1
  module Flux
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flux_capacitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Eidus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-06 00:00:00.000000000 Z
11
+ date: 2017-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: murmurhash3