septa 1.0.0
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.
- data/lib/septa-ruby.rb +7 -0
- data/lib/septa/bus.rb +18 -0
- metadata +71 -0
data/lib/septa-ruby.rb
ADDED
data/lib/septa/bus.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'resourceful'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Septa
|
5
|
+
module Bus
|
6
|
+
def get_bus_data(bus_number)
|
7
|
+
septa_url = 'http://www3.septa.org/transitview/bus_route_data/'+bus_number.to_s
|
8
|
+
resp = Resourceful.get(septa_url)
|
9
|
+
JSON.parse(resp.body)
|
10
|
+
end
|
11
|
+
|
12
|
+
def next_to_arrive(city1, city2)
|
13
|
+
septa_url = "http://www3.septa.org/api/nta/"
|
14
|
+
resp = Resourceful.get("#{septa_url}#{city1}/#{city2}")
|
15
|
+
JSON.parse(resp.body)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: septa
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Joanne Cheng
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-12 00:00:00 -06:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: An easier way to access SEPTA (Southeastern Pennsylvania Transit Authority) data.
|
23
|
+
email:
|
24
|
+
- chengjoanne2@gmail.com
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files: []
|
30
|
+
|
31
|
+
files:
|
32
|
+
- lib/septa-ruby.rb
|
33
|
+
- lib/septa/bus.rb
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/joannecheng/septa-ruby
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 3
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 23
|
58
|
+
segments:
|
59
|
+
- 1
|
60
|
+
- 3
|
61
|
+
- 6
|
62
|
+
version: 1.3.6
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project: septa
|
66
|
+
rubygems_version: 1.6.2
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: Ruby wrapper for the septa api
|
70
|
+
test_files: []
|
71
|
+
|