muni 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -46,3 +46,9 @@ Tasks:
46
46
  muni predict [ROUTE] [DIRECTION] [STOP] # Retrieve predictions for a route at a specific stop
47
47
  muni show [ROUTE_TAG] [DIRECTION] # Shows a specifc route by name
48
48
  ```
49
+
50
+ Contributors
51
+ ============
52
+
53
+ * [@jeffremer](https://github.com/jeffremer) (maintainer)
54
+ * [@gregorym](https://github.com/gregorym)
@@ -1,7 +1,8 @@
1
- require 'mash'
1
+ require "ostruct"
2
+
2
3
  module Muni
3
4
  class NextBusError < StandardError; end
4
- class Base < Mash
5
+ class Base < OpenStruct
5
6
  class << self
6
7
  private
7
8
 
@@ -1,4 +1,4 @@
1
- require 'amatch'
1
+ require "amatch"
2
2
 
3
3
  module Muni
4
4
  class Direction < Base
@@ -50,7 +50,7 @@ module Muni
50
50
  :lon => stop['lat'],
51
51
  :stopId => stop['lat'],
52
52
  })
53
- stops[st[:tag]] = st
53
+ stops[st.tag] = st
54
54
  end
55
55
 
56
56
  directions = []
@@ -1,3 +1,3 @@
1
1
  module Muni
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "mash"
22
21
  s.add_dependency "xml-simple"
23
22
  s.add_dependency "actionpack"
24
23
  s.add_dependency "amatch"
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe Muni::Direction do
4
+ use_vcr_cassette "Muni_Route"
5
+
6
+ let(:route) { Muni::Route.find(21) }
7
+
8
+ context "#stop_at" do
9
+ context "given a stop tag" do
10
+ it "should return the corresponding stop" do
11
+ stop = route.inbound.stop_at("36497")
12
+
13
+ stop.should be_present
14
+ stop.title.should == "Steuart St & Mission St"
15
+ end
16
+ end
17
+
18
+ context "given a stop title" do
19
+ it "should return corresponding stop" do
20
+ stop = route.inbound.stop_at("Hayes St & Shrader St")
21
+
22
+ stop.should be_present
23
+ stop.title.should == "Hayes St & Shrader St"
24
+ end
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muni
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-21 00:00:00.000000000 Z
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: mash
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: xml-simple
32
16
  requirement: !ruby/object:Gem::Requirement
@@ -169,6 +153,7 @@ files:
169
153
  - muni.gemspec
170
154
  - spec/cassettes/Muni_Route.yml
171
155
  - spec/cassettes/Muni_Stop.yml
156
+ - spec/direction_spec.rb
172
157
  - spec/route_spec.rb
173
158
  - spec/spec_helper.rb
174
159
  - spec/stop_spec.rb
@@ -199,6 +184,7 @@ summary: NextBus San Francisco Muni API Client
199
184
  test_files:
200
185
  - spec/cassettes/Muni_Route.yml
201
186
  - spec/cassettes/Muni_Stop.yml
187
+ - spec/direction_spec.rb
202
188
  - spec/route_spec.rb
203
189
  - spec/spec_helper.rb
204
190
  - spec/stop_spec.rb