togl 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/lib/togl.rb +3 -1
- data/lib/togl/config.rb +4 -0
- data/lib/togl/rack/middleware.rb +3 -2
- data/lib/togl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea1d069cca80bf395052e486d7256364156e32e
|
4
|
+
data.tar.gz: 79a1db2e5094a1968633672c0032300953765610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cafc4cd813aa0a9334d267e484655cae09a5bf7b7f6bd7c1da87074c9a21b3c080133be1637884f5ea0d1736f9d04a4553e5e9bd3d1d0fdd9a4bd3000320bcdb
|
7
|
+
data.tar.gz: 2aa2aff080e9d56d8b394d71446c9bff72552d12bad628a1e7d3ab7276d3481a448e645e35be2b8e36c90069eb9203d2e5a4535a976373fb28234200c7b4064e
|
data/.travis.yml
CHANGED
data/lib/togl.rb
CHANGED
@@ -3,6 +3,8 @@ require "togl/version"
|
|
3
3
|
require "rack/utils"
|
4
4
|
|
5
5
|
module Togl
|
6
|
+
InvalidFeatureName = Class.new(StandardError)
|
7
|
+
|
6
8
|
def self.config
|
7
9
|
@config ||= Config.new
|
8
10
|
end
|
@@ -17,7 +19,7 @@ module Togl
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def self.off?(feature)
|
20
|
-
config.
|
22
|
+
config.off?(feature)
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
data/lib/togl/config.rb
CHANGED
data/lib/togl/rack/middleware.rb
CHANGED
@@ -9,8 +9,9 @@ module Togl
|
|
9
9
|
|
10
10
|
def call(env)
|
11
11
|
Thread.current[:togl_session_features] = detect_feature_params(env)
|
12
|
-
@app.call(env)
|
13
|
-
|
12
|
+
@app.call(env).tap do
|
13
|
+
Thread.current[:togl_session_features] = nil
|
14
|
+
end
|
14
15
|
end
|
15
16
|
|
16
17
|
def detect_feature_params(env)
|
data/lib/togl/version.rb
CHANGED