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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8d22d301e958363391bd6041c3bf737a70af7d4
4
- data.tar.gz: 115609fb2028e80e2ebed5be9f4bca510fde64da
3
+ metadata.gz: dea1d069cca80bf395052e486d7256364156e32e
4
+ data.tar.gz: 79a1db2e5094a1968633672c0032300953765610
5
5
  SHA512:
6
- metadata.gz: dfd5120f6b9b256c98a9e4cf697dd37ac0073c84222dd0db3b84e418556746cf95b3521409a71cdb61f3afe5314e2fecaa92f42ae39975c5f5c98533632273b5
7
- data.tar.gz: 4562509334b6b52bd88b4c20289c3391d2b702854f1ff98bf1fee6302741c8f974fcb9daebd992926aa353cf1f82edfa0e7c3576884cba6d160411e99acb5386
6
+ metadata.gz: cafc4cd813aa0a9334d267e484655cae09a5bf7b7f6bd7c1da87074c9a21b3c080133be1637884f5ea0d1736f9d04a4553e5e9bd3d1d0fdd9a4bd3000320bcdb
7
+ data.tar.gz: 2aa2aff080e9d56d8b394d71446c9bff72552d12bad628a1e7d3ab7276d3481a448e645e35be2b8e36c90069eb9203d2e5a4535a976373fb28234200c7b4064e
@@ -10,7 +10,6 @@ rvm:
10
10
  - 2.2
11
11
  - jruby
12
12
  - jruby-head
13
- - rbx
14
13
  - ruby-head
15
14
 
16
15
  env:
@@ -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.on?(feature)
22
+ config.off?(feature)
21
23
  end
22
24
  end
23
25
 
@@ -38,6 +38,10 @@ module Togl
38
38
  name = name.to_sym
39
39
  features.detect do |feature|
40
40
  feature.name.equal?(name)
41
+ end.tap do |feature|
42
+ if feature.nil?
43
+ raise InvalidFeatureName, "No such configured feature: `#{name}'"
44
+ end
41
45
  end
42
46
  end
43
47
 
@@ -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
- Thread.current[:togl_session_features] = nil
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)
@@ -1,3 +1,3 @@
1
1
  module Togl
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: togl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Brasseur