mta_status 0.0.0 → 0.0.1
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.
- checksums.yaml +4 -4
- data/lib/mta_status.rb +12 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa5a27b068038cd2d25c262d153914cd80e318dd
|
4
|
+
data.tar.gz: f736d2b94d21e3b0510d52447cf8004ac94965c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f80e00cdddc1320d0f9814e4b594f582916afce7e92ef5874b4aab2d7f2a74ead299d1af32d479b30751d1750d6f0523f56e847eca3264f78bcaad71b8d59bf
|
7
|
+
data.tar.gz: 7c8ac9d54a951cc12357a53ab58d7eac700320cb9909c8f1d7eb1a9a4180331409df2fe9b8dc41801de9131c1d918a72c25cd9acfe3337a22f58efa87b2f32fd
|
data/lib/mta_status.rb
CHANGED
@@ -9,7 +9,7 @@ class MTAStatus
|
|
9
9
|
METRO_NORTH = ["metro-north", "metro", "north"]
|
10
10
|
|
11
11
|
def initialize(service)
|
12
|
-
if service
|
12
|
+
if SUBWAY.include?(service) || LIRR.include?(service) || METRO_NORTH.include?(service)
|
13
13
|
@service = service.downcase
|
14
14
|
else
|
15
15
|
@service = "subway"
|
@@ -53,27 +53,28 @@ class MTAStatus
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def service_choice
|
56
|
-
call = []
|
57
56
|
if SUBWAY.include?(@service)
|
58
|
-
|
57
|
+
subway
|
59
58
|
elsif LIRR.include?(@service)
|
60
|
-
|
59
|
+
lirr
|
61
60
|
elsif METRO_NORTH.include?(@service)
|
62
|
-
|
61
|
+
metro_north
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
65
|
def run
|
67
66
|
puts
|
68
|
-
puts "
|
67
|
+
puts "##### Train Status ######"
|
68
|
+
puts Time.now
|
69
|
+
puts "#########################"
|
69
70
|
service_choice.each do |line_pair|
|
70
|
-
if line_pair[1]
|
71
|
-
puts "#{line_pair[0].bold}: #{line_pair[1].red}"
|
72
|
-
else
|
71
|
+
if line_pair[1]="GOOD SERVICE"
|
73
72
|
puts "#{line_pair[0]}: #{line_pair[1].green}"
|
73
|
+
else
|
74
|
+
puts "#{line_pair[0].bold}: #{line_pair[1].red}"
|
74
75
|
end
|
75
76
|
end
|
76
|
-
puts "
|
77
|
+
puts "#########################"
|
77
78
|
end
|
78
79
|
|
79
|
-
end
|
80
|
+
end
|