septa_stop_locator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 59e75dddb1ad8f86f9326474073a3976afe8e230
4
+ data.tar.gz: 169d5009400f364a9a108c04ca58fde5845fce27
5
+ SHA512:
6
+ metadata.gz: 63212c67d1c8fd215807350b8d8f4186282873d8e42e270fb3bbea12ce7e50706df595b8fc4a102e4b0c749418530d081b295010154ec629fb2cf08d818510e7
7
+ data.tar.gz: 5cb187a75faadb57ff51352cf935ba8fa8cc4a2a258a4421ebe46d1c4512e56ac3b4e31e287a44d64a1bd81066a55ee902b885b4ea0befee6c973e7404320b8d
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - '2.1.2'
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in septa_stop_locator.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Mike Ball
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ [![Build Status](https://travis-ci.org/mdb/septa_stop_locator.svg?branch=master)](https://travis-ci.org/mdb/septa_stop_locator)
2
+
3
+ # SeptaStopLocator
4
+
5
+ Get the SEPTA stops closest to a lat/long point for a given bus/trolley route.
6
+
7
+ SeptaStopLocator leverages the SEPTA stops API.
8
+
9
+ ## Usage
10
+
11
+ ``` ruby
12
+ require 'septa_stop_locator'
13
+
14
+ SeptaStopLocator.find(39.9539910, -75.1682170, 34)
15
+
16
+ => [{"lng"=>-75.165345,
17
+ "lat"=>39.952672,
18
+ "stopid"=>20659,
19
+ "stopname"=>"15th St Trolley Station",
20
+ "distance"=>935.6262555741262},
21
+ {"lng"=>-75.165369,
22
+ "lat"=>39.952502,
23
+ "stopid"=>31140,
24
+ "stopname"=>"15th St Trolley Station",
25
+ "distance"=>963.389584130993}]
26
+ ```
27
+
28
+ ## About the stops returned
29
+
30
+ One stop is typically an inbound stop, while the other is typically an outbound stop.
31
+
32
+ The stops returned can be used to query the SEPTA Bus/trolley schedules API:
33
+
34
+ ```
35
+ http://www3.septa.org/hackathon/BusSchedules/?req1=<STOP ID>&req2=<ROUTE ID>
36
+ ```
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
9
+ rescue LoadError
10
+ end
@@ -0,0 +1,19 @@
1
+ require 'json'
2
+
3
+ module SeptaStopLocator
4
+ class Route
5
+ def initialize(route)
6
+ @uri = URI.parse("http://www3.septa.org/hackathon/Stops/#{route}")
7
+ end
8
+
9
+ def stops
10
+ @stops ||= JSON.parse(get_stops)
11
+ end
12
+
13
+ private
14
+
15
+ def get_stops
16
+ Net::HTTP.get(@uri)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module SeptaStopLocator
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,19 @@
1
+ require 'septa_stop_locator/version'
2
+ require 'septa_stop_locator/route'
3
+ require 'haversine'
4
+
5
+ module SeptaStopLocator
6
+ def self.find(lat, long, route)
7
+ stops = SeptaStopLocator::Route.new(route).stops
8
+
9
+ stop_one = stops.each { |stop|
10
+ stop['distance'] = Haversine.distance(lat, long, stop['lat'], stop['lng']).to_feet
11
+ }.min_by { |stop| stop['distance'] }
12
+
13
+ stop_two = stops.find { |stop|
14
+ (stop['stopname'] == stop_one['stopname']) && (stop['stopid'] != stop_one['stopid'])
15
+ }
16
+
17
+ [stop_one, stop_two].compact
18
+ end
19
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'septa_stop_locator/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'septa_stop_locator'
8
+ spec.version = SeptaStopLocator::VERSION
9
+ spec.authors = ['Mike Ball']
10
+ spec.email = ['mikedball@gmail.com']
11
+ spec.summary = %q{Get the SEPTA stops closest to a lat/long point for a given bus/trolley route.}
12
+ spec.description = %q{Get the SEPTA stops closest to a lat/long point for a given bus/trolley route.}
13
+ spec.homepage = 'http://github.com/mdb/septa_stop_locator'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'haversine', '0.3.0'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.6'
24
+ spec.add_development_dependency 'rake', '10.4.2'
25
+ spec.add_development_dependency 'rspec', '3.2.0'
26
+ spec.add_development_dependency 'vcr', '2.9.3'
27
+ spec.add_development_dependency 'webmock', '1.20.4'
28
+ end
@@ -0,0 +1,105 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www3.septa.org/hackathon/Stops/34
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - www3.septa.org
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 07 Apr 2015 18:22:03 GMT
25
+ Server:
26
+ - Apache
27
+ Content-Length:
28
+ - '5597'
29
+ Connection:
30
+ - close
31
+ Content-Type:
32
+ - application/json
33
+ X-B-Srvr:
34
+ - API4
35
+ X-Gw-Rp:
36
+ - '3'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '[{"lng":-75.162559,"lat":39.952532,"stopid":283,"stopname":"13th St
40
+ Trolley Station"},{"lng":-75.203333,"lat":39.949595,"stopid":301,"stopname":"40th
41
+ St Trolley Portal"},{"lng":-75.246245,"lat":39.917304,"stopid":304,"stopname":"Woodland
42
+ Av &amp; Island Av"},{"lng":-75.246343,"lat":39.943811,"stopid":599,"stopname":"Baltimore
43
+ Av &amp; 61st St Angora Loop"},{"lng":-75.221404,"lat":39.948101,"stopid":600,"stopname":"Baltimore
44
+ Av &amp; 49th St"},{"lng":-75.221109,"lat":39.948261,"stopid":601,"stopname":"Baltimore
45
+ Av &amp; 49th St"},{"lng":-75.241732,"lat":39.914335,"stopid":610,"stopname":"Elmwood
46
+ Av &amp; 73rd St"},{"lng":-75.1897,"lat":39.954773,"stopid":20642,"stopname":"33rd
47
+ St Trolley Station"},{"lng":-75.1835,"lat":39.954815,"stopid":20643,"stopname":"30th
48
+ St Trolley Station"},{"lng":-75.176736,"lat":39.953962,"stopid":20645,"stopname":"22nd
49
+ St Trolley Station"},{"lng":-75.171637,"lat":39.953327,"stopid":20646,"stopname":"19th
50
+ St Trolley Station"},{"lng":-75.189676,"lat":39.95488,"stopid":20658,"stopname":"33rd
51
+ St Trolley Station"},{"lng":-75.165345,"lat":39.952672,"stopid":20659,"stopname":"15th
52
+ St Trolley Station"},{"lng":-75.171483,"lat":39.953425,"stopid":20660,"stopname":"19th
53
+ St Trolley Station"},{"lng":-75.176571,"lat":39.954051,"stopid":20661,"stopname":"22nd
54
+ St Trolley Station"},{"lng":-75.183169,"lat":39.954894,"stopid":20662,"stopname":"30th
55
+ St Trolley Station"},{"lng":-75.213907,"lat":39.939886,"stopid":20725,"stopname":"Woodland
56
+ Av &amp; 50th St"},{"lng":-75.197247,"lat":39.950914,"stopid":20731,"stopname":"37th
57
+ St Trolley Station"},{"lng":-75.194533,"lat":39.953854,"stopid":20732,"stopname":"36th
58
+ St Trolley Station"},{"lng":-75.19471,"lat":39.953872,"stopid":20733,"stopname":"36th
59
+ St Trolley Station"},{"lng":-75.197306,"lat":39.951048,"stopid":20734,"stopname":"37th
60
+ St Trolley Station"},{"lng":-75.203345,"lat":39.949533,"stopid":20804,"stopname":"40th
61
+ St Trolley Portal"},{"lng":-75.244429,"lat":39.944299,"stopid":20859,"stopname":"Baltimore
62
+ Av &amp; 60th St"},{"lng":-75.241805,"lat":39.945232,"stopid":20860,"stopname":"Baltimore
63
+ Av &amp; 59th St"},{"lng":-75.240304,"lat":39.945783,"stopid":20861,"stopname":"Baltimore
64
+ Av &amp; 58th St"},{"lng":-75.237327,"lat":39.946386,"stopid":20862,"stopname":"Baltimore
65
+ Av &amp; 57th St"},{"lng":-75.235602,"lat":39.946785,"stopid":20863,"stopname":"Baltimore
66
+ Av &amp; 56th St"},{"lng":-75.233746,"lat":39.947246,"stopid":20864,"stopname":"Baltimore
67
+ Av &amp; 55th St"},{"lng":-75.231466,"lat":39.947742,"stopid":20865,"stopname":"Baltimore
68
+ Av &amp; 54th St"},{"lng":-75.229612,"lat":39.947766,"stopid":20866,"stopname":"Baltimore
69
+ Av &amp; 53rd St"},{"lng":-75.22751,"lat":39.947727,"stopid":20867,"stopname":"Baltimore
70
+ Av &amp; 52nd St"},{"lng":-75.225456,"lat":39.947715,"stopid":20868,"stopname":"Baltimore
71
+ Av &amp; 51st St"},{"lng":-75.223377,"lat":39.947872,"stopid":20869,"stopname":"Baltimore
72
+ Av &amp; 50th St"},{"lng":-75.21929,"lat":39.948329,"stopid":20870,"stopname":"Baltimore
73
+ Av &amp; 48th St"},{"lng":-75.217188,"lat":39.94854,"stopid":20871,"stopname":"Baltimore
74
+ Av &amp; 47th St"},{"lng":-75.215061,"lat":39.948786,"stopid":20872,"stopname":"Baltimore
75
+ Av &amp; 46th St"},{"lng":-75.213018,"lat":39.949006,"stopid":20873,"stopname":"Baltimore
76
+ Av &amp; 45th St"},{"lng":-75.21127,"lat":39.949181,"stopid":20874,"stopname":"Baltimore
77
+ Av &amp; 44th St"},{"lng":-75.20932,"lat":39.949481,"stopid":20875,"stopname":"Baltimore
78
+ Av &amp; 43rd St"},{"lng":-75.207265,"lat":39.949736,"stopid":20876,"stopname":"Baltimore
79
+ Av &amp; 42nd St"},{"lng":-75.205859,"lat":39.949761,"stopid":20877,"stopname":"Baltimore
80
+ Av &amp; 41st St"},{"lng":-75.205658,"lat":39.949885,"stopid":20878,"stopname":"Baltimore
81
+ Av &amp; 41st St"},{"lng":-75.207005,"lat":39.949852,"stopid":20879,"stopname":"Baltimore
82
+ Av &amp; 42nd St"},{"lng":-75.209154,"lat":39.949641,"stopid":20880,"stopname":"Baltimore
83
+ Av &amp; 43rd St"},{"lng":-75.211092,"lat":39.949332,"stopid":20881,"stopname":"Baltimore
84
+ Av &amp; 44th St"},{"lng":-75.212828,"lat":39.949148,"stopid":20882,"stopname":"Baltimore
85
+ Av &amp; 45th St"},{"lng":-75.214884,"lat":39.948937,"stopid":20883,"stopname":"Baltimore
86
+ Av &amp; 46th St"},{"lng":-75.21701,"lat":39.948691,"stopid":20884,"stopname":"Baltimore
87
+ Av &amp; 47th St"},{"lng":-75.219101,"lat":39.948472,"stopid":20885,"stopname":"Baltimore
88
+ Av &amp; 48th St"},{"lng":-75.223199,"lat":39.948041,"stopid":20886,"stopname":"Baltimore
89
+ Av &amp; 50th St"},{"lng":-75.225266,"lat":39.94783,"stopid":20887,"stopname":"Baltimore
90
+ Av &amp; 51st St"},{"lng":-75.227309,"lat":39.947842,"stopid":20888,"stopname":"Baltimore
91
+ Av &amp; 52nd St"},{"lng":-75.229317,"lat":39.947846,"stopid":20889,"stopname":"Baltimore
92
+ Av &amp; 53rd St"},{"lng":-75.231111,"lat":39.947866,"stopid":20890,"stopname":"Baltimore
93
+ Av &amp; 54th St"},{"lng":-75.233522,"lat":39.947442,"stopid":20891,"stopname":"Baltimore
94
+ Av &amp; 55th St"},{"lng":-75.235519,"lat":39.946936,"stopid":20892,"stopname":"Baltimore
95
+ Av &amp; 56th St"},{"lng":-75.237763,"lat":39.946431,"stopid":20893,"stopname":"Baltimore
96
+ Av &amp; 57th St"},{"lng":-75.240221,"lat":39.945926,"stopid":20894,"stopname":"Baltimore
97
+ Av &amp; 58th St"},{"lng":-75.241698,"lat":39.945411,"stopid":20895,"stopname":"Baltimore
98
+ Av &amp; 59th St"},{"lng":-75.244322,"lat":39.944468,"stopid":20896,"stopname":"Baltimore
99
+ Av &amp; 60th St"},{"lng":-75.212429,"lat":39.940794,"stopid":20957,"stopname":"49th
100
+ St &amp; Woodland Av"},{"lng":-75.202021,"lat":39.957259,"stopid":21248,"stopname":"40th
101
+ St &amp; Market St"},{"lng":-75.165369,"lat":39.952502,"stopid":31140,"stopname":"15th
102
+ St Trolley Station"}]'
103
+ http_version:
104
+ recorded_at: Tue, 07 Apr 2015 18:22:08 GMT
105
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,105 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www3.septa.org/hackathon/Stops/34
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - www3.septa.org
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 07 Apr 2015 18:21:08 GMT
25
+ Server:
26
+ - Apache
27
+ Content-Length:
28
+ - '5597'
29
+ Connection:
30
+ - close
31
+ Content-Type:
32
+ - application/json
33
+ X-B-Srvr:
34
+ - API4
35
+ X-Gw-Rp:
36
+ - '3'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '[{"lng":-75.162559,"lat":39.952532,"stopid":283,"stopname":"13th St
40
+ Trolley Station"},{"lng":-75.203333,"lat":39.949595,"stopid":301,"stopname":"40th
41
+ St Trolley Portal"},{"lng":-75.246245,"lat":39.917304,"stopid":304,"stopname":"Woodland
42
+ Av &amp; Island Av"},{"lng":-75.246343,"lat":39.943811,"stopid":599,"stopname":"Baltimore
43
+ Av &amp; 61st St Angora Loop"},{"lng":-75.221404,"lat":39.948101,"stopid":600,"stopname":"Baltimore
44
+ Av &amp; 49th St"},{"lng":-75.221109,"lat":39.948261,"stopid":601,"stopname":"Baltimore
45
+ Av &amp; 49th St"},{"lng":-75.241732,"lat":39.914335,"stopid":610,"stopname":"Elmwood
46
+ Av &amp; 73rd St"},{"lng":-75.1897,"lat":39.954773,"stopid":20642,"stopname":"33rd
47
+ St Trolley Station"},{"lng":-75.1835,"lat":39.954815,"stopid":20643,"stopname":"30th
48
+ St Trolley Station"},{"lng":-75.176736,"lat":39.953962,"stopid":20645,"stopname":"22nd
49
+ St Trolley Station"},{"lng":-75.171637,"lat":39.953327,"stopid":20646,"stopname":"19th
50
+ St Trolley Station"},{"lng":-75.189676,"lat":39.95488,"stopid":20658,"stopname":"33rd
51
+ St Trolley Station"},{"lng":-75.165345,"lat":39.952672,"stopid":20659,"stopname":"15th
52
+ St Trolley Station"},{"lng":-75.171483,"lat":39.953425,"stopid":20660,"stopname":"19th
53
+ St Trolley Station"},{"lng":-75.176571,"lat":39.954051,"stopid":20661,"stopname":"22nd
54
+ St Trolley Station"},{"lng":-75.183169,"lat":39.954894,"stopid":20662,"stopname":"30th
55
+ St Trolley Station"},{"lng":-75.213907,"lat":39.939886,"stopid":20725,"stopname":"Woodland
56
+ Av &amp; 50th St"},{"lng":-75.197247,"lat":39.950914,"stopid":20731,"stopname":"37th
57
+ St Trolley Station"},{"lng":-75.194533,"lat":39.953854,"stopid":20732,"stopname":"36th
58
+ St Trolley Station"},{"lng":-75.19471,"lat":39.953872,"stopid":20733,"stopname":"36th
59
+ St Trolley Station"},{"lng":-75.197306,"lat":39.951048,"stopid":20734,"stopname":"37th
60
+ St Trolley Station"},{"lng":-75.203345,"lat":39.949533,"stopid":20804,"stopname":"40th
61
+ St Trolley Portal"},{"lng":-75.244429,"lat":39.944299,"stopid":20859,"stopname":"Baltimore
62
+ Av &amp; 60th St"},{"lng":-75.241805,"lat":39.945232,"stopid":20860,"stopname":"Baltimore
63
+ Av &amp; 59th St"},{"lng":-75.240304,"lat":39.945783,"stopid":20861,"stopname":"Baltimore
64
+ Av &amp; 58th St"},{"lng":-75.237327,"lat":39.946386,"stopid":20862,"stopname":"Baltimore
65
+ Av &amp; 57th St"},{"lng":-75.235602,"lat":39.946785,"stopid":20863,"stopname":"Baltimore
66
+ Av &amp; 56th St"},{"lng":-75.233746,"lat":39.947246,"stopid":20864,"stopname":"Baltimore
67
+ Av &amp; 55th St"},{"lng":-75.231466,"lat":39.947742,"stopid":20865,"stopname":"Baltimore
68
+ Av &amp; 54th St"},{"lng":-75.229612,"lat":39.947766,"stopid":20866,"stopname":"Baltimore
69
+ Av &amp; 53rd St"},{"lng":-75.22751,"lat":39.947727,"stopid":20867,"stopname":"Baltimore
70
+ Av &amp; 52nd St"},{"lng":-75.225456,"lat":39.947715,"stopid":20868,"stopname":"Baltimore
71
+ Av &amp; 51st St"},{"lng":-75.223377,"lat":39.947872,"stopid":20869,"stopname":"Baltimore
72
+ Av &amp; 50th St"},{"lng":-75.21929,"lat":39.948329,"stopid":20870,"stopname":"Baltimore
73
+ Av &amp; 48th St"},{"lng":-75.217188,"lat":39.94854,"stopid":20871,"stopname":"Baltimore
74
+ Av &amp; 47th St"},{"lng":-75.215061,"lat":39.948786,"stopid":20872,"stopname":"Baltimore
75
+ Av &amp; 46th St"},{"lng":-75.213018,"lat":39.949006,"stopid":20873,"stopname":"Baltimore
76
+ Av &amp; 45th St"},{"lng":-75.21127,"lat":39.949181,"stopid":20874,"stopname":"Baltimore
77
+ Av &amp; 44th St"},{"lng":-75.20932,"lat":39.949481,"stopid":20875,"stopname":"Baltimore
78
+ Av &amp; 43rd St"},{"lng":-75.207265,"lat":39.949736,"stopid":20876,"stopname":"Baltimore
79
+ Av &amp; 42nd St"},{"lng":-75.205859,"lat":39.949761,"stopid":20877,"stopname":"Baltimore
80
+ Av &amp; 41st St"},{"lng":-75.205658,"lat":39.949885,"stopid":20878,"stopname":"Baltimore
81
+ Av &amp; 41st St"},{"lng":-75.207005,"lat":39.949852,"stopid":20879,"stopname":"Baltimore
82
+ Av &amp; 42nd St"},{"lng":-75.209154,"lat":39.949641,"stopid":20880,"stopname":"Baltimore
83
+ Av &amp; 43rd St"},{"lng":-75.211092,"lat":39.949332,"stopid":20881,"stopname":"Baltimore
84
+ Av &amp; 44th St"},{"lng":-75.212828,"lat":39.949148,"stopid":20882,"stopname":"Baltimore
85
+ Av &amp; 45th St"},{"lng":-75.214884,"lat":39.948937,"stopid":20883,"stopname":"Baltimore
86
+ Av &amp; 46th St"},{"lng":-75.21701,"lat":39.948691,"stopid":20884,"stopname":"Baltimore
87
+ Av &amp; 47th St"},{"lng":-75.219101,"lat":39.948472,"stopid":20885,"stopname":"Baltimore
88
+ Av &amp; 48th St"},{"lng":-75.223199,"lat":39.948041,"stopid":20886,"stopname":"Baltimore
89
+ Av &amp; 50th St"},{"lng":-75.225266,"lat":39.94783,"stopid":20887,"stopname":"Baltimore
90
+ Av &amp; 51st St"},{"lng":-75.227309,"lat":39.947842,"stopid":20888,"stopname":"Baltimore
91
+ Av &amp; 52nd St"},{"lng":-75.229317,"lat":39.947846,"stopid":20889,"stopname":"Baltimore
92
+ Av &amp; 53rd St"},{"lng":-75.231111,"lat":39.947866,"stopid":20890,"stopname":"Baltimore
93
+ Av &amp; 54th St"},{"lng":-75.233522,"lat":39.947442,"stopid":20891,"stopname":"Baltimore
94
+ Av &amp; 55th St"},{"lng":-75.235519,"lat":39.946936,"stopid":20892,"stopname":"Baltimore
95
+ Av &amp; 56th St"},{"lng":-75.237763,"lat":39.946431,"stopid":20893,"stopname":"Baltimore
96
+ Av &amp; 57th St"},{"lng":-75.240221,"lat":39.945926,"stopid":20894,"stopname":"Baltimore
97
+ Av &amp; 58th St"},{"lng":-75.241698,"lat":39.945411,"stopid":20895,"stopname":"Baltimore
98
+ Av &amp; 59th St"},{"lng":-75.244322,"lat":39.944468,"stopid":20896,"stopname":"Baltimore
99
+ Av &amp; 60th St"},{"lng":-75.212429,"lat":39.940794,"stopid":20957,"stopname":"49th
100
+ St &amp; Woodland Av"},{"lng":-75.202021,"lat":39.957259,"stopid":21248,"stopname":"40th
101
+ St &amp; Market St"},{"lng":-75.165369,"lat":39.952502,"stopid":31140,"stopname":"15th
102
+ St Trolley Station"}]'
103
+ http_version:
104
+ recorded_at: Tue, 07 Apr 2015 18:21:13 GMT
105
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,207 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www3.septa.org/hackathon/Stops/34
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - www3.septa.org
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 07 Apr 2015 18:23:28 GMT
25
+ Server:
26
+ - Apache
27
+ Content-Length:
28
+ - '5597'
29
+ Connection:
30
+ - close
31
+ Content-Type:
32
+ - application/json
33
+ X-B-Srvr:
34
+ - API2
35
+ X-Gw-Rp:
36
+ - '3'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '[{"lng":-75.162559,"lat":39.952532,"stopid":283,"stopname":"13th St
40
+ Trolley Station"},{"lng":-75.203333,"lat":39.949595,"stopid":301,"stopname":"40th
41
+ St Trolley Portal"},{"lng":-75.246245,"lat":39.917304,"stopid":304,"stopname":"Woodland
42
+ Av &amp; Island Av"},{"lng":-75.246343,"lat":39.943811,"stopid":599,"stopname":"Baltimore
43
+ Av &amp; 61st St Angora Loop"},{"lng":-75.221404,"lat":39.948101,"stopid":600,"stopname":"Baltimore
44
+ Av &amp; 49th St"},{"lng":-75.221109,"lat":39.948261,"stopid":601,"stopname":"Baltimore
45
+ Av &amp; 49th St"},{"lng":-75.241732,"lat":39.914335,"stopid":610,"stopname":"Elmwood
46
+ Av &amp; 73rd St"},{"lng":-75.1897,"lat":39.954773,"stopid":20642,"stopname":"33rd
47
+ St Trolley Station"},{"lng":-75.1835,"lat":39.954815,"stopid":20643,"stopname":"30th
48
+ St Trolley Station"},{"lng":-75.176736,"lat":39.953962,"stopid":20645,"stopname":"22nd
49
+ St Trolley Station"},{"lng":-75.171637,"lat":39.953327,"stopid":20646,"stopname":"19th
50
+ St Trolley Station"},{"lng":-75.189676,"lat":39.95488,"stopid":20658,"stopname":"33rd
51
+ St Trolley Station"},{"lng":-75.165345,"lat":39.952672,"stopid":20659,"stopname":"15th
52
+ St Trolley Station"},{"lng":-75.171483,"lat":39.953425,"stopid":20660,"stopname":"19th
53
+ St Trolley Station"},{"lng":-75.176571,"lat":39.954051,"stopid":20661,"stopname":"22nd
54
+ St Trolley Station"},{"lng":-75.183169,"lat":39.954894,"stopid":20662,"stopname":"30th
55
+ St Trolley Station"},{"lng":-75.213907,"lat":39.939886,"stopid":20725,"stopname":"Woodland
56
+ Av &amp; 50th St"},{"lng":-75.197247,"lat":39.950914,"stopid":20731,"stopname":"37th
57
+ St Trolley Station"},{"lng":-75.194533,"lat":39.953854,"stopid":20732,"stopname":"36th
58
+ St Trolley Station"},{"lng":-75.19471,"lat":39.953872,"stopid":20733,"stopname":"36th
59
+ St Trolley Station"},{"lng":-75.197306,"lat":39.951048,"stopid":20734,"stopname":"37th
60
+ St Trolley Station"},{"lng":-75.203345,"lat":39.949533,"stopid":20804,"stopname":"40th
61
+ St Trolley Portal"},{"lng":-75.244429,"lat":39.944299,"stopid":20859,"stopname":"Baltimore
62
+ Av &amp; 60th St"},{"lng":-75.241805,"lat":39.945232,"stopid":20860,"stopname":"Baltimore
63
+ Av &amp; 59th St"},{"lng":-75.240304,"lat":39.945783,"stopid":20861,"stopname":"Baltimore
64
+ Av &amp; 58th St"},{"lng":-75.237327,"lat":39.946386,"stopid":20862,"stopname":"Baltimore
65
+ Av &amp; 57th St"},{"lng":-75.235602,"lat":39.946785,"stopid":20863,"stopname":"Baltimore
66
+ Av &amp; 56th St"},{"lng":-75.233746,"lat":39.947246,"stopid":20864,"stopname":"Baltimore
67
+ Av &amp; 55th St"},{"lng":-75.231466,"lat":39.947742,"stopid":20865,"stopname":"Baltimore
68
+ Av &amp; 54th St"},{"lng":-75.229612,"lat":39.947766,"stopid":20866,"stopname":"Baltimore
69
+ Av &amp; 53rd St"},{"lng":-75.22751,"lat":39.947727,"stopid":20867,"stopname":"Baltimore
70
+ Av &amp; 52nd St"},{"lng":-75.225456,"lat":39.947715,"stopid":20868,"stopname":"Baltimore
71
+ Av &amp; 51st St"},{"lng":-75.223377,"lat":39.947872,"stopid":20869,"stopname":"Baltimore
72
+ Av &amp; 50th St"},{"lng":-75.21929,"lat":39.948329,"stopid":20870,"stopname":"Baltimore
73
+ Av &amp; 48th St"},{"lng":-75.217188,"lat":39.94854,"stopid":20871,"stopname":"Baltimore
74
+ Av &amp; 47th St"},{"lng":-75.215061,"lat":39.948786,"stopid":20872,"stopname":"Baltimore
75
+ Av &amp; 46th St"},{"lng":-75.213018,"lat":39.949006,"stopid":20873,"stopname":"Baltimore
76
+ Av &amp; 45th St"},{"lng":-75.21127,"lat":39.949181,"stopid":20874,"stopname":"Baltimore
77
+ Av &amp; 44th St"},{"lng":-75.20932,"lat":39.949481,"stopid":20875,"stopname":"Baltimore
78
+ Av &amp; 43rd St"},{"lng":-75.207265,"lat":39.949736,"stopid":20876,"stopname":"Baltimore
79
+ Av &amp; 42nd St"},{"lng":-75.205859,"lat":39.949761,"stopid":20877,"stopname":"Baltimore
80
+ Av &amp; 41st St"},{"lng":-75.205658,"lat":39.949885,"stopid":20878,"stopname":"Baltimore
81
+ Av &amp; 41st St"},{"lng":-75.207005,"lat":39.949852,"stopid":20879,"stopname":"Baltimore
82
+ Av &amp; 42nd St"},{"lng":-75.209154,"lat":39.949641,"stopid":20880,"stopname":"Baltimore
83
+ Av &amp; 43rd St"},{"lng":-75.211092,"lat":39.949332,"stopid":20881,"stopname":"Baltimore
84
+ Av &amp; 44th St"},{"lng":-75.212828,"lat":39.949148,"stopid":20882,"stopname":"Baltimore
85
+ Av &amp; 45th St"},{"lng":-75.214884,"lat":39.948937,"stopid":20883,"stopname":"Baltimore
86
+ Av &amp; 46th St"},{"lng":-75.21701,"lat":39.948691,"stopid":20884,"stopname":"Baltimore
87
+ Av &amp; 47th St"},{"lng":-75.219101,"lat":39.948472,"stopid":20885,"stopname":"Baltimore
88
+ Av &amp; 48th St"},{"lng":-75.223199,"lat":39.948041,"stopid":20886,"stopname":"Baltimore
89
+ Av &amp; 50th St"},{"lng":-75.225266,"lat":39.94783,"stopid":20887,"stopname":"Baltimore
90
+ Av &amp; 51st St"},{"lng":-75.227309,"lat":39.947842,"stopid":20888,"stopname":"Baltimore
91
+ Av &amp; 52nd St"},{"lng":-75.229317,"lat":39.947846,"stopid":20889,"stopname":"Baltimore
92
+ Av &amp; 53rd St"},{"lng":-75.231111,"lat":39.947866,"stopid":20890,"stopname":"Baltimore
93
+ Av &amp; 54th St"},{"lng":-75.233522,"lat":39.947442,"stopid":20891,"stopname":"Baltimore
94
+ Av &amp; 55th St"},{"lng":-75.235519,"lat":39.946936,"stopid":20892,"stopname":"Baltimore
95
+ Av &amp; 56th St"},{"lng":-75.237763,"lat":39.946431,"stopid":20893,"stopname":"Baltimore
96
+ Av &amp; 57th St"},{"lng":-75.240221,"lat":39.945926,"stopid":20894,"stopname":"Baltimore
97
+ Av &amp; 58th St"},{"lng":-75.241698,"lat":39.945411,"stopid":20895,"stopname":"Baltimore
98
+ Av &amp; 59th St"},{"lng":-75.244322,"lat":39.944468,"stopid":20896,"stopname":"Baltimore
99
+ Av &amp; 60th St"},{"lng":-75.212429,"lat":39.940794,"stopid":20957,"stopname":"49th
100
+ St &amp; Woodland Av"},{"lng":-75.202021,"lat":39.957259,"stopid":21248,"stopname":"40th
101
+ St &amp; Market St"},{"lng":-75.165369,"lat":39.952502,"stopid":31140,"stopname":"15th
102
+ St Trolley Station"}]'
103
+ http_version:
104
+ recorded_at: Tue, 07 Apr 2015 18:23:33 GMT
105
+ - request:
106
+ method: get
107
+ uri: http://www3.septa.org/hackathon/Stops/34
108
+ body:
109
+ encoding: US-ASCII
110
+ string: ''
111
+ headers:
112
+ Accept-Encoding:
113
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
114
+ Accept:
115
+ - "*/*"
116
+ User-Agent:
117
+ - Ruby
118
+ Host:
119
+ - www3.septa.org
120
+ response:
121
+ status:
122
+ code: 200
123
+ message: OK
124
+ headers:
125
+ Date:
126
+ - Tue, 07 Apr 2015 18:23:28 GMT
127
+ Server:
128
+ - Apache
129
+ Content-Length:
130
+ - '5597'
131
+ Connection:
132
+ - close
133
+ Content-Type:
134
+ - application/json
135
+ X-B-Srvr:
136
+ - API4
137
+ X-Gw-Rp:
138
+ - '3'
139
+ body:
140
+ encoding: UTF-8
141
+ string: '[{"lng":-75.162559,"lat":39.952532,"stopid":283,"stopname":"13th St
142
+ Trolley Station"},{"lng":-75.203333,"lat":39.949595,"stopid":301,"stopname":"40th
143
+ St Trolley Portal"},{"lng":-75.246245,"lat":39.917304,"stopid":304,"stopname":"Woodland
144
+ Av &amp; Island Av"},{"lng":-75.246343,"lat":39.943811,"stopid":599,"stopname":"Baltimore
145
+ Av &amp; 61st St Angora Loop"},{"lng":-75.221404,"lat":39.948101,"stopid":600,"stopname":"Baltimore
146
+ Av &amp; 49th St"},{"lng":-75.221109,"lat":39.948261,"stopid":601,"stopname":"Baltimore
147
+ Av &amp; 49th St"},{"lng":-75.241732,"lat":39.914335,"stopid":610,"stopname":"Elmwood
148
+ Av &amp; 73rd St"},{"lng":-75.1897,"lat":39.954773,"stopid":20642,"stopname":"33rd
149
+ St Trolley Station"},{"lng":-75.1835,"lat":39.954815,"stopid":20643,"stopname":"30th
150
+ St Trolley Station"},{"lng":-75.176736,"lat":39.953962,"stopid":20645,"stopname":"22nd
151
+ St Trolley Station"},{"lng":-75.171637,"lat":39.953327,"stopid":20646,"stopname":"19th
152
+ St Trolley Station"},{"lng":-75.189676,"lat":39.95488,"stopid":20658,"stopname":"33rd
153
+ St Trolley Station"},{"lng":-75.165345,"lat":39.952672,"stopid":20659,"stopname":"15th
154
+ St Trolley Station"},{"lng":-75.171483,"lat":39.953425,"stopid":20660,"stopname":"19th
155
+ St Trolley Station"},{"lng":-75.176571,"lat":39.954051,"stopid":20661,"stopname":"22nd
156
+ St Trolley Station"},{"lng":-75.183169,"lat":39.954894,"stopid":20662,"stopname":"30th
157
+ St Trolley Station"},{"lng":-75.213907,"lat":39.939886,"stopid":20725,"stopname":"Woodland
158
+ Av &amp; 50th St"},{"lng":-75.197247,"lat":39.950914,"stopid":20731,"stopname":"37th
159
+ St Trolley Station"},{"lng":-75.194533,"lat":39.953854,"stopid":20732,"stopname":"36th
160
+ St Trolley Station"},{"lng":-75.19471,"lat":39.953872,"stopid":20733,"stopname":"36th
161
+ St Trolley Station"},{"lng":-75.197306,"lat":39.951048,"stopid":20734,"stopname":"37th
162
+ St Trolley Station"},{"lng":-75.203345,"lat":39.949533,"stopid":20804,"stopname":"40th
163
+ St Trolley Portal"},{"lng":-75.244429,"lat":39.944299,"stopid":20859,"stopname":"Baltimore
164
+ Av &amp; 60th St"},{"lng":-75.241805,"lat":39.945232,"stopid":20860,"stopname":"Baltimore
165
+ Av &amp; 59th St"},{"lng":-75.240304,"lat":39.945783,"stopid":20861,"stopname":"Baltimore
166
+ Av &amp; 58th St"},{"lng":-75.237327,"lat":39.946386,"stopid":20862,"stopname":"Baltimore
167
+ Av &amp; 57th St"},{"lng":-75.235602,"lat":39.946785,"stopid":20863,"stopname":"Baltimore
168
+ Av &amp; 56th St"},{"lng":-75.233746,"lat":39.947246,"stopid":20864,"stopname":"Baltimore
169
+ Av &amp; 55th St"},{"lng":-75.231466,"lat":39.947742,"stopid":20865,"stopname":"Baltimore
170
+ Av &amp; 54th St"},{"lng":-75.229612,"lat":39.947766,"stopid":20866,"stopname":"Baltimore
171
+ Av &amp; 53rd St"},{"lng":-75.22751,"lat":39.947727,"stopid":20867,"stopname":"Baltimore
172
+ Av &amp; 52nd St"},{"lng":-75.225456,"lat":39.947715,"stopid":20868,"stopname":"Baltimore
173
+ Av &amp; 51st St"},{"lng":-75.223377,"lat":39.947872,"stopid":20869,"stopname":"Baltimore
174
+ Av &amp; 50th St"},{"lng":-75.21929,"lat":39.948329,"stopid":20870,"stopname":"Baltimore
175
+ Av &amp; 48th St"},{"lng":-75.217188,"lat":39.94854,"stopid":20871,"stopname":"Baltimore
176
+ Av &amp; 47th St"},{"lng":-75.215061,"lat":39.948786,"stopid":20872,"stopname":"Baltimore
177
+ Av &amp; 46th St"},{"lng":-75.213018,"lat":39.949006,"stopid":20873,"stopname":"Baltimore
178
+ Av &amp; 45th St"},{"lng":-75.21127,"lat":39.949181,"stopid":20874,"stopname":"Baltimore
179
+ Av &amp; 44th St"},{"lng":-75.20932,"lat":39.949481,"stopid":20875,"stopname":"Baltimore
180
+ Av &amp; 43rd St"},{"lng":-75.207265,"lat":39.949736,"stopid":20876,"stopname":"Baltimore
181
+ Av &amp; 42nd St"},{"lng":-75.205859,"lat":39.949761,"stopid":20877,"stopname":"Baltimore
182
+ Av &amp; 41st St"},{"lng":-75.205658,"lat":39.949885,"stopid":20878,"stopname":"Baltimore
183
+ Av &amp; 41st St"},{"lng":-75.207005,"lat":39.949852,"stopid":20879,"stopname":"Baltimore
184
+ Av &amp; 42nd St"},{"lng":-75.209154,"lat":39.949641,"stopid":20880,"stopname":"Baltimore
185
+ Av &amp; 43rd St"},{"lng":-75.211092,"lat":39.949332,"stopid":20881,"stopname":"Baltimore
186
+ Av &amp; 44th St"},{"lng":-75.212828,"lat":39.949148,"stopid":20882,"stopname":"Baltimore
187
+ Av &amp; 45th St"},{"lng":-75.214884,"lat":39.948937,"stopid":20883,"stopname":"Baltimore
188
+ Av &amp; 46th St"},{"lng":-75.21701,"lat":39.948691,"stopid":20884,"stopname":"Baltimore
189
+ Av &amp; 47th St"},{"lng":-75.219101,"lat":39.948472,"stopid":20885,"stopname":"Baltimore
190
+ Av &amp; 48th St"},{"lng":-75.223199,"lat":39.948041,"stopid":20886,"stopname":"Baltimore
191
+ Av &amp; 50th St"},{"lng":-75.225266,"lat":39.94783,"stopid":20887,"stopname":"Baltimore
192
+ Av &amp; 51st St"},{"lng":-75.227309,"lat":39.947842,"stopid":20888,"stopname":"Baltimore
193
+ Av &amp; 52nd St"},{"lng":-75.229317,"lat":39.947846,"stopid":20889,"stopname":"Baltimore
194
+ Av &amp; 53rd St"},{"lng":-75.231111,"lat":39.947866,"stopid":20890,"stopname":"Baltimore
195
+ Av &amp; 54th St"},{"lng":-75.233522,"lat":39.947442,"stopid":20891,"stopname":"Baltimore
196
+ Av &amp; 55th St"},{"lng":-75.235519,"lat":39.946936,"stopid":20892,"stopname":"Baltimore
197
+ Av &amp; 56th St"},{"lng":-75.237763,"lat":39.946431,"stopid":20893,"stopname":"Baltimore
198
+ Av &amp; 57th St"},{"lng":-75.240221,"lat":39.945926,"stopid":20894,"stopname":"Baltimore
199
+ Av &amp; 58th St"},{"lng":-75.241698,"lat":39.945411,"stopid":20895,"stopname":"Baltimore
200
+ Av &amp; 59th St"},{"lng":-75.244322,"lat":39.944468,"stopid":20896,"stopname":"Baltimore
201
+ Av &amp; 60th St"},{"lng":-75.212429,"lat":39.940794,"stopid":20957,"stopname":"49th
202
+ St &amp; Woodland Av"},{"lng":-75.202021,"lat":39.957259,"stopid":21248,"stopname":"40th
203
+ St &amp; Market St"},{"lng":-75.165369,"lat":39.952502,"stopid":31140,"stopname":"15th
204
+ St Trolley Station"}]'
205
+ http_version:
206
+ recorded_at: Tue, 07 Apr 2015 18:23:33 GMT
207
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe SeptaStopLocator::Route do
4
+ describe '#stops', vcr: { cassette_name: 'route' } do
5
+ before :each do
6
+ @route = SeptaStopLocator::Route.new(34)
7
+ end
8
+
9
+ it 'returns an array of the stops for a route' do
10
+ expect(@route.stops.class).to eq Array
11
+ end
12
+
13
+ context 'a stop hash in the stops array' do
14
+ before :each do
15
+ @stop = @route.stops[0]
16
+ end
17
+
18
+ it 'has a lng' do
19
+ expect(@stop['lng']).to eq -75.162559
20
+ end
21
+
22
+ it 'has a lat' do
23
+ expect(@stop['lat']).to eq 39.952532
24
+ end
25
+
26
+ it 'has a stopid' do
27
+ expect(@stop['stopid']).to eq 283
28
+ end
29
+
30
+ it 'has a stopname' do
31
+ expect(@stop['stopname']).to eq '13th St Trolley Station'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+
3
+ describe SeptaStopLocator do
4
+ describe '.find', vcr: { cassette_name: 'stop_locator' } do
5
+ before :each do
6
+ @stops = SeptaStopLocator.find(39.9539910, -75.1682170, 34)
7
+ end
8
+
9
+ it 'returns an array of the two closest stop ids' do
10
+ expect(@stops.length).to eq 2
11
+ end
12
+
13
+ context 'the keys each route contains' do
14
+ before do
15
+ @first = @stops[0]
16
+ end
17
+
18
+ it 'returns the closest SEPTA stop for a route and a point' do
19
+ expect(@first['stopname']).to eq '15th St Trolley Station'
20
+ end
21
+
22
+ it 'has a distance' do
23
+ # Travis.ci thinks 935.6262555741263; laptop thinks 935.6262555741262
24
+ approx_distance = @first['distance'].round(12)
25
+
26
+ expect(approx_distance).to eq 935.626255574126
27
+ end
28
+
29
+ it 'has a lat' do
30
+ expect(@first['lat']).to eq 39.952672
31
+ end
32
+
33
+ it 'has a lng' do
34
+ expect(@first['lng']).to eq -75.165345
35
+ end
36
+
37
+ it 'has a stopid' do
38
+ expect(@first['stopid']).to eq 20659
39
+ end
40
+ end
41
+
42
+ context 'when the lat/lng coordinates are just east of 13th Street Station', vcr: { cassette_name: 'stop_locator_east' } do
43
+ before :each do
44
+ @stops = SeptaStopLocator.find(39.9533884, -75.1591538, 34)
45
+ end
46
+
47
+ it 'only returns the westbound stop' do
48
+ expect(@stops.length).to eq 1
49
+ end
50
+
51
+ it 'returns the correct stop name' do
52
+ expect(@stops[0]['stopname']).to eq '13th St Trolley Station'
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,11 @@
1
+ require 'bundler/setup'
2
+
3
+ Bundler.require(:development)
4
+
5
+ require 'septa_stop_locator'
6
+
7
+ VCR.configure do |c|
8
+ c.cassette_library_dir = 'spec/cassettes'
9
+ c.configure_rspec_metadata!
10
+ c.hook_into :webmock
11
+ end
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: septa_stop_locator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mike Ball
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: haversine
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 10.4.2
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 10.4.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 3.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: vcr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 2.9.3
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.9.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 1.20.4
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 1.20.4
97
+ description: Get the SEPTA stops closest to a lat/long point for a given bus/trolley
98
+ route.
99
+ email:
100
+ - mikedball@gmail.com
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - lib/septa_stop_locator.rb
112
+ - lib/septa_stop_locator/route.rb
113
+ - lib/septa_stop_locator/version.rb
114
+ - septa_stop_locator.gemspec
115
+ - spec/cassettes/route.yml
116
+ - spec/cassettes/stop_locator.yml
117
+ - spec/cassettes/stop_locator_east.yml
118
+ - spec/septa_stop_locator/route_spec.rb
119
+ - spec/septa_stop_locator_spec.rb
120
+ - spec/spec_helper.rb
121
+ homepage: http://github.com/mdb/septa_stop_locator
122
+ licenses:
123
+ - MIT
124
+ metadata: {}
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubyforge_project:
141
+ rubygems_version: 2.4.8
142
+ signing_key:
143
+ specification_version: 4
144
+ summary: Get the SEPTA stops closest to a lat/long point for a given bus/trolley route.
145
+ test_files:
146
+ - spec/cassettes/route.yml
147
+ - spec/cassettes/stop_locator.yml
148
+ - spec/cassettes/stop_locator_east.yml
149
+ - spec/septa_stop_locator/route_spec.rb
150
+ - spec/septa_stop_locator_spec.rb
151
+ - spec/spec_helper.rb