epic_road_trips 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f5c17773b9df4559e3e0c81c1fcf6e87653a88770b6ce8882f406ca1ad0ec5df
4
+ data.tar.gz: f5e6002b80da6ad35855fb05296f823fed953bac690f488681274a4edb72df4f
5
+ SHA512:
6
+ metadata.gz: eab1ba6e33ebf29e0a4e7b01db84c534c4ecac0e0de47831ff957bc36026c714c97d4d803d68266dd38fb1eb90a33136443fafbe3d40f190fc9c1792cb1b22bb
7
+ data.tar.gz: 1636fd525626f79f68ea8a53bc3dbc90bb7547f768efbb76b42777630f8655a98e2c53ebb4385e6b2b5f688bc1488c2128ef5b655a076a3a9c3c8f2589cd935a
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,3 @@
1
+ [submodule "examples/now-playing-cli-gem"]
2
+ path = examples/now-playing-cli-gem
3
+ url = git@github.com:learn-co-curriculum/now-playing-cli-gem.git
data/.learn ADDED
@@ -0,0 +1,8 @@
1
+ tags:
2
+ - cli
3
+ - gem
4
+ - oo
5
+ languages:
6
+ - ruby
7
+ resources:
8
+ live_assessment: true
@@ -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 'deerace12@gmail.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/
@@ -0,0 +1,37 @@
1
+ # Contributing to Learn.co Curriculum
2
+
3
+ We're really exited that you're about to contribute to the [open curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co). If this is your first time contributing, please continue reading to learn how to make the most meaningful and useful impact possible.
4
+
5
+ ## Raising an Issue to Encourage a Contribution
6
+
7
+ If you notice a problem with the curriculum that you believe needs improvement
8
+ but you're unable to make the change yourself, you should raise a Github issue
9
+ containing a clear description of the problem. Include relevant snippets of
10
+ the content and/or screenshots if applicable. Curriculum owners regularly review
11
+ issue lists and your issue will be prioritized and addressed as appropriate.
12
+
13
+ ## Submitting a Pull Request to Suggest an Improvement
14
+
15
+ If you see an opportunity for improvement and can make the change yourself go
16
+ ahead and use a typical git workflow to make it happen:
17
+
18
+ * Fork this curriculum repository
19
+ * Make the change on your fork, with descriptive commits in the standard format
20
+ * Open a Pull Request against this repo
21
+
22
+ A curriculum owner will review your change and approve or comment on it in due
23
+ course.
24
+
25
+ # Why Contribute?
26
+
27
+ Curriculum on Learn is publicly and freely available under Learn's
28
+ [Educational Content License](https://learn.co/content-license). By
29
+ embracing an open-source contribution model, our goal is for the curriculum
30
+ on Learn to become, in time, the best educational content the world has
31
+ ever seen.
32
+
33
+ We need help from the community of Learners to maintain and improve the
34
+ educational content. Everything from fixing typos, to correcting
35
+ out-dated information, to improving exposition, to adding better examples,
36
+ to fixing tests—all contributions to making the curriculum more effective are
37
+ welcome.
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+
4
+ # Specify your gem's dependencies in epic_road_trips.gemspec
5
+ gemspec
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ epic_road_trips (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.2)
10
+ method_source (0.9.0)
11
+ mini_portile2 (2.3.0)
12
+ nokogiri (1.8.1)
13
+ mini_portile2 (~> 2.3.0)
14
+ pry (0.11.2)
15
+ coderay (~> 1.1.0)
16
+ method_source (~> 0.9.0)
17
+ rake (10.4.2)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ bundler (~> 1.16)
24
+ epic_road_trips!
25
+ nokogiri
26
+ pry
27
+ rake (~> 10.0)
28
+
29
+ BUNDLED WITH
30
+ 1.16.0
@@ -0,0 +1,7 @@
1
+ #Learn.co Educational Content License
2
+
3
+ Copyright (c) 2015 Flatiron School, Inc
4
+
5
+ The Flatiron School, Inc. owns this Educational Content. However, the Flatiron School supports the development and availability of educational materials in the public domain. Therefore, the Flatiron School grants Users of the Flatiron Educational Content set forth in this repository certain rights to reuse, build upon and share such Educational Content subject to the terms of the Educational Content License set forth [here](http://learn.co/content-license) (http://learn.co/content-license). You must read carefully the terms and conditions contained in the Educational Content License as such terms govern access to and use of the Educational Content.
6
+
7
+ Flatiron School is willing to allow you access to and use of the Educational Content only on the condition that you accept all of the terms and conditions contained in the Educational Content License set forth [here](http://learn.co/content-license) (http://learn.co/content-license). By accessing and/or using the Educational Content, you are agreeing to all of the terms and conditions contained in the Educational Content License. If you do not agree to any or all of the terms of the Educational Content License, you are prohibited from accessing, reviewing or using in any way the Educational Content.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 'Dee Race'
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.
@@ -0,0 +1,43 @@
1
+ # EpicRoadTrips
2
+
3
+ This Ruby Gem provides a CLI to explore the worlds most epic road trips brought to you by Fodors Travel Guide. Have fun with your new gem!
4
+
5
+ In this directory, you'll find the files you need to be abe to package up your Ruby library into a gem. Put your Ruby code in the file `lib/epic_road_trips`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'epic_road_trips'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install epic_road_trips
22
+
23
+ ## Usage
24
+
25
+ Run: `epic-road-trips` after installing the gem.
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. 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/'Dee-Race'/epic_road_trips. 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 EpicRoadTrips project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/'hey-36741'/epic_road_trips/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "epic_road_trips"
5
+
6
+ #require_relative './lib/epic_road_trips'
7
+
8
+ #EpicRoadTrips::CLI.new.call
9
+
10
+ # You can add fixtures and/or initialization code here to make experimenting
11
+ # with your gem easier. You can also use a different console, if you like.
12
+
13
+ # (If you use this, don't forget to add pry to your Gemfile!)
14
+ # require "pry"
15
+ # Pry.start
16
+
17
+ require "irb"
18
+ IRB.start(__FILE__)
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/epic_road_trips'
4
+
5
+ EpicRoadTrips::CLI.new.call
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require 'pry'
2
+ require 'nokogiri'
3
+ require 'open-uri'
4
+
5
+ require_relative '../lib/epic_road_trips/trips'
6
+ require_relative '../lib/epic_road_trips/cli'
7
+ require_relative '../lib/epic_road_trips/version'
@@ -0,0 +1,37 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "epic_road_trips/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "epic_road_trips"
8
+ spec.version = EpicRoadTrips::VERSION
9
+ spec.authors = ["'Dee Race'"]
10
+ spec.email = ["'deerace12@gmail.com'"]
11
+
12
+ spec.summary = "The Worlds Most Epic Road Trips"
13
+ spec.description = "Explore and learn more about the worlds most epic road trips published by Fodors Travel Guide."
14
+ spec.homepage = "https://github.com/Dee-Race/epic-road-trips-cli-gem"
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"] = "TOdo: Set to 'http://mygemserver.com'"
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 = ["epic-road-trips"]
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_runtime_dependency "nokogiri", ">= 0"
36
+ spec.add_development_dependency "pry", ">= 0"
37
+ end
@@ -0,0 +1,13 @@
1
+ #require 'pry'
2
+ #require 'nokogiri'
3
+ #require 'open-uri'
4
+
5
+ module EpicRoadTrips
6
+ # Your code goes here...
7
+ end
8
+
9
+ require_relative '../config/environment.rb'
10
+
11
+ #require_relative './epic_road_trips/trips'
12
+ #require_relative './epic_road_trips/cli'
13
+ #require_relative './epic_road_trips/version'
@@ -0,0 +1,55 @@
1
+ class EpicRoadTrips::CLI
2
+
3
+ def call
4
+ greeting
5
+ list_road_trips
6
+ menu
7
+ goodbye
8
+ end
9
+
10
+ def greeting
11
+ puts ""
12
+ puts "--*-- Welcome World Traveler! --*--"
13
+ puts ""
14
+ puts ">> Let's go on an EPIC Road Trip! <<"
15
+ puts ""
16
+ end
17
+
18
+ def list_road_trips
19
+ puts ""
20
+ @trips = EpicRoadTrips::Trips.get_page
21
+ @trips.each_with_index do |trip, i|
22
+ puts "#{i+1}. #{trip.road} - #{trip.country}"
23
+ end
24
+ end
25
+
26
+ def menu
27
+ input = nil
28
+ while input != "adios"
29
+ puts ""
30
+ puts "Enter the number of the roadtrip you'd like more info on"
31
+ puts ""
32
+ puts "Enter 'list' to see all EPIC road trips."
33
+ puts "Enter 'adios' to exit program."
34
+ input = gets.strip
35
+
36
+ if input.to_i > 0
37
+ trip = @trips[input.to_i-1]
38
+
39
+ puts "-------- >> #{trip.road} - #{trip.country} << -------- "
40
+ puts ""
41
+ puts "-------*-------*-------*-------*-------*-------*-------*------- "
42
+ puts ""
43
+ puts "#{trip.description}"
44
+ puts ""
45
+ elsif input == "list"
46
+ list_road_trips
47
+ end
48
+ end
49
+ end
50
+
51
+ def goodbye
52
+ puts ""
53
+ puts "See you next time for your next EPIC road trip!"
54
+ end
55
+ end
@@ -0,0 +1,3 @@
1
+ require 'nokogiri'
2
+ require 'open-uri'
3
+ require 'pry'
@@ -0,0 +1,29 @@
1
+ require 'pry'
2
+ require 'nokogiri'
3
+ require 'open-uri'
4
+
5
+ module EpicRoadTrips
6
+
7
+ class EpicRoadTrips::Trips
8
+ attr_accessor :road, :country, :description
9
+
10
+
11
+ def self.get_page
12
+ trips = []
13
+
14
+ doc = Nokogiri::HTML(open("https://www.fodors.com/news/photos/the-20-best-road-trips-on-earth"))
15
+
16
+ list_trips = doc.css(".container.slides")
17
+ list_trips.each do |road_trip|
18
+ trip = self.new
19
+ trip.road = road_trip.css("h2").text.strip.gsub("\n", "").gsub("Book a Hotel", "")
20
+ trip.country = road_trip.css("h3 span").text.strip.gsub("\n", "")
21
+ trip.description = road_trip.css("p").text.gsub("\u2019", " ").gsub("\u00A0", " ")
22
+
23
+ trips << trip
24
+
25
+ end
26
+ trips
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ module EpicRoadTrips
2
+ VERSION = "0.1.0"
3
+ end
data/spec.md ADDED
@@ -0,0 +1,7 @@
1
+ # Specifications for the CLI Assessment
2
+
3
+ Specs:
4
+ - [x] Have a CLI for interfacing with the application
5
+ - [ ] Pull data from an external source
6
+ - [ ] Implement both list and detail views
7
+
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: epic_road_trips
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - "'Dee Race'"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-04-10 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: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
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: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Explore and learn more about the worlds most epic road trips published
70
+ by Fodors Travel Guide.
71
+ email:
72
+ - "'deerace12@gmail.com'"
73
+ executables:
74
+ - epic-road-trips
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".gitmodules"
80
+ - ".learn"
81
+ - CODE_OF_CONDUCT.md
82
+ - CONTRIBUTING.md
83
+ - Gemfile
84
+ - Gemfile.lock
85
+ - LICENSE.md
86
+ - LICENSE.txt
87
+ - README.md
88
+ - Rakefile
89
+ - bin/console
90
+ - bin/epic-road-trips
91
+ - bin/setup
92
+ - config/environment.rb
93
+ - epic_road_trips.gemspec
94
+ - lib/epic_road_trips.rb
95
+ - lib/epic_road_trips/cli.rb
96
+ - lib/epic_road_trips/scraper.rb
97
+ - lib/epic_road_trips/trips.rb
98
+ - lib/epic_road_trips/version.rb
99
+ - spec.md
100
+ homepage: https://github.com/Dee-Race/epic-road-trips-cli-gem
101
+ licenses:
102
+ - MIT
103
+ metadata: {}
104
+ post_install_message:
105
+ rdoc_options: []
106
+ require_paths:
107
+ - lib
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ requirements: []
119
+ rubyforge_project:
120
+ rubygems_version: 2.7.2
121
+ signing_key:
122
+ specification_version: 4
123
+ summary: The Worlds Most Epic Road Trips
124
+ test_files: []