nj_fishing_report 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +45 -0
- data/LICENSE.txt +21 -0
- data/NOTES.md +15 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/nj_fishing_report +4 -0
- data/bin/setup +8 -0
- data/lib/nj_fishing_report.rb +9 -0
- data/lib/nj_fishing_report/cli.rb +123 -0
- data/lib/nj_fishing_report/fishing_location.rb +20 -0
- data/lib/nj_fishing_report/fishing_report.rb +15 -0
- data/lib/nj_fishing_report/scraper.rb +48 -0
- data/lib/nj_fishing_report/version.rb +3 -0
- data/nj_fishing_report.gemspec +38 -0
- data/spec.md +16 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e356ea8f39961e1408a44ea10732a0eb3371ebb4a7aa2e713fcab52b66110696
|
4
|
+
data.tar.gz: 434bc3239956db9d331fc7d5a8625515ce2aa4686280679747b9d2cb6c157b9f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4d0d2768db32b678f15cfc7884a055ec4d7ca551d5e33860601c36687dfae319180cae1ed6e89be1f91cf2024d232682a52de83e40e2a4218c40de3147dc48c4
|
7
|
+
data.tar.gz: 2a5e531980bb798a9db8a5b242b350d629cbaf5bfc5e7c3a6fb15ef12ed31098e3c0eadb147c1fcd589385525ea34d3ca5aa89da8a6773be7950d816df15f624
|
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 <github email address>. 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,45 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
nj_fishing_report (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.2)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
method_source (0.9.0)
|
12
|
+
mini_portile2 (2.3.0)
|
13
|
+
nokogiri (1.8.2)
|
14
|
+
mini_portile2 (~> 2.3.0)
|
15
|
+
pry (0.11.3)
|
16
|
+
coderay (~> 1.1.0)
|
17
|
+
method_source (~> 0.9.0)
|
18
|
+
rake (10.5.0)
|
19
|
+
rspec (3.7.0)
|
20
|
+
rspec-core (~> 3.7.0)
|
21
|
+
rspec-expectations (~> 3.7.0)
|
22
|
+
rspec-mocks (~> 3.7.0)
|
23
|
+
rspec-core (3.7.1)
|
24
|
+
rspec-support (~> 3.7.0)
|
25
|
+
rspec-expectations (3.7.0)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.7.0)
|
28
|
+
rspec-mocks (3.7.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.7.0)
|
31
|
+
rspec-support (3.7.1)
|
32
|
+
|
33
|
+
PLATFORMS
|
34
|
+
ruby
|
35
|
+
|
36
|
+
DEPENDENCIES
|
37
|
+
bundler (~> 1.16)
|
38
|
+
nj_fishing_report!
|
39
|
+
nokogiri
|
40
|
+
pry
|
41
|
+
rake (~> 10.0)
|
42
|
+
rspec (~> 3.0)
|
43
|
+
|
44
|
+
BUNDLED WITH
|
45
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 <github username>
|
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/NOTES.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
How to build a CLI gem
|
2
|
+
|
3
|
+
1. Plan your gem, imagine your interface
|
4
|
+
2. Start with the project structure - google
|
5
|
+
3. Start with the entry point - the file run
|
6
|
+
4. Force that to build the CLI interface
|
7
|
+
5. Stub out the interface
|
8
|
+
6. Start making things real
|
9
|
+
7. Discover objects.
|
10
|
+
8. Program
|
11
|
+
|
12
|
+
- Greet user
|
13
|
+
- Present user with menu and asks for user input to choose either a list from the menu or exit
|
14
|
+
- If list, present with list and an option to choose an item from the list
|
15
|
+
- If exit, give a farewell message and quit program
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# NjFishingReport
|
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/nj_fishing_report`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'nj_fishing_report'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install nj_fishing_report
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
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.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/<github username>/nj_fishing_report. 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.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the NjFishingReport project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<github username>/nj_fishing_report/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 "nj_fishing_report"
|
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/setup
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'open-uri'
|
4
|
+
|
5
|
+
require_relative "../lib/nj_fishing_report/version"
|
6
|
+
require_relative "../lib/nj_fishing_report/cli"
|
7
|
+
require_relative "../lib/nj_fishing_report/fishing_location"
|
8
|
+
require_relative "../lib/nj_fishing_report/fishing_report"
|
9
|
+
require_relative "../lib/nj_fishing_report/scraper"
|
@@ -0,0 +1,123 @@
|
|
1
|
+
|
2
|
+
class NjFishingReport::CLI
|
3
|
+
|
4
|
+
def call
|
5
|
+
greeting
|
6
|
+
create_fishing_location_and_report
|
7
|
+
run_program_interface
|
8
|
+
end
|
9
|
+
|
10
|
+
def greeting
|
11
|
+
puts " "
|
12
|
+
puts " "
|
13
|
+
puts "Welcome to the New Jersey Fishing Report CLI"
|
14
|
+
puts " "
|
15
|
+
puts " "
|
16
|
+
puts "Loading...."
|
17
|
+
puts " "
|
18
|
+
puts " "
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_program_interface
|
22
|
+
loop do
|
23
|
+
puts "-----------------------------------------"
|
24
|
+
puts " "
|
25
|
+
puts "For a list of fishing spots, enter 'list'"
|
26
|
+
puts " "
|
27
|
+
puts "-----------------------------------------"
|
28
|
+
puts " "
|
29
|
+
puts "To quit, enter 'exit'"
|
30
|
+
puts " "
|
31
|
+
puts "-----------------------------------------"
|
32
|
+
puts " "
|
33
|
+
puts "What would you like to do?"
|
34
|
+
puts " "
|
35
|
+
puts " "
|
36
|
+
input = gets.strip.downcase
|
37
|
+
puts " "
|
38
|
+
puts " "
|
39
|
+
|
40
|
+
if input == 'exit'
|
41
|
+
goodbye
|
42
|
+
break
|
43
|
+
elsif input == 'list'
|
44
|
+
list_fishing_locations
|
45
|
+
fishing_report
|
46
|
+
else
|
47
|
+
puts "+++++++++++++++++++++++++++"
|
48
|
+
puts "+++++++++++++++++++++++++++"
|
49
|
+
puts " "
|
50
|
+
puts "Please type a valid entry"
|
51
|
+
puts " "
|
52
|
+
puts "+++++++++++++++++++++++++++"
|
53
|
+
puts "+++++++++++++++++++++++++++"
|
54
|
+
puts " "
|
55
|
+
puts " "
|
56
|
+
sleep(2)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_fishing_location_and_report
|
62
|
+
NjFishingReport::Scraper.scrape_fishing_location
|
63
|
+
NjFishingReport::Scraper.scrape_fishing_report
|
64
|
+
end
|
65
|
+
|
66
|
+
def list_fishing_locations
|
67
|
+
puts "-----------------------------------------"
|
68
|
+
puts " "
|
69
|
+
puts " "
|
70
|
+
puts "*Fishing Locations in NJ*"
|
71
|
+
puts " "
|
72
|
+
puts " "
|
73
|
+
NjFishingReport::Fishing_Location.all.each_with_index do |location, index|
|
74
|
+
puts "#{index + 1}. #{location.name}"
|
75
|
+
puts " "
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def fishing_report
|
80
|
+
puts " "
|
81
|
+
puts "Please input a number, or enter 'exit' to return to the main menu."
|
82
|
+
puts " "
|
83
|
+
puts " "
|
84
|
+
input = gets.strip.downcase
|
85
|
+
puts " "
|
86
|
+
puts " "
|
87
|
+
loop do
|
88
|
+
if input == "exit"
|
89
|
+
break
|
90
|
+
elsif input.to_i < 1 || input.to_i > NjFishingReport::Fishing_Location.all.length
|
91
|
+
puts "That is not a valid entry. Please input a number between 1 and #{NjFishingReport::Fishing_Location.all.length}, or type 'exit'"
|
92
|
+
puts " "
|
93
|
+
puts " "
|
94
|
+
input = gets.strip.downcase
|
95
|
+
else
|
96
|
+
puts "********************************"
|
97
|
+
puts "Fishing Report for #{NjFishingReport::Fishing_Location.all[input.to_i-1].name}:"
|
98
|
+
puts "********************************"
|
99
|
+
puts " "
|
100
|
+
puts NjFishingReport::Fishing_Report.all[input.to_i-1].report
|
101
|
+
puts " "
|
102
|
+
sleep(2)
|
103
|
+
break
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def goodbye
|
109
|
+
puts "-----------------------------------------"
|
110
|
+
puts " "
|
111
|
+
puts " "
|
112
|
+
puts "Happy Fishing!"
|
113
|
+
puts " "
|
114
|
+
puts "Give a man a fish, and you feed him for a day."
|
115
|
+
puts "Teach a man to fish, and you feed him for a lifetime."
|
116
|
+
puts "- Unidentified Wise Man"
|
117
|
+
puts " "
|
118
|
+
puts " "
|
119
|
+
puts "-----------------------------------------"
|
120
|
+
puts " "
|
121
|
+
puts " "
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
class NjFishingReport::Fishing_Location
|
3
|
+
|
4
|
+
attr_accessor :name, :fishing_report, :url
|
5
|
+
@@all = []
|
6
|
+
|
7
|
+
def initialize(name)
|
8
|
+
@name = name
|
9
|
+
@@all << self
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.all
|
13
|
+
@@all
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.find_by_name(name)
|
17
|
+
self.all.detect {|instance| instance.name == name}
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
class NjFishingReport::Scraper
|
3
|
+
|
4
|
+
BASE_PATH = "http://www.fishingreportsnow.com/New_Jersey_Fishing_Reports_Pro.cfm/reg/7"
|
5
|
+
|
6
|
+
def self.scrape_fishing_location
|
7
|
+
|
8
|
+
doc = Nokogiri::HTML(open(BASE_PATH))
|
9
|
+
|
10
|
+
fishing_locations = []
|
11
|
+
|
12
|
+
doc.css("td.reportstext a").each do |potential_location|
|
13
|
+
if potential_location.attribute("href").value[0,30] == "New_Jersey_Fishing_Reports_Pro" && potential_location.text != "Last Week's Report"
|
14
|
+
fishing_locations << potential_location
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
fishing_locations.each do |location|
|
19
|
+
fishing_location = location.text
|
20
|
+
fishing_location = NjFishingReport::Fishing_Location.new(location.text)
|
21
|
+
fishing_location.url = "http://www.fishingreportsnow.com/" + location.attribute("href").value
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def self.scrape_fishing_report
|
27
|
+
|
28
|
+
NjFishingReport::Fishing_Location.all.each do |location|
|
29
|
+
|
30
|
+
doc = Nokogiri::HTML(open(location.url))
|
31
|
+
|
32
|
+
doc.css("td.reportstext").each do |scraping_only_if_fishing_report|
|
33
|
+
if scraping_only_if_fishing_report.attribute("align").value == "left"
|
34
|
+
|
35
|
+
instance_of_fishing_report = NjFishingReport::Fishing_Report.new(scraping_only_if_fishing_report.text.strip)
|
36
|
+
|
37
|
+
instance_of_fishing_report.fishing_location = NjFishingReport::Fishing_Location.all.detect {|instance| instance.name == location.name}
|
38
|
+
|
39
|
+
instance_of_fishing_location = NjFishingReport::Fishing_Location.all.detect {|instance| instance.name == location.name}
|
40
|
+
|
41
|
+
instance_of_fishing_location.fishing_report = instance_of_fishing_report
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
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 "nj_fishing_report/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "nj_fishing_report"
|
8
|
+
spec.version = NjFishingReport::VERSION
|
9
|
+
spec.authors = ["David Kim"]
|
10
|
+
spec.email = ["davidjkim810@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{"This gem allows users to view fishing reports in NJ"}
|
13
|
+
spec.description = %q{View the most recent fishing reports in New Jersey. Select a location on the list of popular fishing locations and receive a report.}
|
14
|
+
spec.homepage = "https://github.com/davidjkim810/nj_fishing_report"
|
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://github.com/davidjkim810/nj_fishing_report"
|
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 = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
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 "pry", ">= 0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
spec.add_development_dependency "nokogiri", ">= 0"
|
38
|
+
end
|
data/spec.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Specifications for the CLI Assessment
|
2
|
+
|
3
|
+
Specs:
|
4
|
+
|
5
|
+
- [x] Have a CLI for interfacing with the application
|
6
|
+
|
7
|
+
The #call method hosts all the other methods that allow the CLI to run. #greeting welcomes the user. #create_fishing_location_and_report calls the method that scrapes information. #run_program_interface pulls up a main menu that is interactive via user input. From the #run_program_interface a user can choose to see the list of fishing locations or quit the program. Finally, within the #run_program_interface is the #goodbye method that prints a good bye message upon program termination.
|
8
|
+
|
9
|
+
|
10
|
+
- [X] Pull data from an external source
|
11
|
+
|
12
|
+
I have created a BASE_PATH that pulls up a New Jersey Fishing Report website. The two scraping methods use Nokogiri and Open URI to scrape relevant information from the website--and one level deep in the website(fishing_report is one level deep).
|
13
|
+
|
14
|
+
- [X] Implement both list and detail views
|
15
|
+
|
16
|
+
I have implemented the list view by allowing users to select the list of fishing locations from the main menu. If the user choose to view the list, there is a list of updated fishing locations. Further, by selecting the number of an individual fishing location the user can see the details of that selection. In this case, the details are the actual fishing report of the individual fishing location.
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nj_fishing_report
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Kim
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-04 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: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nokogiri
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: View the most recent fishing reports in New Jersey. Select a location
|
84
|
+
on the list of popular fishing locations and receive a report.
|
85
|
+
email:
|
86
|
+
- davidjkim810@gmail.com
|
87
|
+
executables: []
|
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
|
+
- NOTES.md
|
99
|
+
- README.md
|
100
|
+
- Rakefile
|
101
|
+
- bin/console
|
102
|
+
- bin/nj_fishing_report
|
103
|
+
- bin/setup
|
104
|
+
- lib/nj_fishing_report.rb
|
105
|
+
- lib/nj_fishing_report/cli.rb
|
106
|
+
- lib/nj_fishing_report/fishing_location.rb
|
107
|
+
- lib/nj_fishing_report/fishing_report.rb
|
108
|
+
- lib/nj_fishing_report/scraper.rb
|
109
|
+
- lib/nj_fishing_report/version.rb
|
110
|
+
- nj_fishing_report.gemspec
|
111
|
+
- spec.md
|
112
|
+
homepage: https://github.com/davidjkim810/nj_fishing_report
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.7.4
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: '"This gem allows users to view fishing reports in NJ"'
|
136
|
+
test_files: []
|