wikihow 0.1.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7049014cdd5bf0f414c1d25b67ff23cb510071007c60cae0310588da402a7564
4
+ data.tar.gz: d8c84ca96eda9d23f318b5dc4b6b276d332aec6d68d8f405cfdfc87eb8e88965
5
+ SHA512:
6
+ metadata.gz: 6cd866fa89a9175087255dc9f538c2b8550681d747030a1a679fdc38cc72a0e424ff86c12cc501b2ff9f89ca06d1472c44182ff1f3e0af0ef2a0b4118b91ba32
7
+ data.tar.gz: 49ee6a9276be12580ac75bf880f1ce0ff51598125b71c0d50190380d240d37990c291769e7a0d67c3aa0eeef76a8a9f442303f4b9169e47b1a9133e70e1a83eb
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.1
7
+ before_install: gem install bundler -v 2.0.1
@@ -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 'jaredkgrove@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/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in wikihow.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ wikihow (0.1.0)
5
+ nokogiri
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ mini_portile2 (2.4.0)
12
+ nokogiri (1.10.3)
13
+ mini_portile2 (~> 2.4.0)
14
+ rake (10.5.0)
15
+ rspec (3.8.0)
16
+ rspec-core (~> 3.8.0)
17
+ rspec-expectations (~> 3.8.0)
18
+ rspec-mocks (~> 3.8.0)
19
+ rspec-core (3.8.0)
20
+ rspec-support (~> 3.8.0)
21
+ rspec-expectations (3.8.3)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.8.0)
24
+ rspec-mocks (3.8.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.8.0)
27
+ rspec-support (3.8.0)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 2.0)
34
+ rake (~> 10.0)
35
+ rspec (~> 3.0)
36
+ wikihow!
37
+
38
+ BUNDLED WITH
39
+ 2.0.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 'Jared Grove'
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,57 @@
1
+ -A command line interface for Wikihow. Browse by main category
2
+
3
+ user type Wikihow
4
+
5
+ Show main categories
6
+
7
+ user selects category
8
+
9
+ 1. Arts & Crafts
10
+ 2. Sports
11
+ 3. ...
12
+
13
+ Show topics within category
14
+
15
+ 1. How to throw a baseball
16
+ 2. How to pretend you care about football
17
+ 3. ...
18
+
19
+ User selects topic
20
+
21
+ Show Methods
22
+
23
+ 1. Playing catch with a friend
24
+ 2. Learning by yourself
25
+ 3. ...
26
+
27
+ User selects Method
28
+
29
+ Show steps to user
30
+ 1. Get a baseball
31
+ 2. Find a backstop or fence to throw against
32
+ 3. ...
33
+
34
+ What is a category
35
+ has many topics
36
+ has a URL
37
+
38
+ What is a topic
39
+ has at least 1 method
40
+ has a url
41
+
42
+ What is a Method
43
+ has many steps
44
+
45
+ What is a step
46
+ has text
47
+ has a picture
48
+
49
+
50
+ ## Project Meeting Notes
51
+
52
+ What website will you be scraping? wikihow.com
53
+ What will you need to do with the data you return from scraping? create category instances (should I create topic classes right away or after user selection?)
54
+ What classes will you be using? Scraper class (separate scraper classes for main page, category page, and topic page?), cli class, category class, topic class
55
+ What will be the flow of displaying data for your application. ex How will your CLI portion work. Ask user to select a category. Scrape category page for how-to topics, ask user to select topic. Scrape topic page for methods. Ask user to select method. Show Method steps to user.
56
+ How will you display data one level deep to the user?
57
+ What will need to be in your README file? An explanation of how to use the program?
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Wikihow
2
+
3
+ This Ruby Gem provides an interactive CLI experience to learn the "How To's" of a variety of topics per the Wikihow website.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'wikihow'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install wikihow
20
+
21
+ ## Usage
22
+
23
+ Type the below and follow the on screen prompts.
24
+
25
+ ./bin/wikihow
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/'immutable-founder-5073'/wikihow. 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 Wikihow project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/'immutable-founder-5073'/wikihow/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "wikihow"
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
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ IFS=$'\n\t'
5
+ set -vx
6
+
7
+ bundle install
8
+
9
+ # Do any other automated setup that you need to do here
data/bin/wikihow ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "wikihow"
5
+ Wikihow::CLI.new.call
@@ -0,0 +1,37 @@
1
+ class Wikihow::Category
2
+ attr_accessor :title, :url, :topics
3
+ @@all = []
4
+ def initialize(category_hash)
5
+ self.title = category_hash[:title]
6
+ self.url = category_hash[:url]
7
+ self.topics = []
8
+ self.class.all << self
9
+ end
10
+
11
+ def add_topic(topic)
12
+ self.topics << topic
13
+ end
14
+
15
+ def self.all
16
+ @@all
17
+ end
18
+
19
+ def self.get_or_create_categories
20
+ if self.all == []
21
+ self.scrape_for_categories.each{|category| self.new(category)}
22
+ end
23
+ #binding.pry
24
+ self.all
25
+ end
26
+
27
+ def self.scrape_for_categories
28
+ doc = Nokogiri::HTML(open("https://www.wikihow.com/Main-Page"))
29
+ categories_array = []
30
+ doc.search("#hp_categories a").each do |category|
31
+ title = category.text
32
+ url = category.attr("href")
33
+ categories_array << {:title => title,:url => url}
34
+ end
35
+ categories_array
36
+ end
37
+ end
@@ -0,0 +1,166 @@
1
+ #CLI Controller
2
+ class Wikihow::CLI
3
+ @@red = 31
4
+ @@green = 32
5
+ @@yellow = 33
6
+ @@blue = 34
7
+ @@cyan = 36
8
+
9
+ def call
10
+ puts "WELCOME TO WIKIHOW!"
11
+ list_categories
12
+ categories_menu
13
+ end
14
+
15
+ def list_categories
16
+ @categories = Wikihow::Category.get_or_create_categories
17
+ @categories.each.with_index(1) {|category, i| puts yellow_text("#{i}. #{category.title}")}
18
+ end
19
+
20
+ def categories_menu
21
+ input = nil
22
+ puts "Enter the number of the category that you'd like to learn about. Type 'exit' to close."
23
+ input = gets.strip.downcase
24
+ if input.to_i > 0 && input.to_i <= @categories.count
25
+ category = @categories[input.to_i - 1]
26
+ display_index = list_topics(category)
27
+ topics_menu(category, display_index)
28
+ elsif input == "exit"
29
+ good_bye
30
+ else
31
+ list_categories
32
+ puts red_text("Please enter a valid command.")
33
+ categories_menu
34
+ end
35
+ end
36
+
37
+ def list_topics(category, display_index = 0)
38
+ @topics = Wikihow::Topic.get_or_create_topics_from_category(category)
39
+ if display_index < (@topics.count - 1)
40
+ @topics[display_index..display_index + 9].each.with_index(display_index + 1) {|topic, i| puts blue_text("#{i}. #{topic.title}")}
41
+ display_index + 10
42
+ else
43
+ puts "Those are all the topics for this category. Here are the first ten topics for the category."
44
+ list_topics(category)
45
+ end
46
+ end
47
+
48
+ def topics_menu(category, display_index = 10)
49
+ input = nil
50
+ puts "Enter the number of the topic that you'd like to learn about. Type 'next' to display the next 10 topics. Type 'cat' to return to categories menu. Type 'exit' to quit."
51
+ input = gets.strip.downcase
52
+ if input.to_i > 0 && input.to_i <= category.topics.count
53
+ topic = category.topics[input.to_i - 1]
54
+ list_sections(topic)
55
+ sections_menu(topic)
56
+ elsif input == "next"
57
+ display_index = list_topics(category, display_index)
58
+ topics_menu(category, display_index)
59
+ elsif input == "cat"
60
+ list_categories
61
+ categories_menu
62
+ elsif input == "exit"
63
+ good_bye
64
+ else
65
+ puts red_text("Please enter a valid command.")
66
+ topics_menu(category, display_index)
67
+ end
68
+ end
69
+
70
+ def list_sections(topic)
71
+ if topic.sections.count == 1
72
+ puts blue_text("\nHow to #{topic.title}".upcase)
73
+ puts blue_text(topic.intro)
74
+ else
75
+ puts blue_text("\nHow to #{topic.title}".upcase)
76
+ puts blue_text(topic.intro)
77
+ topic.sections.each.with_index(1) {|section, i|puts yellow_text("#{i}. #{section[:section_title]}")}
78
+ end
79
+ end
80
+
81
+ def sections_menu(topic)
82
+ if topic.sections.count == 1
83
+ display_section(topic.sections[0])
84
+ list_topics(topic.category)
85
+ topics_menu(topic.category)
86
+ else
87
+ input = nil
88
+ puts "Enter the number of the section/method you'd like to learn about. Type 'topics' to return to Topics menu. Type 'exit' to quit"
89
+ input = gets.strip.downcase
90
+ if input.to_i > 0 && input.to_i <= topic.sections.count
91
+ display_section(topic.sections[input.to_i - 1])
92
+ list_sections(topic)
93
+ sections_menu(topic)
94
+ elsif input == "topics"
95
+ list_topics(topic.category)
96
+ topics_menu(topic.category)
97
+ elsif input == "exit"
98
+ good_bye
99
+ else
100
+ puts red_text("Please enter a valid command.")
101
+ sections_menu(topic)
102
+ end
103
+ end
104
+ end
105
+
106
+ def display_section(section, step_number = 1)
107
+ step_description = section[:section_steps][step_number - 1]
108
+ list_step(step_description, step_number)
109
+ if step_number == section[:section_steps].count
110
+ puts "Those are all the steps! Press Enter to continue"
111
+ gets
112
+ else
113
+ puts "Press enter for next step. Type 'topic' to return to menu."
114
+ input = gets.strip.downcase
115
+ if input != "topic"
116
+ display_section(section, step_number + 1)
117
+ end
118
+ end
119
+ end
120
+
121
+ def list_step(step_description, step_number)
122
+ step_description.each do |layer_1|
123
+ (layer_1.is_a? Array) ? display_first_layer_list(layer_1) : puts(yellow_text("\n#{step_number}. #{layer_1}"))
124
+ end
125
+ end
126
+
127
+ def display_first_layer_list(layer_1)
128
+ layer_1.each do |layer_2|
129
+ (layer_2.is_a? Array) ? display_second_layer_list(layer_2) : puts(green_text("\n > #{layer_2}\n"))
130
+ end
131
+ end
132
+
133
+ def display_second_layer_list(layer_2)
134
+ layer_2.each do |layer_3|
135
+ puts blue_text("\n >> #{layer_3}\n")
136
+ end
137
+ end
138
+
139
+ def good_bye
140
+ puts "Goodbye!"
141
+ end
142
+
143
+ def red_text(string)
144
+ color_text(string, @@red)
145
+ end
146
+
147
+ def green_text(string)
148
+ color_text(string, @@green)
149
+ end
150
+
151
+ def blue_text(string)
152
+ color_text(string, @@blue)
153
+ end
154
+
155
+ def yellow_text(string)
156
+ color_text(string, @@yellow)
157
+ end
158
+
159
+ def cyan_text(string)
160
+ color_text(string, @@cyan)
161
+ end
162
+
163
+ def color_text(string, color)
164
+ "\e[#{color}m#{string}\e[0m"
165
+ end
166
+ end
@@ -0,0 +1,76 @@
1
+ class Wikihow::Topic
2
+ attr_accessor :url, :title, :intro, :author#TODO
3
+ attr_reader :category
4
+ def initialize(topic_hash = nil, category = nil)
5
+ self.title = topic_hash[:title] if topic_hash != nil
6
+ self.url = topic_hash[:url] if topic_hash != nil
7
+ self.category = category if category != nil
8
+ self.sections = []
9
+ end
10
+
11
+ def category=(category)
12
+ @category = category
13
+ category.add_topic(self)
14
+ end
15
+
16
+ def sections
17
+ if @sections == []
18
+ @sections = self.scrape_topic
19
+ end
20
+ @sections
21
+ end
22
+
23
+ def sections=(sections)
24
+ @sections = sections
25
+ end
26
+
27
+ def scrape_topic
28
+ doc = Nokogiri::HTML(open(self.url))
29
+
30
+ self.intro = doc.search("#intro p").last.text
31
+ sections_array = []
32
+ doc.search("#intro #method_toc .toc_method").each do |method|
33
+ sections_array << {:section_title => method.text, :section_steps => []}
34
+ end
35
+
36
+ sections_array.each.with_index do |section, i|
37
+ doc.search(".steps_list_2")[i].search(".step").each do |section_li|
38
+ step_description = [section_li.search(".whb").text.strip + " " + section_li.search("> text()").text.strip]
39
+ section_li.search("> ul > li").each do |step_li|
40
+ bullet_point = [step_li.search("> text(), a").text.strip]
41
+ sub_bullet_point = step_li.search("> ul > li").collect {|bullet_point_li|bullet_point_li.search("> text()").text.strip}
42
+ bullet_point << sub_bullet_point if sub_bullet_point !=[]
43
+ step_description << bullet_point if bullet_point != []
44
+ end
45
+ section[:section_steps] << step_description
46
+ end
47
+ end
48
+ sections_array
49
+ end
50
+
51
+ # def self.sentence_to_snake_case(string)
52
+ # string.gsub(" ","_")
53
+ # end
54
+ #
55
+ # def self.snake_case_to_sentence(string)
56
+ # string.gsub("_"," ")
57
+ # end
58
+
59
+ def self.get_or_create_topics_from_category(category)
60
+ if category.topics == []
61
+ self.scrape_for_topics(category).each{|topic_hash|self.new(topic_hash, category)}
62
+ end
63
+ category.topics
64
+ end
65
+
66
+ def self.scrape_for_topics(category)
67
+ doc = Nokogiri::HTML(open("https://www.wikihow.com" + category.url))
68
+ topics_array = []
69
+ doc.search("#cat_container #cat_all a").each do |topic|
70
+ title = topic.search("span").text.strip
71
+ url = topic.attr("href")
72
+ topics_array << {:title => title,:url => url} if title != ""
73
+ end
74
+ topics_array
75
+ end
76
+ end
@@ -0,0 +1,3 @@
1
+ module Wikihow
2
+ VERSION = "0.1.1"
3
+ end
data/lib/wikihow.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'open-uri'
2
+ require 'nokogiri'
3
+
4
+ require_relative './wikihow/version'
5
+ require_relative './wikihow/cli'
6
+ require_relative './wikihow/category'
7
+ require_relative './wikihow/topic'
data/wikihow.gemspec ADDED
@@ -0,0 +1,46 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "wikihow/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "wikihow"
8
+ spec.version = Wikihow::VERSION
9
+ spec.authors = ["'Jared Grove'"]
10
+ spec.email = ["'jaredkgrove@gmail.com'"]
11
+
12
+ spec.summary = %q{: Write a short summary, because RubyGems requires one.}
13
+ spec.description = %q{: Write a longer description or delete this line.}
14
+ #spec.homepage = ": Put your gem's website or public repo URL here."
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"] = ": Set to 'http://mygemserver.com'"
21
+
22
+ #spec.metadata["homepage_uri"] = spec.homepage
23
+ #spec.metadata["source_code_uri"] = ": Put your gem's public repo URL here."
24
+ #spec.metadata["changelog_uri"] = ": Put your gem's CHANGELOG.md URL here."
25
+ else
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
+ end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ #spec.bindir = "exe"
36
+ #spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.bindir = "bin"
38
+ spec.executables << 'wikihow'
39
+ spec.require_paths = ["lib"]
40
+
41
+ spec.add_development_dependency "bundler", "~> 2.0"
42
+ spec.add_development_dependency "rake", "~> 10.0"
43
+ spec.add_development_dependency "rspec", "~> 3.0"
44
+
45
+ spec.add_dependency "nokogiri"
46
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wikihow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - "'Jared Grove'"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-17 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: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
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
+ description: ": Write a longer description or delete this line."
70
+ email:
71
+ - "'jaredkgrove@gmail.com'"
72
+ executables:
73
+ - wikihow
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - CODE_OF_CONDUCT.md
81
+ - Gemfile
82
+ - Gemfile.lock
83
+ - LICENSE.txt
84
+ - NOTES.md
85
+ - README.md
86
+ - Rakefile
87
+ - bin/console
88
+ - bin/setup
89
+ - bin/wikihow
90
+ - lib/wikihow.rb
91
+ - lib/wikihow/category.rb
92
+ - lib/wikihow/cli.rb
93
+ - lib/wikihow/topic.rb
94
+ - lib/wikihow/version.rb
95
+ - wikihow.gemspec
96
+ homepage:
97
+ licenses:
98
+ - MIT
99
+ metadata: {}
100
+ post_install_message:
101
+ rdoc_options: []
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubygems_version: 3.0.3
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: ": Write a short summary, because RubyGems requires one."
119
+ test_files: []