flipper-sequel 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flipper-sequel.gemspec +2 -2
- data/lib/flipper/adapters/sequel.rb +19 -18
- data/lib/flipper/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1afcc212e2af0dbe0889170d98cb7b7a4f32c89646b875817c7d0cbad43f0f1
|
4
|
+
data.tar.gz: 0ea532c1a2180acff9eed0dae1ab49266382002862b496a223e3f27d4d37573e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf28df5354ac273b3e4da0481f464226ae07cb0874c530f86d12891cdb848610e34b127a2d19f1f36aea6109210b7c52338898b2a500465075202c43c1754c4
|
7
|
+
data.tar.gz: c85807a5f39d681fad45867678abcfc6ee34e1c2c299305ebaa18afd2061ecf70cb1a570489ff907cfa6f2946adc664d0584783a647d377ea9d6c4f2a2c8a9b2
|
data/flipper-sequel.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
extra_files = [
|
16
16
|
'lib/flipper/version.rb',
|
17
17
|
]
|
18
|
-
gem.files = `git ls-files`.split("\n").select(&flipper_sequel_files) + extra_files
|
19
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_sequel_files) # rubocop:disable
|
18
|
+
gem.files = `git ls-files`.split("\n").select(&flipper_sequel_files) + extra_files
|
19
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_sequel_files) # rubocop:disable Layout/LineLength
|
20
20
|
gem.name = 'flipper-sequel'
|
21
21
|
gem.require_paths = ['lib']
|
22
22
|
gem.version = Flipper::VERSION
|
@@ -120,15 +120,10 @@ module Flipper
|
|
120
120
|
# Returns true.
|
121
121
|
def enable(feature, gate, thing)
|
122
122
|
case gate.data_type
|
123
|
-
when :boolean
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
key: gate.key.to_s,
|
128
|
-
}
|
129
|
-
@gate_class.where(args).delete
|
130
|
-
@gate_class.create(gate_attrs(feature, gate, thing))
|
131
|
-
end
|
123
|
+
when :boolean
|
124
|
+
set(feature, gate, thing, clear: true)
|
125
|
+
when :integer
|
126
|
+
set(feature, gate, thing)
|
132
127
|
when :set
|
133
128
|
begin
|
134
129
|
@gate_class.create(gate_attrs(feature, gate, thing))
|
@@ -153,15 +148,7 @@ module Flipper
|
|
153
148
|
when :boolean
|
154
149
|
clear(feature)
|
155
150
|
when :integer
|
156
|
-
|
157
|
-
args = {
|
158
|
-
feature_key: feature.key.to_s,
|
159
|
-
key: gate.key.to_s,
|
160
|
-
}
|
161
|
-
@gate_class.where(args).delete
|
162
|
-
|
163
|
-
@gate_class.create(gate_attrs(feature, gate, thing))
|
164
|
-
end
|
151
|
+
set(feature, gate, thing)
|
165
152
|
when :set
|
166
153
|
@gate_class.where(gate_attrs(feature, gate, thing))
|
167
154
|
.delete
|
@@ -178,6 +165,20 @@ module Flipper
|
|
178
165
|
raise "#{data_type} is not supported by this adapter"
|
179
166
|
end
|
180
167
|
|
168
|
+
def set(feature, gate, thing, options = {})
|
169
|
+
clear_feature = options.fetch(:clear, false)
|
170
|
+
args = {
|
171
|
+
feature_key: feature.key,
|
172
|
+
key: gate.key.to_s,
|
173
|
+
}
|
174
|
+
|
175
|
+
@gate_class.db.transaction do
|
176
|
+
clear(feature) if clear_feature
|
177
|
+
@gate_class.where(args).delete
|
178
|
+
@gate_class.create(gate_attrs(feature, gate, thing))
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
181
182
|
def gate_attrs(feature, gate, thing)
|
182
183
|
{
|
183
184
|
feature_key: feature.key.to_s,
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flipper
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.17.
|
19
|
+
version: 0.17.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.17.
|
26
|
+
version: 0.17.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sequel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|