motion-wiretap 1.1.1 → 1.1.2

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: fb2edfdfa6bf35632659038cb280e926e3a80c18
4
- data.tar.gz: f6a7592c4cd25caba34d7910b6c491171d8fc434
3
+ metadata.gz: 603a0ed4a62d6d94d14f2d6f14d08393d6c37b40
4
+ data.tar.gz: dc884f2877a4e6d03b0075b859aa736d20d23bf8
5
5
  SHA512:
6
- metadata.gz: 714eed8232e3a8f750177865205426d2534b6012b9109601cb22e1208f3c2cf47f6f8f1e05229e238e5a7f73a80aba0b15007724bb1765eb9370ee244df63e1a
7
- data.tar.gz: 616ebf72275fa0a53282545da1f9286a6a1295fb8bd55de304e113809a13ff4385a1852e0eae9de8ecc5cb988186faab43d39da6ab3033ffc3d49a4d496febdf
6
+ metadata.gz: 09e75aa157623d36f01c589a43d839a29f263e9a4cb0967822234ea26827998ed7dded620b47541045e464329058323baefff08cb08109081402fe8040f026d6
7
+ data.tar.gz: f7649b063c71f4fec9a8c30d630cfdf5f15dc703a1fbe56a16eb193549a4cb9cdc44d2a77f05e8db66bf6b296acac0d107d5d39acf6c2e33030c3b8feb5f9f25
@@ -4,14 +4,25 @@ module MotionWiretap
4
4
  # Signal is triggered with a new value, or it is completed, or canceled with
5
5
  # an error event.
6
6
  class Signal < Wiretap
7
- attr :value
7
+ # This is the default initial value - it does not trigger a 'change' event.
8
+ # This value is for internal use only.
9
+ SINGLETON = Class.new.new
8
10
 
9
- def initialize(value=nil, &block)
11
+ def initialize(value=SINGLETON, &block)
10
12
  @value = value
11
13
  super(&block)
12
14
  end
13
15
 
16
+ def value
17
+ if @value == SINGLETON
18
+ nil
19
+ else
20
+ @value
21
+ end
22
+ end
23
+
14
24
  def next(value)
25
+ raise "don't do that please" if value == SINGLETON
15
26
  @value = value
16
27
  trigger_changed(@value)
17
28
  end
@@ -27,7 +38,9 @@ module MotionWiretap
27
38
  # The Signal class always sends an initial value
28
39
  def listen(wiretap=nil, &block)
29
40
  super
30
- trigger_changed(@value)
41
+ unless @value == SINGLETON
42
+ trigger_changed(@value)
43
+ end
31
44
  return self
32
45
  end
33
46
 
@@ -1,3 +1,3 @@
1
1
  module MotionWiretap
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-wiretap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2014-03-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  ReactiveCocoa is an amazing system, and RubyMotion could benefit from the