this_feature-adapters-flipper 0.5.1 → 0.5.2

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: 0f2e1c9b2f0c05c14bebf6bd87c44874f411e97d6b3c9acd5ce001608b016409
4
- data.tar.gz: a49c951bb1acaf0b6000adc217db28ecef410e9a70eec2f663d3445796d8f40c
3
+ metadata.gz: 4de6acf45dc7581500f737401158c90b6e2da6b6193c33a19c6e7c15378d8f8a
4
+ data.tar.gz: 4bf56af16928ae0d03a827e3039b404cc03e94f3ceb0d32a0f3790981381feab
5
5
  SHA512:
6
- metadata.gz: 534a4575ac869952e4d14ee16bc2554259d8c475cce65e495b11ca40fefeeffded606dffb08aee97d2a2e269cf099fae6690529fb9f87db53ec75a196163d13f
7
- data.tar.gz: 9bfcfc5e9060e9852db9ed27429e968cfc15a37348e538f7af9f1ac8db0eb2943671a32396b4961ff85e4a005b15ea3dc1823ec3d3d97991733bdc8c5ca7e1e3
6
+ metadata.gz: 52d87427a549c8f8e1c51c1df420fc9df37c2c929b62f1644a13ee0dd8e5ee7c4d19c759d58962589853f473e3e88ef087c4544d4f8b98527abd048d49a82504
7
+ data.tar.gz: c64ce30d84f15a31f09241d66fa8a053056e1f12ffa730a10d1cd9f54d943786424fb0ddbaaff4afe3c3a4a95200e99435d349193a273d5ac327a88d437b40b9
@@ -19,17 +19,11 @@ class ThisFeature
19
19
  end
20
20
 
21
21
  def on?(flag_name, context: nil, data: {})
22
- return unless present?(flag_name)
23
-
24
22
  client[flag_name].enabled?(*[context].compact)
25
23
  end
26
24
 
27
25
  def off?(flag_name, context: nil, data: {})
28
- on_result = on?(flag_name, context: context)
29
-
30
- return if on_result.nil?
31
-
32
- !on_result
26
+ !on?(flag_name, context: context)
33
27
  end
34
28
 
35
29
  private
@@ -7,6 +7,8 @@ class ThisFeature
7
7
  end
8
8
 
9
9
  def validate_adapters!
10
+ raise(NoAdaptersError.new) unless adapters.any?
11
+
10
12
  adapters.each do |adapter|
11
13
  raise BadAdapterError.new(adapter) unless adapter.class < Adapters::Base
12
14
  end
@@ -14,9 +14,9 @@ class ThisFeature
14
14
  end
15
15
  end
16
16
 
17
- class NoWriteAdapter < Error
17
+ class NoAdaptersError < Error
18
18
  def initialize
19
- super("Use the `ThisFeature.write_adapter=` setter before calling #enable or #disable")
19
+ super("No adapters configured.")
20
20
  end
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  class ThisFeature
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
data/memory CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: this_feature-adapters-flipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Pleaner
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: this_feature
@@ -78,7 +78,6 @@ files:
78
78
  - lib/this_feature/flag.rb
79
79
  - lib/this_feature/version.rb
80
80
  - memory
81
- - this_feature-0.5.1.gem
82
81
  - this_feature-adapters-flipper.gemspec
83
82
  - this_feature-adapters-split_io.gemspec
84
83
  - this_feature.gemspec
@@ -86,7 +85,7 @@ homepage: http://hover.to
86
85
  licenses:
87
86
  - MIT
88
87
  metadata: {}
89
- post_install_message:
88
+ post_install_message:
90
89
  rdoc_options: []
91
90
  require_paths:
92
91
  - lib
@@ -101,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
100
  - !ruby/object:Gem::Version
102
101
  version: '0'
103
102
  requirements: []
104
- rubygems_version: 3.0.3
105
- signing_key:
103
+ rubygems_version: 3.1.2
104
+ signing_key:
106
105
  specification_version: 4
107
106
  summary: "[summary]"
108
107
  test_files: []
Binary file