flipper 0.7.0.beta1 → 0.7.0.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/flipper/feature.rb +2 -2
- data/lib/flipper/gate.rb +3 -3
- data/lib/flipper/instrumenters/memory.rb +5 -0
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/gate_spec.rb +28 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcc306a0110366af90921368bda9c8aeffa353ca
|
4
|
+
data.tar.gz: a1b1808be6c648f99f14e9e033dd945a4152744a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16397be35aa9c521e74c15046bd2efacb8537d9460f0e4dc9ef3ca212e46d320791d0a22fd1dbacd058776feab6ea7cd91e6af7855b7c9e297bcca75342ea641
|
7
|
+
data.tar.gz: e70319c0460a878e2f861a637715cc749f76992d08f3ee6d17a149b05ea847a49fb665d2a77a604981dac8366e09fc3740c08a59ba35cdba027952b4fb220a7e
|
data/README.md
CHANGED
@@ -292,6 +292,8 @@ config.middleware.use Flipper::Middleware::Memoizer, lambda { $flipper }
|
|
292
292
|
2. `script/release`
|
293
293
|
3. Profit.
|
294
294
|
|
295
|
+
[](https://travis-ci.org/jnunemaker/flipper)
|
296
|
+
|
295
297
|
## Coming Soon™
|
296
298
|
|
297
299
|
* [Web UI](https://github.com/jnunemaker/flipper-ui) (think Resque UI for features toggling/status)
|
data/lib/flipper/feature.rb
CHANGED
@@ -354,7 +354,7 @@ module Flipper
|
|
354
354
|
:thing => thing,
|
355
355
|
}
|
356
356
|
|
357
|
-
@instrumenter.instrument(InstrumentationName, payload) {
|
357
|
+
@instrumenter.instrument(InstrumentationName, payload) { |payload|
|
358
358
|
payload[:result] = yield(payload) if block_given?
|
359
359
|
}
|
360
360
|
end
|
@@ -368,7 +368,7 @@ module Flipper
|
|
368
368
|
:thing => thing,
|
369
369
|
}
|
370
370
|
|
371
|
-
@instrumenter.instrument(GateInstrumentationName, payload) {
|
371
|
+
@instrumenter.instrument(GateInstrumentationName, payload) { |payload|
|
372
372
|
payload[:result] = yield(payload) if block_given?
|
373
373
|
}
|
374
374
|
end
|
data/lib/flipper/gate.rb
CHANGED
@@ -53,9 +53,9 @@ module Flipper
|
|
53
53
|
# Public: Pretty string version for debugging.
|
54
54
|
def inspect
|
55
55
|
attributes = [
|
56
|
-
"name=#{
|
57
|
-
"key=#{
|
58
|
-
"data_type=#{
|
56
|
+
"name=#{name.inspect}",
|
57
|
+
"key=#{key.inspect}",
|
58
|
+
"data_type=#{data_type.inspect}",
|
59
59
|
]
|
60
60
|
"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>"
|
61
61
|
end
|
@@ -12,6 +12,11 @@ module Flipper
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def instrument(name, payload = {})
|
15
|
+
# Copy the payload to guard against later modifications to it, and to
|
16
|
+
# ensure that all instrumentation code uses the payload passed to the
|
17
|
+
# block rather than the one passed to #instrument.
|
18
|
+
payload = payload.dup
|
19
|
+
|
15
20
|
result = if block_given?
|
16
21
|
yield payload
|
17
22
|
else
|
data/lib/flipper/version.rb
CHANGED
data/spec/flipper/gate_spec.rb
CHANGED
@@ -8,9 +8,34 @@ describe Flipper::Gate do
|
|
8
8
|
}
|
9
9
|
|
10
10
|
describe "#inspect" do
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
context "for subclass" do
|
12
|
+
let(:subclass) {
|
13
|
+
Class.new(described_class) {
|
14
|
+
def name
|
15
|
+
:name
|
16
|
+
end
|
17
|
+
|
18
|
+
def key
|
19
|
+
:key
|
20
|
+
end
|
21
|
+
|
22
|
+
def data_type
|
23
|
+
:set
|
24
|
+
end
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
subject {
|
29
|
+
subclass.new
|
30
|
+
}
|
31
|
+
|
32
|
+
it "includes attributes" do
|
33
|
+
string = subject.inspect
|
34
|
+
string.should include(subject.object_id.to_s)
|
35
|
+
string.should include('name=:name')
|
36
|
+
string.should include('key=:key')
|
37
|
+
string.should include('data_type=:set')
|
38
|
+
end
|
14
39
|
end
|
15
40
|
end
|
16
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.0.
|
4
|
+
version: 0.7.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Feature flipper for any adapter
|
14
14
|
email:
|