flipper 0.7.0.beta1 → 0.7.0.beta2

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
  SHA1:
3
- metadata.gz: 94132c1c49e833a166069931d26beee25f9f5a1e
4
- data.tar.gz: 8575c2db458321be6d371f04b842e04f6a99daeb
3
+ metadata.gz: fcc306a0110366af90921368bda9c8aeffa353ca
4
+ data.tar.gz: a1b1808be6c648f99f14e9e033dd945a4152744a
5
5
  SHA512:
6
- metadata.gz: 51df2910a358380d4b1eace919c8f6277210cf4b007b1ab34c10376070041dc3ab843ab551d1d3524ac42599a1e3556bab53c3aaf890c2e81a24f40f7980ab26
7
- data.tar.gz: bcce3fe6e79483dbc1eeae59b32743bdfef65cb711f532b9f4aa33752d74b5e31fef5ed39a76c6fb7be9fd3796ea4be23561cf1e1f5264d2f99c6da07779b444
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
+ [![Build Status](https://travis-ci.org/jnunemaker/flipper.svg?branch=master)](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)
@@ -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=#{@name.inspect}",
57
- "key=#{@key.inspect}",
58
- "data_type=#{@data_type.inspect}",
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
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = "0.7.0.beta1"
2
+ VERSION = "0.7.0.beta2"
3
3
  end
@@ -8,9 +8,34 @@ describe Flipper::Gate do
8
8
  }
9
9
 
10
10
  describe "#inspect" do
11
- it "returns easy to read string representation" do
12
- string = subject.inspect
13
- string.should include('Flipper::Gate')
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.beta1
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-04 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Feature flipper for any adapter
14
14
  email: