roadtrip_adventures 0.1.0 → 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
  SHA256:
3
- metadata.gz: 23599a87823ebfd6afe87a5ef3466c2a9e511f92ff909ce0d008a9c434e361f6
4
- data.tar.gz: d0f24f055df21bf576c5c2ae992268c1590559e79e01ffc9a3298bf6151c7d5b
3
+ metadata.gz: 5fe1ac3fdfbe908a3967ffcc6bdccddcbbd815ea01af5a9ebd997c11c390ab7d
4
+ data.tar.gz: 6f51ae2ef130e41e4b81b42bb261497ed08ff29713ba0c80ec60c572d8745f43
5
5
  SHA512:
6
- metadata.gz: 75cdf1fcc65b8b6674d10da3dc938afb1c57a25a727453d2249f50a4f04919af7efb431f88a72ec75301fadae2da83218cdbe9a360b76ae75bf65d85ade721ca
7
- data.tar.gz: b66f6f8abf5a0d7bf52c0ee9ec48be119d779e7d4138d661dc94e4cda55405c020b64eb593218cd1f03309b811997efc99ce55bbabcb46cde2d8c6918943b0e3
6
+ metadata.gz: 2975512d02b4dd42b23485843cbca269b109979ebb6efe468e26327f7eaefab6972050dbd0e2ee33caf8592528f3f36fa4ca05ea8a07587a7ee0616963cd0981
7
+ data.tar.gz: 6ea95d4479e31b55ce3b5b84281607d059ebf73195afb8ba105a87ac5b4220b5e89a1c7d7b82e11faadc3b4eeb1c79c6653025f94b1fe44327aaa55640b65d8e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roadtrip_adventures (0.1.0)
4
+ roadtrip_adventures (0.2.0)
5
5
  colorize
6
6
  nokogiri
7
7
 
@@ -4,6 +4,7 @@ class RoadtripAdventures::CLI
4
4
  welcome
5
5
  RoadtripAdventures::Scraper.scrape_destinations
6
6
  list_destinations
7
+ select_destination
7
8
  end
8
9
 
9
10
  def welcome
@@ -12,33 +13,32 @@ class RoadtripAdventures::CLI
12
13
 
13
14
  def list_destinations
14
15
  puts "**********DESTINATIONS**********\n".colorize(:blue)
15
- destination_arr = RoadtripAdventures::Destination.all
16
- puts destination_arr.map.with_index{|destination, index| "\t#{index+1}. #{destination.name}"}
16
+ @destination_arr = RoadtripAdventures::Destination.all
17
+ puts @destination_arr.map.with_index{|destination, index| "\t#{index+1}. #{destination.name}"}
17
18
  puts "\n********************************".colorize(:blue)
18
19
  puts "Select a destination from 1-10:".colorize(:yellow)
19
20
  puts "********************************".colorize(:blue)
20
- select_destination(destination_arr)
21
21
  end
22
22
 
23
- def select_destination(destination_arr)
23
+ def select_destination
24
24
  input = nil
25
25
 
26
26
  while input != 'exit'
27
- input = gets.to_i
28
-
29
- if input > 0 && input < 11
30
- destination_name = destination_arr[input-1].name.strip
31
- destination_url = destination_arr[input-1].url
32
- # puts "\nHere are the top 6 adventures for #{destination_name}\n".colorize(:yellow)
27
+ input = gets.strip
28
+ if input.to_i > 0 && input.to_i < 11
29
+ destination_name = @destination_arr[input.to_i-1].name.strip
30
+ destination_url = @destination_arr[input.to_i-1].url
33
31
  puts "******************** ".colorize(:blue) + "#{destination_name.upcase} ADVENTURES".colorize(:yellow) + " ********************\n".colorize(:blue)
34
32
  list_adventures(destination_name)
35
33
  puts "**********************************************************".colorize(:blue)
36
- else
34
+ elsif input != 'exit'
37
35
  puts "You've made an invalid choice! Make a selection from 1-10 or 'exit' to leave".colorize(:light_blue)
36
+ list_destinations
38
37
  input = gets.strip
38
+
39
39
  end
40
40
  end
41
- goodbye if input == "exit"
41
+ goodbye
42
42
  end
43
43
 
44
44
  def list_adventures(destination_name)
@@ -1,3 +1,3 @@
1
1
  module RoadtripAdventures
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadtrip_adventures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Stone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-04 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,6 +124,7 @@ files:
124
124
  - lib/roadtrip_adventures/destination.rb
125
125
  - lib/roadtrip_adventures/scraper.rb
126
126
  - lib/roadtrip_adventures/version.rb
127
+ - roadtrip_adventures-0.1.0.gem
127
128
  - roadtrip_adventures.gemspec
128
129
  homepage: https://github.com/jstone18/roadtrip-adventures-gem
129
130
  licenses: