flipper-dalli 0.10.2 → 0.11.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flipper-dalli.gemspec +11 -11
- data/lib/flipper/adapters/dalli.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/adapters/dalli_spec.rb +10 -10
- data/test/adapters/dalli_test.rb +2 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f19713f07ccef5f6d64cf3ec88c42b38b69790b1
|
4
|
+
data.tar.gz: a40bcaf649b7c66789194e41f6e5780f05391ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4705e496decb6676f8fd54806ed616f2b26b78e09f15790572943fdd48005bd11222cf07b5636b593416bef4eecab936cdbd9b3949ce00947ae41e5a2dd8998
|
7
|
+
data.tar.gz: ef8fae20852b3e92974cbaea0b2e85d1fdaf7931fe739c49fd54cbc0e52f44175b5893375caf831fd0b724d526a91241e32023789478cf89d64685ed825f535d
|
data/flipper-dalli.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
require File.expand_path('../lib/flipper/version', __FILE__)
|
3
3
|
|
4
|
-
flipper_dalli_files = lambda
|
4
|
+
flipper_dalli_files = lambda do |file|
|
5
5
|
file =~ /dalli/
|
6
|
-
|
6
|
+
end
|
7
7
|
|
8
8
|
Gem::Specification.new do |gem|
|
9
|
-
gem.authors = [
|
10
|
-
gem.email = [
|
11
|
-
gem.summary =
|
12
|
-
gem.description =
|
13
|
-
gem.license =
|
14
|
-
gem.homepage =
|
9
|
+
gem.authors = ['John Nunemaker']
|
10
|
+
gem.email = ['nunemaker@gmail.com']
|
11
|
+
gem.summary = 'Dalli adapter for Flipper'
|
12
|
+
gem.description = 'Dalli adapter for Flipper'
|
13
|
+
gem.license = 'MIT'
|
14
|
+
gem.homepage = 'https://github.com/jnunemaker/flipper'
|
15
15
|
|
16
|
-
gem.files = `git ls-files`.split("\n").select(&flipper_dalli_files) + [
|
16
|
+
gem.files = `git ls-files`.split("\n").select(&flipper_dalli_files) + ['lib/flipper/version.rb']
|
17
17
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_dalli_files)
|
18
|
-
gem.name =
|
19
|
-
gem.require_paths = [
|
18
|
+
gem.name = 'flipper-dalli'
|
19
|
+
gem.require_paths = ['lib']
|
20
20
|
gem.version = Flipper::VERSION
|
21
21
|
|
22
22
|
gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
|
data/lib/flipper/version.rb
CHANGED
@@ -5,11 +5,11 @@ require 'flipper/spec/shared_adapter_specs'
|
|
5
5
|
|
6
6
|
RSpec.describe Flipper::Adapters::Dalli do
|
7
7
|
let(:memory_adapter) { Flipper::Adapters::Memory.new }
|
8
|
-
let(:cache) { Dalli::Client.new(ENV[
|
9
|
-
let(:adapter) {
|
8
|
+
let(:cache) { Dalli::Client.new(ENV['BOXEN_MEMCACHED_URL'] || '127.0.0.1:11211') }
|
9
|
+
let(:adapter) { described_class.new(memory_adapter, cache) }
|
10
10
|
let(:flipper) { Flipper.new(adapter) }
|
11
11
|
|
12
|
-
subject {
|
12
|
+
subject { adapter }
|
13
13
|
|
14
14
|
before do
|
15
15
|
cache.flush
|
@@ -17,8 +17,8 @@ RSpec.describe Flipper::Adapters::Dalli do
|
|
17
17
|
|
18
18
|
it_should_behave_like 'a flipper adapter'
|
19
19
|
|
20
|
-
describe
|
21
|
-
it
|
20
|
+
describe '#remove' do
|
21
|
+
it 'expires feature' do
|
22
22
|
feature = flipper[:stats]
|
23
23
|
adapter.get(feature)
|
24
24
|
adapter.remove(feature)
|
@@ -26,8 +26,8 @@ RSpec.describe Flipper::Adapters::Dalli do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
describe
|
30
|
-
it
|
29
|
+
describe '#get_multi' do
|
30
|
+
it 'warms uncached features' do
|
31
31
|
stats = flipper[:stats]
|
32
32
|
search = flipper[:search]
|
33
33
|
other = flipper[:other]
|
@@ -40,13 +40,13 @@ RSpec.describe Flipper::Adapters::Dalli do
|
|
40
40
|
|
41
41
|
adapter.get_multi([stats, search, other])
|
42
42
|
|
43
|
-
expect(cache.get(described_class.key_for(search))[:boolean]).to eq(
|
43
|
+
expect(cache.get(described_class.key_for(search))[:boolean]).to eq('true')
|
44
44
|
expect(cache.get(described_class.key_for(other))[:boolean]).to be(nil)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe
|
49
|
-
it
|
48
|
+
describe '#name' do
|
49
|
+
it 'is dalli' do
|
50
50
|
expect(subject.name).to be(:dalli)
|
51
51
|
end
|
52
52
|
end
|
data/test/adapters/dalli_test.rb
CHANGED
@@ -6,7 +6,8 @@ class DalliTest < MiniTest::Test
|
|
6
6
|
prepend Flipper::Test::SharedAdapterTests
|
7
7
|
|
8
8
|
def setup
|
9
|
-
|
9
|
+
url = ENV.fetch('BOXEN_MEMCACHED_URL', 'localhost:11211')
|
10
|
+
@cache = Dalli::Client.new(url)
|
10
11
|
@cache.flush
|
11
12
|
memory_adapter = Flipper::Adapters::Memory.new
|
12
13
|
@adapter = Flipper::Adapters::Dalli.new(memory_adapter, @cache)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-dalli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0.beta1
|
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: 2017-04-02 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.11.0.beta1
|
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.11.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dalli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,12 +72,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - "
|
75
|
+
- - ">"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 1.3.1
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
80
|
+
rubygems_version: 2.5.2
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Dalli adapter for Flipper
|