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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e54420e133a98d1409c46eee996cb5e1b2f1dc5f7a42e13a239d117aad1b1f4e
4
- data.tar.gz: 6a33075a77c44f4661dea0b86b790e10ecc4b57bf73c2d54188eb97654fe72b5
3
+ metadata.gz: 4efe692e0aba188f98234a0c12e384ff03417278d41584f96dcf03b3e99cbc45
4
+ data.tar.gz: a6657db87c657943a0d4d792251e50cc41518d6b7029c965b80dfba3a7c3bd52
5
5
  SHA512:
6
- metadata.gz: dc79979ecadab2e090576c0a3adb3c35b1d542eed28cfe7129a4ff988ed247f3bc7c3643b4485d332989e5584d2fb8499b2a2fd278c5d181593ac1f81fa1402e
7
- data.tar.gz: e67db92eacbac704ff680d4a4fd3aacbdbb568f155914d819daa7b223dab72b18955c442d73bbcbb0a58326acca983c59e150cbf47bed8bb128a1414be129bbd
6
+ metadata.gz: a160e508e39851553bdb5dd0a7fb4548ca71e2c332199db43930f218aa43d1d35f3e29812764dc84b113330afd04eeb2fa5ebf758d848a011693a79f7e04f9ea
7
+ data.tar.gz: c5dd341cc6acebef08485b0b087407f8f4a9718b23e268442a6dbce9faa4ca34c4d6719a5354316d7f0cef9a048ca201b6de187497d9adc610fbdf37223a4f69
@@ -35,9 +35,7 @@ require 'flipper-sequel`
35
35
 
36
36
  ```ruby
37
37
  Flipper.configure do |config|
38
- config.default do
39
- Flipper.new(Flipper::Adapters::Sequel.new)
40
- end
38
+ config.adapter { Flipper::Adapters::Sequel.new }
41
39
  end
42
40
  ```
43
41
 
@@ -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
- flipper[:stats].enable
11
+ Flipper[:stats].enable
14
12
 
15
- if flipper[:stats].enabled?
13
+ if Flipper[:stats].enabled?
16
14
  puts "Enabled!"
17
15
  else
18
16
  puts "Disabled!"
19
17
  end
20
18
 
21
- flipper[:stats].disable
19
+ Flipper[:stats].disable
22
20
 
23
- if flipper[:stats].enabled?
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
- flipper[:stats].enable
21
- flipper[:stats].enable_group :admins
22
- flipper[:stats].enable_group :early_access
23
- flipper[:stats].enable_actor User.new('25')
24
- flipper[:stats].enable_actor User.new('90')
25
- flipper[:stats].enable_actor User.new('180')
26
- flipper[:stats].enable_percentage_of_time 15
27
- flipper[:stats].enable_percentage_of_actors 45
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
- flipper[:search].enable
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(flipper[:stats])
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"}>,
@@ -1,9 +1 @@
1
1
  require 'flipper/adapters/sequel'
2
-
3
- Flipper.configure do |config|
4
- config.default do
5
- Flipper.new(Flipper::Adapters::Sequel.new)
6
- end
7
- end
8
-
9
- Sequel::Model.include Flipper::Identifier
@@ -210,3 +210,9 @@ module Flipper
210
210
  end
211
211
  end
212
212
  end
213
+
214
+ Flipper.configure do |config|
215
+ config.adapter { Flipper::Adapters::Sequel.new }
216
+ end
217
+
218
+ Sequel::Model.include Flipper::Identifier
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.21.0.rc1'.freeze
2
+ VERSION = '0.21.0.rc2'.freeze
3
3
  end
@@ -34,7 +34,7 @@ RSpec.describe Flipper::Adapters::Sequel do
34
34
  Flipper.configuration = nil
35
35
  Flipper.instance = nil
36
36
 
37
- load 'flipper-sequel.rb'
37
+ load 'flipper/adapters/sequel.rb'
38
38
  end
39
39
 
40
40
  it 'configures itself' do
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.rc1
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-01 00:00:00.000000000 Z
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.rc1
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.rc1
26
+ version: 0.21.0.rc2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sequel
29
29
  requirement: !ruby/object:Gem::Requirement