flipper-redis 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,6 @@ Gem::Specification.new do |gem|
15
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
17
 
18
- gem.add_dependency 'flipper', '~> 0.5.0'
18
+ gem.add_dependency 'flipper', '~> 0.6.0'
19
19
  gem.add_dependency 'redis', '~> 3.0.0'
20
20
  end
@@ -21,6 +21,32 @@ module Flipper
21
21
  @name = :redis
22
22
  end
23
23
 
24
+ # Public: The set of known features.
25
+ def features
26
+ @client.smembers(FeaturesKey).to_set
27
+ end
28
+
29
+ # Public: Adds a feature to the set of known features.
30
+ def add(feature)
31
+ @client.sadd FeaturesKey, feature.name
32
+ true
33
+ end
34
+
35
+ # Public: Removes a feature from the set of known features.
36
+ def remove(feature)
37
+ @client.multi do
38
+ @client.srem FeaturesKey, feature.name
39
+ @client.del feature.key
40
+ end
41
+ true
42
+ end
43
+
44
+ # Public: Clears the gate values for a feature.
45
+ def clear(feature)
46
+ @client.del feature.key
47
+ true
48
+ end
49
+
24
50
  # Public: Gets the values for all gates for a given feature.
25
51
  #
26
52
  # Returns a Hash of Flipper::Gate#key => value.
@@ -85,17 +111,6 @@ module Flipper
85
111
  true
86
112
  end
87
113
 
88
- # Public: Adds a feature to the set of known features.
89
- def add(feature)
90
- @client.sadd FeaturesKey, feature.name
91
- true
92
- end
93
-
94
- # Public: The set of known features.
95
- def features
96
- @client.smembers(FeaturesKey).to_set
97
- end
98
-
99
114
  # Private: Gets a hash of fields => values for the given feature.
100
115
  #
101
116
  # Returns a Hash of fields => values.
@@ -1,7 +1,7 @@
1
1
  module Flipper
2
2
  module Adapters
3
3
  class Redis
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-16 00:00:00.000000000 Z
12
+ date: 2013-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: flipper
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.5.0
21
+ version: 0.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.5.0
29
+ version: 0.6.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: redis
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -77,18 +77,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  - - ! '>='
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
- segments:
81
- - 0
82
- hash: -1629782830808389875
83
80
  required_rubygems_version: !ruby/object:Gem::Requirement
84
81
  none: false
85
82
  requirements:
86
83
  - - ! '>='
87
84
  - !ruby/object:Gem::Version
88
85
  version: '0'
89
- segments:
90
- - 0
91
- hash: -1629782830808389875
92
86
  requirements: []
93
87
  rubyforge_project:
94
88
  rubygems_version: 1.8.23