nyt_journeys_cli_gem 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nyt_journeys +1 -1
- data/lib/nyt_journeys/command_line_interface.rb +32 -30
- data/lib/nyt_journeys/version.rb +1 -1
- data/nyt_journeys_cli_gem-0.3.0.gem +0 -0
- data/nyt_journeys_cli_gem-0.4.0.gem +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256f5f34251426476bb67823a6329c3192c4fdd7
|
4
|
+
data.tar.gz: 8e547f3a745f67c6ccbbd5d985516a27fdf638c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a4f5581d831b6496fb6602d35ac0b81f0fefa04012ae3318cde9343d73a103e0ba2af7fc94c71a7a4c8453531d9f3d4aceda7a25b2e7616b7512a82b9a69d57
|
7
|
+
data.tar.gz: efcd3bd20e60a5242af8b8f22c2df6dfafee349c4c5d53960bb7ebbed10c2939cdd2db631d121cbddd916582c6ab46b50b0f4b589c9a5a22d38a81c825d8e49f
|
data/bin/nyt_journeys
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
class NytJourneys::CommandLineInterface
|
2
|
+
attr_accessor :input
|
3
|
+
|
2
4
|
def call
|
3
5
|
NytJourneys::Data_Generator.new.make_journeys
|
6
|
+
greeting
|
4
7
|
start
|
5
8
|
end
|
6
9
|
|
@@ -29,14 +32,14 @@ class NytJourneys::CommandLineInterface
|
|
29
32
|
puts ""
|
30
33
|
puts "Enter 'types' to see journey categories."
|
31
34
|
puts "Enter 'exit' to end the program."
|
32
|
-
input = gets.downcase.strip
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
35
|
+
self.input = gets.downcase.strip
|
36
|
+
if self.input == "types"
|
37
|
+
navigate_types
|
38
|
+
elsif self.input.to_i > 0
|
39
|
+
if journey = NytJourneys::Journeys.find(self.input.to_i)
|
40
|
+
print_journey(journey)
|
39
41
|
end
|
42
|
+
end
|
40
43
|
end
|
41
44
|
|
42
45
|
def print_journey(journey)
|
@@ -75,15 +78,15 @@ class NytJourneys::CommandLineInterface
|
|
75
78
|
puts ""
|
76
79
|
puts "Enter 'list' to see all journeys."
|
77
80
|
puts "Enter 'exit' to end the program."
|
78
|
-
input = gets.downcase.strip
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
end
|
81
|
+
self.input = gets.downcase.strip
|
82
|
+
if self.input == "list"
|
83
|
+
navigate_journeys
|
84
|
+
elsif self.input.to_i > 0
|
85
|
+
if category = NytJourneys::Journeys.types[self.input.to_i - 1]
|
86
|
+
print_category(category)
|
87
|
+
navigate_category(category)
|
86
88
|
end
|
89
|
+
end
|
87
90
|
end
|
88
91
|
|
89
92
|
def print_category(category)
|
@@ -103,31 +106,30 @@ class NytJourneys::CommandLineInterface
|
|
103
106
|
puts "Enter 'list' to see all journeys."
|
104
107
|
puts "Enter 'types' to see journey categories."
|
105
108
|
puts "Enter 'exit' to end the program."
|
106
|
-
input = gets.downcase.strip
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
end
|
109
|
+
self.input = gets.downcase.strip
|
110
|
+
if self.input == "list"
|
111
|
+
navigate_journeys
|
112
|
+
elsif self.input == "types"
|
113
|
+
navigate_types
|
114
|
+
elsif self.input.to_i > 0
|
115
|
+
if journey = NytJourneys::Journeys.find_by_type(category)[self.input.to_i - 1]
|
116
|
+
print_journey(journey)
|
115
117
|
end
|
118
|
+
end
|
116
119
|
end
|
117
120
|
|
118
121
|
def start
|
119
|
-
|
120
|
-
input
|
121
|
-
while input != "exit"
|
122
|
+
self.input = nil
|
123
|
+
while self.input != "exit"
|
122
124
|
puts ""
|
123
125
|
puts "Enter 'list' to see all journeys."
|
124
126
|
puts "Enter 'types' to see journey categories."
|
125
127
|
puts "Enter 'exit' to end the program."
|
126
128
|
puts ""
|
127
|
-
input = gets.downcase.strip
|
128
|
-
if input == "list"
|
129
|
+
self.input = gets.downcase.strip
|
130
|
+
if self.input == "list"
|
129
131
|
navigate_journeys
|
130
|
-
elsif input == "types"
|
132
|
+
elsif self.input == "types"
|
131
133
|
navigate_types
|
132
134
|
end
|
133
135
|
end
|
data/lib/nyt_journeys/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyt_journeys_cli_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lisamarie616
|
@@ -108,6 +108,8 @@ files:
|
|
108
108
|
- nyt_journeys.gemspec
|
109
109
|
- nyt_journeys_cli_gem-0.1.0.gem
|
110
110
|
- nyt_journeys_cli_gem-0.2.0.gem
|
111
|
+
- nyt_journeys_cli_gem-0.3.0.gem
|
112
|
+
- nyt_journeys_cli_gem-0.4.0.gem
|
111
113
|
- spec/nyt_journeys_spec.rb
|
112
114
|
- spec/spec_helper.rb
|
113
115
|
homepage: ''
|