locomotion 0.0.5 → 0.0.6

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: 6d3bc71f520f639a1d20c3689f2f910526d6ff97
4
- data.tar.gz: eedc8a225cfdc0a6b19f48103309fc79b406f6f8
3
+ metadata.gz: 8664167db5d1318e9bc7b6c74edb4d30a7879c14
4
+ data.tar.gz: 8ff6e3e495f7466f1c07a9389d25ce16aa3c2b79
5
5
  SHA512:
6
- metadata.gz: e957d3b0e022e638631266934443f9441aebac0b975478f77e4fbce16c04bed54b959a339bd46520e83b9ede82b814af232880ba2d86856921e966e82a0f6ef1
7
- data.tar.gz: 646dc0a031d3245e3e9c286cb4409592e35d4307f2b479316a185ef5b50cbd47c411d83299e888a03223dd8aaa51463d153ae1e8917fa3ad7919e4244cf61d32
6
+ metadata.gz: 82247728420de9b5ab330b562178ed1ee9d5ad1749daaee60b25f1b5edd14f617f5974cb9bbc47fd455112e96133389dd29eabdcd98e7833b1815f3c4c587aad
7
+ data.tar.gz: 2c4688992e6aac85b85b698ee5f44ac3ca2fcadda9e498e53497557b633478e531e00a09cb979be74e7b30936ad9116f5e47b217bdd2d247ce3dd9680575d1f9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,3 @@
1
1
  module Locomotion
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -18,7 +18,7 @@ module Locomotion
18
18
 
19
19
  def watch opts = {}, &block
20
20
  watchman.process opts
21
- watchman.listeners << block
21
+ watchman.listener = block
22
22
  watchman.go
23
23
  end
24
24
 
@@ -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
- @listeners.each do |listener|
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 listeners' do
29
- @watchman.listeners << :a
30
- @watchman.listeners.should.equal [:a]
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.listeners << proc { |location| @location = location }
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.5
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-30 00:00:00.000000000 Z
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