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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f5e0b539230cfc000eabfdaaeb0bbc851e90744
4
- data.tar.gz: 18a632770ecb22068737b0a86aad83b59ecc1625
3
+ metadata.gz: 256f5f34251426476bb67823a6329c3192c4fdd7
4
+ data.tar.gz: 8e547f3a745f67c6ccbbd5d985516a27fdf638c6
5
5
  SHA512:
6
- metadata.gz: f15b8e1d0294330c84389336c8455fc5da2496880993aee2974b12dfcdde7e8ba5b840f5b5ad473ecd55b98bcae7f6bc549cfb9963f42ffca3bf87358afaa0d3
7
- data.tar.gz: b6a4d40d3d133e7ef93855699c03977fcdd2c9ffa7544774ceb297ede25478c90fc2ec1734a7b9364ebacec3020af12cfd108dd52adfd84ac8e26b7b1f6d35b8
6
+ metadata.gz: 1a4f5581d831b6496fb6602d35ac0b81f0fefa04012ae3318cde9343d73a103e0ba2af7fc94c71a7a4c8453531d9f3d4aceda7a25b2e7616b7512a82b9a69d57
7
+ data.tar.gz: efcd3bd20e60a5242af8b8f22c2df6dfafee349c4c5d53960bb7ebbed10c2939cdd2db631d121cbddd916582c6ab46b50b0f4b589c9a5a22d38a81c825d8e49f
data/bin/nyt_journeys CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'nyt_journeys'
3
+ require './lib/nyt_journeys.rb'
4
4
 
5
5
  NytJourneys::CommandLineInterface.new.call
@@ -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
- if input == "types"
34
- navigate_types
35
- elsif input.to_i > 0
36
- if journey = NytJourneys::Journeys.find(input.to_i)
37
- print_journey(journey)
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
- if input == "list"
80
- navigate_journeys
81
- elsif input.to_i > 0
82
- if category = NytJourneys::Journeys.types[input.to_i - 1]
83
- print_category(category)
84
- navigate_category(category)
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
- if input == "list"
108
- navigate_journeys
109
- elsif input == "types"
110
- navigate_types
111
- elsif input.to_i > 0
112
- if journey = NytJourneys::Journeys.find_by_type(category)[input.to_i - 1]
113
- print_journey(journey)
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
- greeting
120
- input = nil
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
@@ -1,3 +1,3 @@
1
1
  module NytJourneys
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
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.0
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: ''