games_release_dates 0.1.3 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 056d80e6c744d84350904a7919ec442a16b1e0a8
4
- data.tar.gz: bed699bf76558565ae2d30d8588ff30af6601705
3
+ metadata.gz: c57a652e37427e60ad8ec43a6adfe56eb041ef0d
4
+ data.tar.gz: a4a018d67082d075eff36a35f1281d4dfb6dbf99
5
5
  SHA512:
6
- metadata.gz: 6eafa1aacfe2e8e2c6206016cc61598e8653d63e845418c4bdcaea6c513e3f359bb75eb3cfc940e2f54de3c6610b07a9a0aadfcf0c27d92715bbd4507bd50cc6
7
- data.tar.gz: 482f4c4b3f45bccaa0b92bb1f4b5f84f6ee35a3594ec2f0b68ca59235bd8d72a72551ab5ae5a7d52adac3d521484316a07c49e4fff43bb785f5b3ddf0899ad63
6
+ metadata.gz: 81386a4bb3967a868230ebd08b663e3faee02bd1f9f3d52fd62240f45a9bbe6387243858def1baa2ee95db29ce44ed411cc650b06f67745299ae5fd4a20a178a
7
+ data.tar.gz: d0ec06049cc95621dddc7f60447ce02ce8711c0c9b6f04f23d4c8a8da8afcd1258d848174764a608d67b561d55b8af649ede75ec5014ba40e124cea56dd09633
Binary file
Binary file
@@ -35,7 +35,7 @@ class GamesReleaseDates::CLI
35
35
  February June October
36
36
  March July November
37
37
  April August December
38
- ---------------------------------------------------
38
+ -----------------------------------------------------------
39
39
  eos
40
40
  month_input = gets.strip.upcase
41
41
 
@@ -47,12 +47,70 @@ class GamesReleaseDates::CLI
47
47
  end
48
48
 
49
49
  def list_releases(month, system)
50
+ @release_dates = []
51
+ overview_input = nil
52
+
50
53
  puts <<~eos
51
54
  *** #{month} - #{system} ***
52
- ---------------------------------------------------
55
+ -----------------------------------------------------------
53
56
  eos
54
57
  @release_list.each do |games|
55
- puts games if games.include?("#{system}") && games.include?("– #{month}")
58
+ @release_dates << games if games.include?("#{system}") && games.include?("– #{month}")
59
+ end
60
+
61
+ @release_dates.each_with_index do |game, index|
62
+ puts "#{index+1}. #{game}"
63
+ end
64
+
65
+ puts "Would you like to learn more? (Y/N)"
66
+ learn_input = gets.strip
67
+ if learn_input == "Y" || learn_input == "y"
68
+ learn_more(system)
69
+ elsif learn_input == "N" || learn_input == "n"
70
+ puts "Would you like to search for another month? (Y/N)"
71
+ another_month_input = gets.strip
72
+ if another_month_input == "Y" || another_month_input == "y"
73
+ months(system)
74
+ else
75
+ puts "Thank you! Have a nice day!"
76
+ end
77
+ end
78
+ end
79
+
80
+ def learn_more(system)
81
+ puts <<~eos
82
+ -----------------------------------------------------------
83
+ Please enter the number of the game you would like to learn more about:
84
+ eos
85
+ overview_input = gets.to_i
86
+
87
+ if overview_input <= @release_dates.length && overview_input > 0
88
+
89
+ game_name = @release_dates[overview_input-1].gsub(/\([^\(]+/,"")
90
+ overview = GamesReleaseDates::Scraper.new.game_overview(game_name)
91
+
92
+ puts <<~eos
93
+ *** #{game_name} - #{system} ***
94
+ -----------------------------------------------------------
95
+ #{overview}
96
+ -----------------------------------------------------------
97
+ Would you like to search for another game? (Y/N)
98
+ eos
99
+ another_game_input = gets.strip
100
+
101
+ if another_game_input == "Y" || another_game_input == "y"
102
+ learn_more(system)
103
+ else
104
+ puts "Would you like to search for another month? (Y/N)"
105
+ another_month_input = gets.strip
106
+ if another_month_input == "Y" || another_month_input == "y"
107
+ months(system)
108
+ else
109
+ puts "Thank you! Have a nice day!"
110
+ end
111
+ end
112
+ else
113
+ learn_more
56
114
  end
57
115
  end
58
116
  end
@@ -10,4 +10,12 @@ class GamesReleaseDates::Scraper
10
10
  end
11
11
  videogames
12
12
  end
13
+
14
+ def get_game(name)
15
+ Nokogiri::HTML(open("http://thegamesdb.net/api/GetGame.php?name=#{name}"))
16
+ end
17
+
18
+ def game_overview(name)
19
+ self.get_game(name).at_css("overview").text
20
+ end
13
21
  end
@@ -1,3 +1,3 @@
1
1
  module GamesReleaseDates
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: games_release_dates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alice Balbuena
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,6 +83,8 @@ files:
83
83
  - bin/games-release-dates
84
84
  - bin/setup
85
85
  - games_release_dates-0.1.0.gem
86
+ - games_release_dates-0.1.2.gem
87
+ - games_release_dates-0.1.3.gem
86
88
  - games_release_dates.gemspec
87
89
  - lib/games_release_dates.rb
88
90
  - lib/games_release_dates/cli.rb