motion-wiretap 1.1.1 → 1.1.2
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/lib/motion-wiretap/all/signal.rb +16 -3
- data/lib/motion-wiretap/version.rb +1 -1
- 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: 603a0ed4a62d6d94d14f2d6f14d08393d6c37b40
|
4
|
+
data.tar.gz: dc884f2877a4e6d03b0075b859aa736d20d23bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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=
|
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
|
-
|
41
|
+
unless @value == SINGLETON
|
42
|
+
trigger_changed(@value)
|
43
|
+
end
|
31
44
|
return self
|
32
45
|
end
|
33
46
|
|
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.
|
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
|
+
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
|