ratis 2.5.2.4 → 2.5.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/ratis.rb +2 -1
- data/lib/ratis/config.rb +1 -1
- data/lib/ratis/point_2_point.rb +7 -7
- data/lib/ratis/point_2_point/routes_only_response.rb +16 -0
- data/lib/ratis/point_2_point/service.rb +1 -1
- data/lib/ratis/point_2_point/stop.rb +1 -2
- data/lib/ratis/route_stops/stop.rb +4 -2
- data/lib/ratis/schedule_nearby.rb +1 -0
- data/lib/ratis/timetable.rb +7 -2
- data/lib/ratis/timetable/stop.rb +3 -1
- data/lib/ratis/timetable/trip.rb +3 -1
- data/lib/ratis/version.rb +1 -1
- metadata +8 -6
data/README.md
CHANGED
@@ -92,7 +92,7 @@ Development
|
|
92
92
|
ssh -i ~/.ssh/authoritylabs.pem -L 8080:localhost:3128 ubuntu@codingsanctum.com
|
93
93
|
|
94
94
|
1. Run the test suite with `rake`
|
95
|
-
1. Test it out with `irb -
|
95
|
+
1. Test it out with `irb -I lib/ -r rubygems -r ratis`
|
96
96
|
|
97
97
|
### Extending
|
98
98
|
|
data/lib/ratis.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'savon'
|
2
2
|
|
3
|
+
require 'ratis/closest_stop'
|
3
4
|
require 'ratis/config'
|
4
5
|
require 'ratis/core_ext'
|
5
|
-
require 'ratis/closest_stop'
|
6
6
|
require 'ratis/errors'
|
7
7
|
require 'ratis/itinerary'
|
8
8
|
require 'ratis/landmark'
|
@@ -11,6 +11,7 @@ require 'ratis/location'
|
|
11
11
|
require 'ratis/next_bus'
|
12
12
|
require 'ratis/point_2_point'
|
13
13
|
require 'ratis/point_2_point/group'
|
14
|
+
require 'ratis/point_2_point/routes_only_response'
|
14
15
|
require 'ratis/point_2_point/service'
|
15
16
|
require 'ratis/point_2_point/standard_response'
|
16
17
|
require 'ratis/point_2_point/stop'
|
data/lib/ratis/config.rb
CHANGED
data/lib/ratis/point_2_point.rb
CHANGED
@@ -44,13 +44,13 @@ module Ratis
|
|
44
44
|
|
45
45
|
def self.parse_routes_only_yes(response)
|
46
46
|
response.to_array(:point2point_response, :routes, :service).map do |service|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
47
|
+
Point2Point::RoutesOnlyResponse.new({
|
48
|
+
:route => service[:route],
|
49
|
+
:direction => service[:direction],
|
50
|
+
:service_type => service[:servicetype],
|
51
|
+
:signage => service[:signage],
|
52
|
+
:route_type => service[:routetype]
|
53
|
+
})
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Ratis
|
2
|
+
|
3
|
+
class Point2Point::RoutesOnlyResponse
|
4
|
+
|
5
|
+
VALID_ATTRS = [:route, :direction, :service_type, :signage, :route_type]
|
6
|
+
VALID_ATTRS.each { |attr| attr_accessor attr }
|
7
|
+
|
8
|
+
def initialize(attrs = {})
|
9
|
+
VALID_ATTRS.each do |attr|
|
10
|
+
instance_variable_set "@#{attr.to_s}", attrs[attr] || attrs[attr.to_s]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Ratis
|
2
2
|
|
3
|
-
class Point2Point::Stop < Struct.new(:description, :atis_stop_id, :latitude, :longitude,
|
4
|
-
:walk_dist, :walk_dir, :walk_hint)
|
3
|
+
class Point2Point::Stop < Struct.new(:description, :atis_stop_id, :latitude, :longitude, :walk_dist, :walk_dir, :walk_hint)
|
5
4
|
|
6
5
|
end
|
7
6
|
|
@@ -1,4 +1,6 @@
|
|
1
1
|
module Ratis
|
2
|
-
|
2
|
+
|
3
|
+
class RouteStops::Stop < Struct.new(:description, :area, :stop_id, :atis_stop_id, :point, :alpha_seq, :stop_seq, :latitude, :longitude)
|
3
4
|
end
|
4
|
-
|
5
|
+
|
6
|
+
end
|
data/lib/ratis/timetable.rb
CHANGED
@@ -28,8 +28,13 @@ module Ratis
|
|
28
28
|
timetable.service_type = headway[:servicetype]
|
29
29
|
timetable.operator = headway[:operator]
|
30
30
|
timetable.effective = headway[:effective]
|
31
|
-
|
32
|
-
|
31
|
+
|
32
|
+
stop = headway[:timepoints][:stop]
|
33
|
+
timetable.timepoints = [ Timetable::Stop.new(stop[:atisstopid], stop[:stopid], stop[:description], stop[:area]) ]
|
34
|
+
|
35
|
+
trip = headway[:times][:trip]
|
36
|
+
timetable.trips = [ Timetable::Trip.new(trip[:time], trip[:comment]) ]
|
37
|
+
|
33
38
|
timetable
|
34
39
|
end
|
35
40
|
|
data/lib/ratis/timetable/stop.rb
CHANGED
data/lib/ratis/timetable/trip.rb
CHANGED
data/lib/ratis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 69
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 5
|
9
9
|
- 2
|
10
|
-
-
|
11
|
-
version: 2.5.2.
|
10
|
+
- 5
|
11
|
+
version: 2.5.2.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- AuthorityLabs
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2013-01-16 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: savon
|
@@ -24,12 +24,13 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - <
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
hash: 3
|
30
30
|
segments:
|
31
|
+
- 2
|
31
32
|
- 0
|
32
|
-
version: "0"
|
33
|
+
version: "2.0"
|
33
34
|
type: :runtime
|
34
35
|
version_requirements: *id001
|
35
36
|
- !ruby/object:Gem::Dependency
|
@@ -165,6 +166,7 @@ files:
|
|
165
166
|
- lib/ratis/location.rb
|
166
167
|
- lib/ratis/next_bus.rb
|
167
168
|
- lib/ratis/point_2_point/group.rb
|
169
|
+
- lib/ratis/point_2_point/routes_only_response.rb
|
168
170
|
- lib/ratis/point_2_point/service.rb
|
169
171
|
- lib/ratis/point_2_point/standard_response.rb
|
170
172
|
- lib/ratis/point_2_point/stop.rb
|