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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a08934a1ae6650b63f3fcb68f33cf7102aebc9680eb14abb701f14a3f9c9881
4
- data.tar.gz: a616484e39248622506d3d1126e9fcd485dcdaff05271ed30df1de7268dc35cf
3
+ metadata.gz: e54420e133a98d1409c46eee996cb5e1b2f1dc5f7a42e13a239d117aad1b1f4e
4
+ data.tar.gz: 6a33075a77c44f4661dea0b86b790e10ecc4b57bf73c2d54188eb97654fe72b5
5
5
  SHA512:
6
- metadata.gz: a5c3ed590df5cdf8a17f505307226c74644f590860d2bee6dba49e0665ba1e14f4c55ce583de59926019bff026ace586c399302e8d36258239c07019db463c05
7
- data.tar.gz: b3bdde7e3829c4c0cbcaffa60e5bcb06991753f3b4ac0878a6a55f31fedc42de8b84a3730fdd7f341c7dac96e62a73fd099892d3cd176db02fd6ee500ec2776a
6
+ metadata.gz: dc79979ecadab2e090576c0a3adb3c35b1d542eed28cfe7129a4ff988ed247f3bc7c3643b4485d332989e5584d2fb8499b2a2fd278c5d181593ac1f81fa1402e
7
+ data.tar.gz: e67db92eacbac704ff680d4a4fd3aacbdbb568f155914d819daa7b223dab72b18955c442d73bbcbb0a58326acca983c59e150cbf47bed8bb128a1414be129bbd
@@ -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 like so:
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/adapters/sequel'
32
- adapter = Flipper::Adapters::Sequel.new
33
- flipper = Flipper.new(adapter)
34
- # profit...
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
@@ -1,10 +1,4 @@
1
- require 'pathname'
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 'pp'
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
@@ -1 +1,9 @@
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
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.20.4'.freeze
2
+ VERSION = '0.21.0.rc1'.freeze
3
3
  end
@@ -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.20.4
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-03-06 00:00:00.000000000 Z
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.20.4
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.20.4
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: '0'
82
+ version: 1.3.1
83
83
  requirements: []
84
84
  rubygems_version: 3.0.3
85
85
  signing_key: