national-parks 0.1.5
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +41 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/national-parks +8 -0
- data/bin/setup +8 -0
- data/lib/national_parks.rb +7 -0
- data/lib/national_parks/CLI.rb +108 -0
- data/lib/national_parks/park.rb +40 -0
- data/lib/national_parks/state.rb +32 -0
- data/lib/national_parks/version.rb +3 -0
- data/national_parks.gemspec +38 -0
- data/notes.md +30 -0
- data/sandbox +11 -0
- data/spec.md +6 -0
- metadata +137 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 840c57c5e7632027655b30e4d05b67ea670ab9846e16806ef154c1624251e96d
|
|
4
|
+
data.tar.gz: 4f18556e0550688bfbc1177e862654aaa7e67a48ad7b2f08079a277876733256
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fd7fce833b81c41d18a572e08cd516bffb3e5872fab9a786024a07df3fa60683471b714f2a9847b4fa829e3da3eb83ecc6e86d2b49088d1110dd274d0647eeca
|
|
7
|
+
data.tar.gz: da6fb59f10c6a7d063b4486d6a95d7ae8e1390f58ef29124ac5c0836bba3776da4939189c78fda8b0bf0f5d430287b47f842f59822f413f412d9d7d3e934fe62
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at brennan@heislercreative.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
national-parks (0.1.5)
|
|
5
|
+
colorize
|
|
6
|
+
nokogiri
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
colorize (0.8.1)
|
|
12
|
+
diff-lcs (1.3)
|
|
13
|
+
mini_portile2 (2.3.0)
|
|
14
|
+
nokogiri (1.8.2)
|
|
15
|
+
mini_portile2 (~> 2.3.0)
|
|
16
|
+
rake (10.4.2)
|
|
17
|
+
rspec (3.7.0)
|
|
18
|
+
rspec-core (~> 3.7.0)
|
|
19
|
+
rspec-expectations (~> 3.7.0)
|
|
20
|
+
rspec-mocks (~> 3.7.0)
|
|
21
|
+
rspec-core (3.7.1)
|
|
22
|
+
rspec-support (~> 3.7.0)
|
|
23
|
+
rspec-expectations (3.7.0)
|
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
25
|
+
rspec-support (~> 3.7.0)
|
|
26
|
+
rspec-mocks (3.7.0)
|
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
28
|
+
rspec-support (~> 3.7.0)
|
|
29
|
+
rspec-support (3.7.1)
|
|
30
|
+
|
|
31
|
+
PLATFORMS
|
|
32
|
+
ruby
|
|
33
|
+
|
|
34
|
+
DEPENDENCIES
|
|
35
|
+
bundler (~> 1.16)
|
|
36
|
+
national-parks!
|
|
37
|
+
rake (~> 10.0)
|
|
38
|
+
rspec (~> 3.0)
|
|
39
|
+
|
|
40
|
+
BUNDLED WITH
|
|
41
|
+
1.16.1
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 heislercreative
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# NationalParks
|
|
2
|
+
|
|
3
|
+
This gem allows the user to access the National Park Service's "Find a Park" via a CLI and presents a complete list of US states and territories, along with their associated national parks and monuments.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'national-parks'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install national_parks
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
1) Run `national-parks`
|
|
24
|
+
2) Follow the CLI prompts:
|
|
25
|
+
|
|
26
|
+
• Select a state by its list number to view its parks and monuments
|
|
27
|
+
|
|
28
|
+
• Select a national park or monument by its list number to view its details
|
|
29
|
+
|
|
30
|
+
• Type 'states' to return to the states menu
|
|
31
|
+
|
|
32
|
+
• Type 'parks' to return to the parks menu
|
|
33
|
+
|
|
34
|
+
• Type 'exit' at any time to exit the CLI
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
39
|
+
|
|
40
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
41
|
+
|
|
42
|
+
## Contributing
|
|
43
|
+
|
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/heislercreative/national-parks-cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
49
|
+
|
|
50
|
+
## Code of Conduct
|
|
51
|
+
|
|
52
|
+
Everyone interacting in the NationalParks project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/heislercreative/national-parks-cli/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "national_parks"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/national-parks
ADDED
data/bin/setup
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# CLI Controller
|
|
2
|
+
require 'colorize'
|
|
3
|
+
|
|
4
|
+
class NationalParks::CLI
|
|
5
|
+
BASE_PATH = "https://www.nps.gov"
|
|
6
|
+
|
|
7
|
+
# Basic Run #
|
|
8
|
+
def call
|
|
9
|
+
welcome
|
|
10
|
+
NationalParks::State.scrape_states
|
|
11
|
+
list_states
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Greetings #
|
|
16
|
+
def welcome
|
|
17
|
+
puts ""
|
|
18
|
+
puts " /\\ ".colorize(:green)
|
|
19
|
+
puts " //\\\\".colorize(:green)
|
|
20
|
+
puts "Welcome to the National Park Service!" + " ||".colorize(:black)
|
|
21
|
+
sleep(1)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def goodbye
|
|
25
|
+
puts ""
|
|
26
|
+
puts " Hope to see you again soon!"
|
|
27
|
+
puts ""
|
|
28
|
+
exit
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# State Methods #
|
|
33
|
+
def list_states
|
|
34
|
+
@states = NationalParks::State.all
|
|
35
|
+
puts ""
|
|
36
|
+
@states.each.with_index(1) {|state, i| puts " #{i}. #{state.name}"}
|
|
37
|
+
state_menu
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def state_menu
|
|
41
|
+
puts "Please pick a US state or territory by number."
|
|
42
|
+
puts " - Type 'exit' to leave."
|
|
43
|
+
input = nil
|
|
44
|
+
|
|
45
|
+
while input != "exit"
|
|
46
|
+
input = gets.strip.downcase
|
|
47
|
+
|
|
48
|
+
if input.to_i > 0 && input.to_i <= @states.length
|
|
49
|
+
@state_i = input.to_i-1
|
|
50
|
+
list_parks(@state_i)
|
|
51
|
+
elsif input == "exit"
|
|
52
|
+
goodbye
|
|
53
|
+
else
|
|
54
|
+
puts "Please select a valid state or territory."
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# Park Methods #
|
|
61
|
+
def list_parks(choice)
|
|
62
|
+
@chosen_state = BASE_PATH + @states[choice].url
|
|
63
|
+
|
|
64
|
+
puts ""
|
|
65
|
+
puts "==".colorize(:green) + "#{NationalParks::Park.state_name(@chosen_state)}" + "==".colorize(:green)
|
|
66
|
+
@parks = NationalParks::Park.all(@chosen_state)
|
|
67
|
+
@parks.each.with_index(1) {|park, i| puts " #{i}. #{park.name}"}
|
|
68
|
+
park_menu
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def park_menu
|
|
72
|
+
puts "Please pick a park or monument by number for more information."
|
|
73
|
+
puts " - Type 'states' to return to the states list."
|
|
74
|
+
puts " - Type 'exit' to leave."
|
|
75
|
+
|
|
76
|
+
input = nil
|
|
77
|
+
while input != "exit"
|
|
78
|
+
input = gets.strip.downcase
|
|
79
|
+
|
|
80
|
+
if input.to_i > 0 && input.to_i <= @parks.length
|
|
81
|
+
@i = input.to_i-1
|
|
82
|
+
display_parks
|
|
83
|
+
elsif input == "parks"
|
|
84
|
+
list_parks(@state_i)
|
|
85
|
+
elsif input == "states"
|
|
86
|
+
list_states
|
|
87
|
+
elsif input == "exit"
|
|
88
|
+
goodbye
|
|
89
|
+
else
|
|
90
|
+
puts "Please select a valid park or monument."
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def display_parks
|
|
96
|
+
puts ""
|
|
97
|
+
puts "==================================================".colorize(:yellow)
|
|
98
|
+
puts ""
|
|
99
|
+
puts "#{@parks[@i].name.upcase} #{@parks[@i].type.upcase}"
|
|
100
|
+
puts "-#{@parks[@i].location}-"
|
|
101
|
+
puts "#{@parks[@i].description}"
|
|
102
|
+
puts ""
|
|
103
|
+
puts " - Type 'parks' to return to the parks list."
|
|
104
|
+
puts " - Type 'states' to return to the states list."
|
|
105
|
+
puts " - Type 'exit' to leave"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
class NationalParks::Park
|
|
2
|
+
attr_accessor :name, :type, :location, :description
|
|
3
|
+
@@all = []
|
|
4
|
+
|
|
5
|
+
def initialize(name, type, location, description)
|
|
6
|
+
@name = name
|
|
7
|
+
@type = type
|
|
8
|
+
@location = location
|
|
9
|
+
@description = description
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.state_name(state_url)
|
|
13
|
+
parks_page = Nokogiri::HTML(open(state_url)) #replace with interpolated state url
|
|
14
|
+
@state_name = parks_page.css("h1.page-title").text.upcase
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.all(state_url)
|
|
18
|
+
#Scrape state parks page and return park names, types, locations, & descriptions
|
|
19
|
+
|
|
20
|
+
self.scrape_parks(state_url)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.scrape_parks(state_url)
|
|
24
|
+
parks_page = Nokogiri::HTML(open(state_url))
|
|
25
|
+
|
|
26
|
+
park_list = parks_page.css("div.col-md-9.col-sm-9.col-xs-12.table-cell.list_left")
|
|
27
|
+
|
|
28
|
+
park_list.each do |park|
|
|
29
|
+
park_type = park.css("h2").text
|
|
30
|
+
park_name = park.css("h3").text
|
|
31
|
+
park_location = park.css("h4").text
|
|
32
|
+
park_description = park.css("p").text
|
|
33
|
+
park = self.new(name = park_name, type = park_type, location = park_location, description = park_description)
|
|
34
|
+
|
|
35
|
+
@@all.find {|p| p.name == park.name} || @@all << park
|
|
36
|
+
end
|
|
37
|
+
@@all
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
class NationalParks::State
|
|
2
|
+
attr_accessor :name, :url
|
|
3
|
+
@@states = []
|
|
4
|
+
|
|
5
|
+
def initialize(name, url)
|
|
6
|
+
@name = name
|
|
7
|
+
@url = url
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.all
|
|
11
|
+
@@states
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.scrape_states
|
|
15
|
+
#Scrape state index page and return state names & urls
|
|
16
|
+
states_page = Nokogiri::HTML(open("https://www.nps.gov/findapark/index.htm"))
|
|
17
|
+
|
|
18
|
+
state_list = states_page.css('area')
|
|
19
|
+
state_list.each do |state|
|
|
20
|
+
state_name = "#{state.attr("alt")}"
|
|
21
|
+
state_url = "#{state.attr("href")}"
|
|
22
|
+
state = self.new(name = state_name, url = state_url)
|
|
23
|
+
|
|
24
|
+
@@states << state
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
@@states.sort_by!{|s| s.name}
|
|
28
|
+
@@states.delete_at(4) #Remove duplicate Arkansas entry
|
|
29
|
+
@@states
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "national_parks/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "national-parks"
|
|
8
|
+
spec.version = NationalParks::VERSION
|
|
9
|
+
spec.authors = ["Brennan Heisler"]
|
|
10
|
+
spec.email = ["brennan@heislercreative.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{National parks}
|
|
13
|
+
spec.description = %q{National parks by state, with location & description}
|
|
14
|
+
spec.homepage = "http://heislercreative.com"
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
|
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
19
|
+
if spec.respond_to?(:metadata)
|
|
20
|
+
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
|
21
|
+
else
|
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
23
|
+
"public gem pushes."
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
|
28
|
+
end
|
|
29
|
+
spec.bindir = "bin"
|
|
30
|
+
spec.executables = ["national-parks"]
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
32
|
+
|
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
36
|
+
spec.add_dependency "nokogiri"
|
|
37
|
+
spec.add_dependency "colorize"
|
|
38
|
+
end
|
data/notes.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# National Parks CLI #
|
|
2
|
+
|
|
3
|
+
"Welcome to the National Park Service!"
|
|
4
|
+
"Please pick a US state or territory:"
|
|
5
|
+
|
|
6
|
+
-- scrape state index page --
|
|
7
|
+
1. Alabama
|
|
8
|
+
2. Alaska
|
|
9
|
+
|
|
10
|
+
- User input
|
|
11
|
+
|
|
12
|
+
"Select a park to learn more:"
|
|
13
|
+
|
|
14
|
+
-- scrape state page for names --
|
|
15
|
+
1. Park 1
|
|
16
|
+
2. Park 2
|
|
17
|
+
|
|
18
|
+
"Type 'States' to see more states and territories."
|
|
19
|
+
- User input
|
|
20
|
+
|
|
21
|
+
-- scrape state page for details --
|
|
22
|
+
|
|
23
|
+
Name (Type)
|
|
24
|
+
|
|
25
|
+
-Location
|
|
26
|
+
|
|
27
|
+
Description
|
|
28
|
+
|
|
29
|
+
"Type 'Parks' to see more parks."
|
|
30
|
+
- User input
|
data/sandbox
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Hi! 👋
|
|
2
|
+
|
|
3
|
+
You’ve opened the IDE Sandbox. 🎉
|
|
4
|
+
|
|
5
|
+
This means that you launched the IDE from a lesson that isn't a lab, and
|
|
6
|
+
while you’re in the IDE Sandbox the IDE WILL NOT save files or directories
|
|
7
|
+
created here. 💨
|
|
8
|
+
|
|
9
|
+
In other words, the “Sandbox” is just that: a temporary place to “play” with
|
|
10
|
+
code. If you want to store anything created here, be sure to back it up to a
|
|
11
|
+
repository on GitHub.
|
data/spec.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Specifications for the CLI Assessment
|
|
2
|
+
|
|
3
|
+
Specs:
|
|
4
|
+
- [x] Have a CLI for interfacing with the application --> Selects by number, navigates back to menus, and exits
|
|
5
|
+
- [x] Pull data from an external source --> Scrapes National Park Service "Find a Park" site
|
|
6
|
+
- [x] Implement both list and detail views --> Lists 2 levels (states & parks), diplays details for selected parks/monuments
|
metadata
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: national-parks
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.5
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Brennan Heisler
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-03-18 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.16'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.16'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: nokogiri
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: colorize
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
description: National parks by state, with location & description
|
|
84
|
+
email:
|
|
85
|
+
- brennan@heislercreative.com
|
|
86
|
+
executables:
|
|
87
|
+
- national-parks
|
|
88
|
+
extensions: []
|
|
89
|
+
extra_rdoc_files: []
|
|
90
|
+
files:
|
|
91
|
+
- ".gitignore"
|
|
92
|
+
- ".rspec"
|
|
93
|
+
- ".travis.yml"
|
|
94
|
+
- CODE_OF_CONDUCT.md
|
|
95
|
+
- Gemfile
|
|
96
|
+
- Gemfile.lock
|
|
97
|
+
- LICENSE.txt
|
|
98
|
+
- README.md
|
|
99
|
+
- Rakefile
|
|
100
|
+
- bin/console
|
|
101
|
+
- bin/national-parks
|
|
102
|
+
- bin/setup
|
|
103
|
+
- lib/national_parks.rb
|
|
104
|
+
- lib/national_parks/CLI.rb
|
|
105
|
+
- lib/national_parks/park.rb
|
|
106
|
+
- lib/national_parks/state.rb
|
|
107
|
+
- lib/national_parks/version.rb
|
|
108
|
+
- national_parks.gemspec
|
|
109
|
+
- notes.md
|
|
110
|
+
- sandbox
|
|
111
|
+
- spec.md
|
|
112
|
+
homepage: http://heislercreative.com
|
|
113
|
+
licenses:
|
|
114
|
+
- MIT
|
|
115
|
+
metadata:
|
|
116
|
+
allowed_push_host: https://rubygems.org
|
|
117
|
+
post_install_message:
|
|
118
|
+
rdoc_options: []
|
|
119
|
+
require_paths:
|
|
120
|
+
- lib
|
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
|
+
requirements:
|
|
123
|
+
- - ">="
|
|
124
|
+
- !ruby/object:Gem::Version
|
|
125
|
+
version: '0'
|
|
126
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0'
|
|
131
|
+
requirements: []
|
|
132
|
+
rubyforge_project:
|
|
133
|
+
rubygems_version: 2.7.6
|
|
134
|
+
signing_key:
|
|
135
|
+
specification_version: 4
|
|
136
|
+
summary: National parks
|
|
137
|
+
test_files: []
|