locomotion 0.0.5 → 0.0.6
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/locomotion/version.rb +1 -1
- data/motion/locomotion.rb +1 -1
- data/motion/locomotion/watchman.rb +2 -8
- data/spec/locomotion/watchman_spec.rb +4 -10
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8664167db5d1318e9bc7b6c74edb4d30a7879c14
|
4
|
+
data.tar.gz: 8ff6e3e495f7466f1c07a9389d25ce16aa3c2b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82247728420de9b5ab330b562178ed1ee9d5ad1749daaee60b25f1b5edd14f617f5974cb9bbc47fd455112e96133389dd29eabdcd98e7833b1815f3c4c587aad
|
7
|
+
data.tar.gz: 2c4688992e6aac85b85b698ee5f44ac3ca2fcadda9e498e53497557b633478e531e00a09cb979be74e7b30936ad9116f5e47b217bdd2d247ce3dd9680575d1f9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/locomotion/version.rb
CHANGED
data/motion/locomotion.rb
CHANGED
@@ -11,15 +11,12 @@ module Locomotion
|
|
11
11
|
self
|
12
12
|
end
|
13
13
|
attr_reader :location_manager
|
14
|
+
attr_accessor :listener
|
14
15
|
|
15
16
|
def process options = {}
|
16
17
|
@location_manager.purpose = options[:purpose] if options[:purpose]
|
17
18
|
end
|
18
19
|
|
19
|
-
def listeners
|
20
|
-
@listeners ||= []
|
21
|
-
end
|
22
|
-
|
23
20
|
def go
|
24
21
|
@location_manager.startUpdatingLocation
|
25
22
|
end
|
@@ -35,13 +32,10 @@ module Locomotion
|
|
35
32
|
|
36
33
|
def clear
|
37
34
|
@location_manager.stopUpdatingLocation
|
38
|
-
@listeners = []
|
39
35
|
end
|
40
36
|
|
41
37
|
def update location
|
42
|
-
@
|
43
|
-
listener.call Location.alloc.init(location)
|
44
|
-
end
|
38
|
+
@listener.call Location.alloc.init(location)
|
45
39
|
end
|
46
40
|
|
47
41
|
def error code
|
@@ -25,9 +25,9 @@ describe 'the watchman' do
|
|
25
25
|
@watchman.location_manager.purpose.should.equal 'My Purpose'
|
26
26
|
end
|
27
27
|
|
28
|
-
it 'accepts
|
29
|
-
@watchman.
|
30
|
-
@watchman.
|
28
|
+
it 'accepts a listener' do
|
29
|
+
@watchman.listener = :a
|
30
|
+
@watchman.listener.should.equal :a
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'tells location manager to start on go' do
|
@@ -50,14 +50,8 @@ describe 'the watchman' do
|
|
50
50
|
@watchman.location_manager.commands.should.equal [:stop]
|
51
51
|
end
|
52
52
|
|
53
|
-
it 'removes listeners on clear' do
|
54
|
-
@watchman.listeners << :a
|
55
|
-
@watchman.clear
|
56
|
-
@watchman.listeners.should.equal []
|
57
|
-
end
|
58
|
-
|
59
53
|
it 'tells listeners on update' do
|
60
|
-
@watchman.
|
54
|
+
@watchman.listener = proc { |location| @location = location }
|
61
55
|
@watchman.update CLLocation.alloc.initWithLatitude 1, longitude: 1
|
62
56
|
@location.should.satisfy { |l| l.latitude == 1 && l.longitude == 1 }
|
63
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Rowe
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
2feWfO4gCNmvfFjULOAYHq9JHEjN5SLSXvj5HdSnDcCyIfJKn5Ya3JahWQaWIsXf
|
30
30
|
/NPE/mB57TOwj+d7XUa2NC4HUadF8R51IYEcIB0PpIEzJlKtfXFcOZxO
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2013-05-
|
32
|
+
date: 2013-05-31 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|