colorado_trails 0.1.1 → 0.1.2
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 +4 -4
- data/Gemfile.lock +2 -1
- data/README.md +45 -1
- data/colorado_trails.gemspec +7 -10
- data/lib/colorado_trails/scraper.rb +3 -1
- data/lib/colorado_trails/trails.rb +9 -7
- data/lib/colorado_trails/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc4e34f0a55ccf719ceb7ce7ceecc4aeb8ceb7a2c4c6fa6b1ae1ef8d1859fe0b
|
4
|
+
data.tar.gz: 93b3141314a612dfafbd5d935f9f4fd6dfb09d47f0b222c1ff4d7967fcc11c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45715bb3b195fd2d39ec2b9e695f4deafd33df9b60a0fa8a61fb1fee666a7edfd15bc20a644812336355752788d2544419a58e535dd71784bb8d870ad7aa050a
|
7
|
+
data.tar.gz: 560776271c32a6257d7ecb411a72c31b5f7c008cee400f70211cad1fb3cac9b4359365e9a324b8a0d66d75cec4eb9f38eda51eab37bf8b9b73384f23075a995d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1 +1,45 @@
|
|
1
|
-
|
1
|
+
Welcome to Colorado Trails!
|
2
|
+
|
3
|
+
|
4
|
+
About this Gem:
|
5
|
+
|
6
|
+
The intention for this gem was to connect my love for the outdoors with my love for code.
|
7
|
+
In the app, you will have the opportunity to explore Colorado's Top20 trails in a variety of categories.
|
8
|
+
Once you picked a specific trail, more detailed information about said trail will be displayed.
|
9
|
+
|
10
|
+
|
11
|
+
Install Instructions:
|
12
|
+
|
13
|
+
RubyGems.org option:
|
14
|
+
|
15
|
+
If you are reading this, chances are you know a bit about code and how to run a ruby gem.
|
16
|
+
If not, feel free to reach out to me on GitHub - @ChrstphGrnr or on Slack @ChrstphGrnr
|
17
|
+
|
18
|
+
This is published on RubyGems.org and thus you can install it easily with the following terminal command:
|
19
|
+
|
20
|
+
gem install colorado_trails
|
21
|
+
|
22
|
+
Once installed you will need to go into the colorado_trails/bin folder and execute the 'run' file.
|
23
|
+
|
24
|
+
This will open the app for you to use.
|
25
|
+
|
26
|
+
|
27
|
+
OR:
|
28
|
+
|
29
|
+
Fork and Clone it on GitHub and open it in your favorite local environment.
|
30
|
+
Once it's loaded in your environment, open terminal, navigate into the colorado_trails/bin folder and type ./run
|
31
|
+
|
32
|
+
|
33
|
+
This Gem is published under the MIT license - https://opensource.org/licenses/MIT
|
34
|
+
|
35
|
+
|
36
|
+
I want to thank a few people for their contribution to the development process:
|
37
|
+
|
38
|
+
!Slackers cohort - Flatiron Staff in general - particularly Alex Aguilar.
|
39
|
+
|
40
|
+
For any questions, feel free to reach out on GitHub.
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
data/colorado_trails.gemspec
CHANGED
@@ -16,16 +16,15 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
|
20
|
-
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = "https://github.com/ChrstphGrnr/colorado_trails"
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
# end
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
27
|
+
end
|
29
28
|
|
30
29
|
# Specify which files should be added to the gem when it is released.
|
31
30
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -45,6 +44,4 @@ Gem::Specification.new do |spec|
|
|
45
44
|
spec.add_dependency 'colorize'
|
46
45
|
spec.add_dependency 'artii'
|
47
46
|
|
48
|
-
|
49
|
-
|
50
47
|
end
|
@@ -56,6 +56,8 @@ class ColoradoTrails::Scraper
|
|
56
56
|
trail.duration = info[i].strip
|
57
57
|
when "distance"
|
58
58
|
trail.distance = info[i].strip + " miles"
|
59
|
+
when "accessibility"
|
60
|
+
trail.accessibility = info[i].strip
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
@@ -79,7 +81,7 @@ class ColoradoTrails::Scraper
|
|
79
81
|
trail.rating = "#{doc.css('div.rating-section').children.css('img').attribute('alt').text[0]}/5 stars"
|
80
82
|
|
81
83
|
trail.description = nil
|
82
|
-
|
84
|
+
|
83
85
|
if !doc.css('p.summary').empty?
|
84
86
|
trail.description = doc.css('p.summary').text.delete'(/["]/)'
|
85
87
|
else
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class ColoradoTrails::Trails
|
2
2
|
|
3
3
|
attr_accessor :name, :location, :rating, :description, :type, :url,
|
4
|
-
:difficulty, :distance, :duration
|
4
|
+
:difficulty, :distance, :duration, :accessibility
|
5
5
|
@@all = []
|
6
6
|
|
7
7
|
def initialize(name= nil, location= nil, rating= nil, url= nil)
|
@@ -33,12 +33,14 @@ class ColoradoTrails::Trails
|
|
33
33
|
trail_name = self.name.delete("(/\#|[0-9]/)").strip
|
34
34
|
|
35
35
|
puts "\n\nHere are the details for #{trail_name}:\n\n".colorize(:light_blue)
|
36
|
-
puts "Rating:
|
37
|
-
puts "Trail Type:
|
38
|
-
puts "Distance
|
39
|
-
puts "Duration
|
40
|
-
puts "Difficulty
|
41
|
-
puts "
|
36
|
+
puts "Rating: #{self.rating}".colorize(:light_blue) unless self.rating == nil
|
37
|
+
puts "Trail Type: #{self.type}".colorize(:light_blue) unless self.type == nil
|
38
|
+
puts "Distance: #{self.distance}".colorize(:light_blue) unless self.distance == nil
|
39
|
+
puts "Duration: #{self.duration}".colorize(:light_blue) unless self.duration == nil
|
40
|
+
puts "Difficulty: #{self.difficulty}".colorize(:light_blue) unless self.difficulty == nil
|
41
|
+
puts "Accessibility: #{self.accessibility}".colorize(:light_blue) unless self.accessibility == nil
|
42
|
+
puts "Website: #{self.url}".colorize(:light_blue)
|
43
|
+
|
42
44
|
|
43
45
|
if self.description != nil || self.description != ""
|
44
46
|
# binding.pry
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colorado_trails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ChrstphGrnr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,7 +138,10 @@ files:
|
|
138
138
|
homepage: https://github.com/ChrstphGrnr/colorado_trails.git
|
139
139
|
licenses:
|
140
140
|
- MIT
|
141
|
-
metadata:
|
141
|
+
metadata:
|
142
|
+
allowed_push_host: https://rubygems.org
|
143
|
+
homepage_uri: https://github.com/ChrstphGrnr/colorado_trails.git
|
144
|
+
source_code_uri: https://github.com/ChrstphGrnr/colorado_trails
|
142
145
|
post_install_message:
|
143
146
|
rdoc_options: []
|
144
147
|
require_paths:
|