flipper-sequel 0.20.4 → 0.21.0.rc1
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 +12 -5
- data/examples/sequel/basic.rb +1 -7
- data/examples/sequel/internals.rb +1 -8
- data/lib/flipper-sequel.rb +8 -0
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/adapters/sequel_spec.rb +17 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e54420e133a98d1409c46eee996cb5e1b2f1dc5f7a42e13a239d117aad1b1f4e
|
4
|
+
data.tar.gz: 6a33075a77c44f4661dea0b86b790e10ecc4b57bf73c2d54188eb97654fe72b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc79979ecadab2e090576c0a3adb3c35b1d542eed28cfe7129a4ff988ed247f3bc7c3643b4485d332989e5584d2fb8499b2a2fd278c5d181593ac1f81fa1402e
|
7
|
+
data.tar.gz: e67db92eacbac704ff680d4a4fd3aacbdbb568f155914d819daa7b223dab72b18955c442d73bbcbb0a58326acca983c59e150cbf47bed8bb128a1414be129bbd
|
data/docs/sequel/README.md
CHANGED
@@ -25,13 +25,20 @@ require 'generators/flipper/templates/sequel_migration'
|
|
25
25
|
CreateFlipperTablesSequel.new(Sequel::Model.db).up
|
26
26
|
```
|
27
27
|
|
28
|
-
Once you have created and executed the migration, you can use the sequel adapter
|
28
|
+
Once you have created and executed the migration, you can use the sequel adapter by simply requiring it:
|
29
29
|
|
30
30
|
```ruby
|
31
|
-
require 'flipper
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
require 'flipper-sequel`
|
32
|
+
```
|
33
|
+
|
34
|
+
**If you need to customize the adapter**, you can add this to an initializer:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
Flipper.configure do |config|
|
38
|
+
config.default do
|
39
|
+
Flipper.new(Flipper::Adapters::Sequel.new)
|
40
|
+
end
|
41
|
+
end
|
35
42
|
```
|
36
43
|
|
37
44
|
## Internals
|
data/examples/sequel/basic.rb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'logger'
|
3
|
-
|
4
|
-
root_path = Pathname(__FILE__).dirname.join('..').expand_path
|
5
|
-
lib_path = root_path.join('lib')
|
6
|
-
$:.unshift(lib_path)
|
7
|
-
|
1
|
+
require 'bundler/setup'
|
8
2
|
require 'sequel'
|
9
3
|
Sequel::Model.db = Sequel.sqlite(':memory:')
|
10
4
|
Sequel.extension :migration, :core_extensions
|
@@ -1,11 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'pathname'
|
3
|
-
require 'logger'
|
4
|
-
|
5
|
-
root_path = Pathname(__FILE__).dirname.join('..').expand_path
|
6
|
-
lib_path = root_path.join('lib')
|
7
|
-
$:.unshift(lib_path)
|
8
|
-
|
1
|
+
require 'bundler/setup'
|
9
2
|
require 'sequel'
|
10
3
|
Sequel::Model.db = Sequel.sqlite(':memory:')
|
11
4
|
Sequel.extension :migration, :core_extensions
|
data/lib/flipper-sequel.rb
CHANGED
data/lib/flipper/version.rb
CHANGED
@@ -28,4 +28,21 @@ RSpec.describe Flipper::Adapters::Sequel do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it_should_behave_like 'a flipper adapter'
|
31
|
+
|
32
|
+
context 'requiring "flipper-sequel"' do
|
33
|
+
before do
|
34
|
+
Flipper.configuration = nil
|
35
|
+
Flipper.instance = nil
|
36
|
+
|
37
|
+
load 'flipper-sequel.rb'
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'configures itself' do
|
41
|
+
expect(Flipper.adapter.adapter).to be_a(Flipper::Adapters::Sequel)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "defines #flipper_id on Sequel::Model" do
|
45
|
+
expect(Sequel::Model.ancestors).to include(Flipper::Identifier)
|
46
|
+
end
|
47
|
+
end
|
31
48
|
end
|
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.
|
4
|
+
version: 0.21.0.rc1
|
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-
|
11
|
+
date: 2021-05-01 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.
|
19
|
+
version: 0.21.0.rc1
|
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.
|
26
|
+
version: 0.21.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sequel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,9 +77,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.3.1
|
83
83
|
requirements: []
|
84
84
|
rubygems_version: 3.0.3
|
85
85
|
signing_key:
|