flipper-sequel 0.21.0.rc1 → 0.21.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/sequel/README.md +1 -3
- data/examples/sequel/basic.rb +4 -6
- data/examples/sequel/internals.rb +10 -12
- data/lib/flipper-sequel.rb +0 -8
- data/lib/flipper/adapters/sequel.rb +6 -0
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/adapters/sequel_spec.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: 4efe692e0aba188f98234a0c12e384ff03417278d41584f96dcf03b3e99cbc45
|
4
|
+
data.tar.gz: a6657db87c657943a0d4d792251e50cc41518d6b7029c965b80dfba3a7c3bd52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a160e508e39851553bdb5dd0a7fb4548ca71e2c332199db43930f218aa43d1d35f3e29812764dc84b113330afd04eeb2fa5ebf758d848a011693a79f7e04f9ea
|
7
|
+
data.tar.gz: c5dd341cc6acebef08485b0b087407f8f4a9718b23e268442a6dbce9faa4ca34c4d6719a5354316d7f0cef9a048ca201b6de187497d9adc610fbdf37223a4f69
|
data/docs/sequel/README.md
CHANGED
data/examples/sequel/basic.rb
CHANGED
@@ -7,20 +7,18 @@ require 'generators/flipper/templates/sequel_migration'
|
|
7
7
|
CreateFlipperTablesSequel.new(Sequel::Model.db).up
|
8
8
|
|
9
9
|
require 'flipper/adapters/sequel'
|
10
|
-
adapter = Flipper::Adapters::Sequel.new
|
11
|
-
flipper = Flipper.new(adapter)
|
12
10
|
|
13
|
-
|
11
|
+
Flipper[:stats].enable
|
14
12
|
|
15
|
-
if
|
13
|
+
if Flipper[:stats].enabled?
|
16
14
|
puts "Enabled!"
|
17
15
|
else
|
18
16
|
puts "Disabled!"
|
19
17
|
end
|
20
18
|
|
21
|
-
|
19
|
+
Flipper[:stats].disable
|
22
20
|
|
23
|
-
if
|
21
|
+
if Flipper[:stats].enabled?
|
24
22
|
puts "Enabled!"
|
25
23
|
else
|
26
24
|
puts "Disabled!"
|
@@ -7,8 +7,6 @@ require 'generators/flipper/templates/sequel_migration'
|
|
7
7
|
CreateFlipperTablesSequel.new(Sequel::Model.db).up
|
8
8
|
|
9
9
|
require 'flipper/adapters/sequel'
|
10
|
-
adapter = Flipper::Adapters::Sequel.new
|
11
|
-
flipper = Flipper.new(adapter)
|
12
10
|
|
13
11
|
# Register a few groups.
|
14
12
|
Flipper.register(:admins) { |thing| thing.admin? }
|
@@ -17,16 +15,16 @@ Flipper.register(:early_access) { |thing| thing.early_access? }
|
|
17
15
|
# Create a user class that has flipper_id instance method.
|
18
16
|
User = Struct.new(:flipper_id)
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
Flipper[:stats].enable
|
19
|
+
Flipper[:stats].enable_group :admins
|
20
|
+
Flipper[:stats].enable_group :early_access
|
21
|
+
Flipper[:stats].enable_actor User.new('25')
|
22
|
+
Flipper[:stats].enable_actor User.new('90')
|
23
|
+
Flipper[:stats].enable_actor User.new('180')
|
24
|
+
Flipper[:stats].enable_percentage_of_time 15
|
25
|
+
Flipper[:stats].enable_percentage_of_actors 45
|
28
26
|
|
29
|
-
|
27
|
+
Flipper[:search].enable
|
30
28
|
|
31
29
|
puts 'all rows in features table'
|
32
30
|
pp Flipper::Adapters::Sequel::Feature.all
|
@@ -48,7 +46,7 @@ pp Flipper::Adapters::Sequel::Gate.all
|
|
48
46
|
puts
|
49
47
|
|
50
48
|
puts 'flipper get of feature'
|
51
|
-
pp adapter.get(
|
49
|
+
pp Flipper.adapter.get(Flipper[:stats])
|
52
50
|
# {:boolean=>"true",
|
53
51
|
# :groups=>#<Set: {"admins", "early_access"}>,
|
54
52
|
# :actors=>#<Set: {"180", "25", "90"}>,
|
data/lib/flipper-sequel.rb
CHANGED
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.21.0.
|
4
|
+
version: 0.21.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-08 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.21.0.
|
19
|
+
version: 0.21.0.rc2
|
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.21.0.
|
26
|
+
version: 0.21.0.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sequel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|