feature_gate 0.2.3 → 0.2.4

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: 715612c103f17635e52891cbf81f7514d21e9c3f
4
- data.tar.gz: 25dcc5c8bc92d866ef9f9b2cdcacfdd32f8fbf8a
3
+ metadata.gz: 7080eeb58ce4cfee351eeb9c8e3624c7345ddb78
4
+ data.tar.gz: 3ad99153c5b7628956a15a5a6f18cec98ddd22e5
5
5
  SHA512:
6
- metadata.gz: aebdd3dd94eee36f00cfc5df08a0410e728fea4428934c31ae20134a6f58f04ddf3e99b8c38b32d4ce435886a3ee4fea1aa451b586a0ac9fce26a2c63ba95895
7
- data.tar.gz: 6f3451d1209a5750f4e75300563fd8e2799f553ff4cce647dd0e84e9fcde1ecc20ec3f7ef0b2d2c39621618a69d78d94da59e8dfb391d9be04b5792a5b5c3d33
6
+ metadata.gz: 3ba7ba02e2ee1c0484ddd7f9ff92abec974a38b1983e0e1837d2ba9c3e33dcfde68b9bedd837fc47b929806279adbaba6104e72e8f904043c2ee8de4ad23a06d
7
+ data.tar.gz: 5ba2c6341302110781a90ae9ffe1ee917562512cd6666e4d237678527b6b2af64fe853b719d53eb3a52142af5c5b1c203e1a4d9782fbc73c98c5eeb7af0ab244
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- feature_gate (0.2.2)
4
+ feature_gate (0.2.4)
5
5
  rails (~> 4.0)
6
6
 
7
7
  GEM
@@ -7,7 +7,7 @@ module FeatureGate
7
7
 
8
8
  scope :opened, -> { where(gated: false) }
9
9
  scope :closed, -> { where(gated: true) }
10
- scope :stale, -> { where('updated_at != created_at and updated_at < ?', Time.zone.now - FeatureGate.time_to_stale) }
10
+ scope :stale, -> { where('updated_at != created_at and updated_at < ?', Time.zone.now - FeatureGate.configuration.time_to_stale) }
11
11
 
12
12
  def deploy_feature!
13
13
  self.gated = false
data/lib/feature_gate.rb CHANGED
@@ -1,9 +1,19 @@
1
1
  module FeatureGate
2
- mattr_accessor :time_to_stale
3
- self.time_to_stale = 1.month
2
+ class << self
3
+ attr_accessor :configuration
4
+ end
4
5
 
5
6
  def self.setup
6
- yield self
7
+ self.configuration ||= Configuration.new
8
+ yield(configuration)
9
+ end
10
+
11
+ class Configuration
12
+ attr_accessor :time_to_stale
13
+
14
+ def initialize
15
+ @time_to_stale = 1.month
16
+ end
7
17
  end
8
18
  end
9
19
 
@@ -1,3 +1,3 @@
1
1
  module FeatureGate
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
data/spec/fake_app.rb CHANGED
@@ -16,10 +16,6 @@ module FeatureGate
16
16
 
17
17
  class ApplicationController < ActionController::Base
18
18
  end
19
-
20
- def self.time_to_stale
21
- 1.month
22
- end
23
19
  end
24
20
  FeatureGate::Application.initialize!
25
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiffany Huang