latest_games 0.1.1 → 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/latest_games/cli.rb +32 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: defbfb5c701c1ec5d2323913f632e6a8eb61c036
4
- data.tar.gz: 0c1ab4e830a3cfeb9d2b7e2a963250d90411cb6c
3
+ metadata.gz: 8a41fe5062395e25e531dfb8b5f5acce456bbe15
4
+ data.tar.gz: 00fb11375bd3227939a5e905f61618e5974610c4
5
5
  SHA512:
6
- metadata.gz: 0b8d4fa24858022049a84a6930b698056e55dd1b622a13312a2dc7539d2d5ed987fd02e7c40eb5b35bcb7297b776c43379efb0f62f0777c6eddddfcdb2ffba07
7
- data.tar.gz: afc62cf3dc15b1943626459d013ec111885b0457b182cf43abb121914a969ff0ad3e6f084f910dd24fdcb11d5581dadf6df77a027c034214bb723119d1799ca6
6
+ metadata.gz: c387b3e86ce579c88db588438c38cb0dcf30c02f07d3a703cd707cd23c849269142df43b6195b54e9c75cf65217a07a0c9709713a6ef2949282248dc02b14978
7
+ data.tar.gz: f88051e1fa38e87e83320f736f396b5c0e886c76160c6b5b9f850c30aa08097078506c1679028695fc17cc8a9ef281b1715f89ea85fb9e2e3bf38704322cac6a
@@ -49,15 +49,11 @@ class LatestGames::CLI
49
49
  start
50
50
  end
51
51
  end
52
- puts ""
53
- puts "------------"
54
- puts "Hope you found something you like!"
55
- puts "Have a great day! :D"
52
+ end_program
56
53
  end
57
54
 
58
55
  def list_games(platform)
59
56
  input = nil
60
- until input == "exit"
61
57
  puts ""
62
58
  if platform.is_a? LatestGames::PS4Game
63
59
  puts "*************** Latest PS4 Games ***************"
@@ -70,7 +66,10 @@ class LatestGames::CLI
70
66
  puts "Select a game to get more info:"
71
67
  input = gets.strip
72
68
  game = LatestGames::PS4Game.find(input.to_i)
73
- select_game(game, "PS4")
69
+ if input != "exit"
70
+ select_game(game, "PS4")
71
+ end
72
+ end_program
74
73
 
75
74
  elsif platform.is_a? LatestGames::IOSGame
76
75
  puts "*************** Latest iOS Games ***************"
@@ -83,7 +82,10 @@ class LatestGames::CLI
83
82
  puts "Select a game to get more info:"
84
83
  input = gets.strip
85
84
  game = LatestGames::IOSGame.find(input.to_i)
86
- select_game(game, "iOS")
85
+ if input != "exit"
86
+ select_game(game, "iOS")
87
+ end
88
+ end_program
87
89
 
88
90
  elsif platform.is_a? LatestGames::XboneGame
89
91
  puts "************* Latest Xbox One Games ************"
@@ -96,7 +98,10 @@ class LatestGames::CLI
96
98
  puts "Select a game to get more info:"
97
99
  input = gets.strip
98
100
  game = LatestGames::XboneGame.find(input.to_i)
99
- select_game(game, "Xbox One")
101
+ if input != "exit"
102
+ select_game(game, "Xbox One")
103
+ end
104
+ end_program
100
105
 
101
106
  elsif platform.is_a? LatestGames::PCGame
102
107
  puts "*************** Latest PC Games ****************"
@@ -109,7 +114,10 @@ class LatestGames::CLI
109
114
  puts "Select a game to get more info:"
110
115
  input = gets.strip
111
116
  game = LatestGames::PCGame.find(input.to_i)
112
- select_game(game, "PC")
117
+ if input != "exit"
118
+ select_game(game, "PC")
119
+ end
120
+ end_program
113
121
 
114
122
  elsif platform.is_a? LatestGames::SwitchGame
115
123
  puts "************* Latest Switch Games **************"
@@ -122,10 +130,13 @@ class LatestGames::CLI
122
130
  puts "Select a game to get more info:"
123
131
  input = gets.strip
124
132
  game = LatestGames::SwitchGame.find(input.to_i)
125
- select_game(game, "Switch")
133
+ if input != "exit"
134
+ select_game(game, "Switch")
135
+ end
136
+ end_program
126
137
 
127
138
  end
128
- end
139
+ end_program
129
140
  end
130
141
 
131
142
  def select_game(game, platform)
@@ -162,6 +173,8 @@ class LatestGames::CLI
162
173
  input = gets.strip
163
174
  if input.downcase == "n" || input.downcase == "no"
164
175
  self.start
176
+ elsif input.downcase == "exit"
177
+ end_program
165
178
  end
166
179
  end
167
180
 
@@ -175,4 +188,12 @@ class LatestGames::CLI
175
188
  }
176
189
  end
177
190
 
191
+ def end_program
192
+ puts ""
193
+ puts "------------"
194
+ puts "Hope you found something you like!"
195
+ puts "Have a great day! :D"
196
+ exit
197
+ end
198
+
178
199
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latest_games
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Lucas Kisabeth'"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-04 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler