top_ten_islands_cli_gem 0.1.0 → 0.1.2

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: 715f554009aaaadf5ce81ec7ba63abf75c88f9c5
4
- data.tar.gz: e27594f5aca2537d2d2e6fb82979081356f2ae99
3
+ metadata.gz: aee43619489c51bc309f4ce511832eefa5bcba5c
4
+ data.tar.gz: 50ed887df39698f5715a3b69b7bd41bae339cc67
5
5
  SHA512:
6
- metadata.gz: 2a8c9ee04c20e40810097942c94bce6fb926355d12567de3f83ee2c0c5f08120cf19dca9f4c6b895d20f1f19bdf9d4fad1c46f36451e11a0f5fbbd23c85f87a2
7
- data.tar.gz: 843467016c492b877b64d947cc4d773269f360527a136b84e39ab75691a9dee03b3705ac682b1313c813259df770d74e7a2ecc53fb173357f0a93fd4407b2bdf
6
+ metadata.gz: c2006a544c9d992faee57f848d98ded0aa1b1919e5afa56626b6282247896baceca0f63750ec08aee4b33f160c0375138afed480cda8fe933190bb666b4caa9a
7
+ data.tar.gz: c64543958b550d47270f3d1e033fd48dbfeb7aa76caf293a71dd52f33751bae42fb4ee63154c0097f0e1b7f4074cf04798b45d7a9a468e68e09b818a859e2d5b
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'nokogiri'
4
- gem 'pry'
5
-
6
3
  gemspec
data/README.md CHANGED
@@ -1,28 +1,16 @@
1
- # TopTenIslandsCliGem
1
+ ## TopTenIslands
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/top_ten_islands_cli_gem`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/top_ten_islands`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
5
  TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'top_ten_islands_cli_gem'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install top_ten_islands_cli_gem
9
+ You can install this gem via `gem install top_ten_islands_cli_gem`. The `top_ten_islands_cli_gem` CLI will be installed and you can run `top_ten_islands_cli_gem` to get a list of islands to travel to in your command line.
22
10
 
23
11
  ## Usage
24
12
 
25
- TODO: Write usage instructions here
13
+ Run top_ten_islands_cli_gem after installing the gem.
26
14
 
27
15
  ## Development
28
16
 
@@ -32,10 +20,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
20
 
33
21
  ## Contributing
34
22
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/top_ten_islands_cli_gem.
23
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/top_ten_islands.
36
24
 
37
25
 
38
26
  ## License
39
27
 
40
28
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- #require "bundler/setup"
4
- #require "top_ten_islands_cli_gem"
5
- require_relative '../config/environment.rb'
3
+ require "bundler/setup"
4
+ require "top_ten_islands_cli_gem"
5
+
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
@@ -10,7 +10,5 @@ require_relative '../config/environment.rb'
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- TopTenIslandsCliGem::Cli.new.start
14
-
15
13
  require "irb"
16
14
  IRB.start
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require_relative '../config/environment.rb'
3
+ require_relative "../lib/top_ten_islands_cli_gem.rb"
4
4
 
5
- TopTenIslandsCliGem::Cli.new.start
5
+
6
+ islands = TopTenIslandsCliGem::Cli.new.start
@@ -1,4 +1,11 @@
1
- require "top_ten_islands_cli_gem/version"
1
+ require "open-uri"
2
+ require "pry"
3
+ require "nokogiri"
4
+
5
+ require_relative "top_ten_islands_cli_gem/version"
6
+ require_relative "top_ten_islands_cli_gem/scraper.rb"
7
+ require_relative "top_ten_islands_cli_gem/island.rb"
8
+ require_relative "top_ten_islands_cli_gem/cli.rb"
2
9
 
3
10
  module TopTenIslandsCliGem
4
11
  end
@@ -14,18 +14,18 @@ class TopTenIslandsCliGem::Cli
14
14
  end
15
15
 
16
16
  def discription
17
- input = 0
17
+ @input = 0
18
18
  #binding.pry
19
- until input.between?(1,10)
19
+ until @input.between?(1,10)
20
20
  puts " "
21
21
  puts "What number island would you like to read about?"
22
- input = gets.chomp.to_i
22
+ @input = gets.chomp.to_i
23
23
  end
24
24
  #binding.pry
25
25
  puts ""
26
- puts "--------#{TopTenIslandsCliGem::Island.all[input-1].name}--------"
26
+ puts "--------#{TopTenIslandsCliGem::Island.all[@input-1].name}--------"
27
27
  puts ""
28
- puts TopTenIslandsCliGem::Island.all[input-1].get_discription
28
+ puts TopTenIslandsCliGem::Island.all[@input-1].get_discription
29
29
  puts ""
30
30
  ending
31
31
  end
@@ -40,15 +40,9 @@ class TopTenIslandsCliGem::Cli
40
40
  when "y"
41
41
  discription
42
42
  when "n"
43
- puts "Have an awesome day!!"
44
- exit
43
+ puts "Hope to see you at #{TopTenIslandsCliGem::Island.all[@input-1].name} soon!!"
45
44
  end
46
45
 
47
46
  end
48
47
 
49
-
50
-
51
-
52
-
53
-
54
48
  end
@@ -11,27 +11,12 @@ class TopTenIslandsCliGem::Island
11
11
  end
12
12
 
13
13
  def get_discription
14
- @discription ||= Nokogiri::HTML(open(@url)).css(" .ermb_text").css(" .content").text.strip
14
+ @discription ||= TopTenIslandsCliGem::Scraper.get_island_discription(@url)
15
15
  end
16
16
 
17
17
  def self.all
18
18
  ALL
19
19
  end
20
20
 
21
- def discription
22
- input = ""
23
- until input > 0
24
- puts "What island would you like more information about, by number?"
25
- input = gets.chomp
26
- end
27
- TopTenIslandsCliGem::Island.all[input-1].get_discription
28
- end
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
21
 
37
22
  end
@@ -2,20 +2,16 @@ class TopTenIslandsCliGem::Scraper
2
2
 
3
3
  def self.get_page
4
4
  Nokogiri::HTML(open("https://www.tripadvisor.com/TravelersChoice-Islands"))
5
- #binding.pry
6
5
  end
7
6
 
8
7
  def self.create_islands
9
- #binding.pry
10
8
  island_array = get_page.css(" .mainName").map do |island|
11
9
  i = TopTenIslandsCliGem::Island.new(island.text.strip,"https://www.tripadvisor.com#{island.css("a").attribute("href").text}")
12
10
  end
13
11
  end
14
12
 
15
-
16
-
17
-
18
-
19
-
13
+ def self.get_island_discription(url=nil)
14
+ Nokogiri::HTML(open(url)).css(" .ermb_text").css(" .content").text.strip
15
+ end
20
16
 
21
17
  end
@@ -1,3 +1,3 @@
1
1
  module TopTenIslandsCliGem
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,27 +1,29 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'top_ten_islands_cli_gem/version'
4
+ require 'top_ten_islands/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "top_ten_islands_cli_gem"
8
- spec.version = TopTenIslandsCliGem::VERSION
8
+ spec.version = TopTenIslands::VERSION
9
9
  spec.authors = ["Sholom Steinmetz"]
10
10
  spec.email = ["sholomsteinmetz@gmail.com"]
11
11
 
12
- spec.summary = "Provides a list of the best islands in the entire world"
13
-
12
+ spec.summary = "Shows a list of the worlds top ten islands to visit"
13
+ spec.description = "Shows a list of the worlds top ten islands to go to for a vacation after a long day of coding"
14
14
  spec.homepage = "https://github.com/peacestone/top-ten-islands-cli-gem"
15
15
  spec.license = "MIT"
16
16
 
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
19
  spec.bindir = "bin"
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.executables = ["top_ten_islands_cli_gem"]
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.12"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
-
25
+ spec.add_development_dependency "nokogiri", "~> 1.6", ">= 0"
26
+ spec.add_development_dependency "pry", "~> 0.10.3"
27
+ spec.add_development_dependency "rubysl-open-uri", "~> 2.0", ">= 2.0"
26
28
 
27
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: top_ten_islands_cli_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sholom Steinmetz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-06 00:00:00.000000000 Z
11
+ date: 2016-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,10 +38,66 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
- description:
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.6'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pry
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.10.3
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 0.10.3
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubysl-open-uri
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.0'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '2.0'
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '2.0'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '2.0'
95
+ description: Shows a list of the worlds top ten islands to go to for a vacation after
96
+ a long day of coding
42
97
  email:
43
98
  - sholomsteinmetz@gmail.com
44
- executables: []
99
+ executables:
100
+ - top_ten_islands_cli_gem
45
101
  extensions: []
46
102
  extra_rdoc_files: []
47
103
  files:
@@ -53,7 +109,6 @@ files:
53
109
  - bin/console
54
110
  - bin/setup
55
111
  - bin/top_ten_islands_cli_gem
56
- - config/environment.rb
57
112
  - lib/top_ten_islands_cli_gem.rb
58
113
  - lib/top_ten_islands_cli_gem/cli.rb
59
114
  - lib/top_ten_islands_cli_gem/island.rb
@@ -84,5 +139,5 @@ rubyforge_project:
84
139
  rubygems_version: 2.6.4
85
140
  signing_key:
86
141
  specification_version: 4
87
- summary: Provides a list of the best islands in the entire world
142
+ summary: Shows a list of the worlds top ten islands to visit
88
143
  test_files: []
@@ -1,9 +0,0 @@
1
- require 'bundler'
2
- Bundler.require
3
-
4
- require 'open-uri'
5
-
6
-
7
- require_relative '../lib/top_ten_islands_cli_gem/island.rb'
8
- require_relative '../lib/top_ten_islands_cli_gem/scraper.rb'
9
- require_relative '../lib/top_ten_islands_cli_gem/cli.rb'