digital_nomad_jobs 0.1.0

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: 702f09df5deca8be1910e14a3715de3ef6ff2b205c2dac32a70a693d901ae5c3
4
+ data.tar.gz: 29864399c96a0acbf5ad8f08c0557ccdc00cfb05306139f034a2c333f175336a
5
+ SHA512:
6
+ metadata.gz: bea0413df5f4506a8b6b44cd94a8a92d0a994d9780a89afe7b8845e10d674c2b2074e3f830080c93508c5b852e2bc9dd04ca2d21d9c37420f9f149f42171460f
7
+ data.tar.gz: e5095e9d6f112c22570efc524b7e4613e4acdc99a977c2dc89ad3cb70571aa3cc2371026dfe22d76d363187b6a6abba091e87d60982153d3000890d4cd94aa73
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,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.16.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 <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
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/KimGonzales/#{digital_nomad_jobs}" }
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ digital_nomad_jobs (0.1.0)
5
+ colorize (~> 0.8.1)
6
+ nokogiri (~> 1.8, >= 1.8.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ coderay (1.1.2)
12
+ colorize (0.8.1)
13
+ diff-lcs (1.3)
14
+ method_source (0.9.0)
15
+ mini_portile2 (2.3.0)
16
+ nokogiri (1.8.2)
17
+ mini_portile2 (~> 2.3.0)
18
+ pry (0.11.3)
19
+ coderay (~> 1.1.0)
20
+ method_source (~> 0.9.0)
21
+ rake (10.5.0)
22
+ rspec (3.7.0)
23
+ rspec-core (~> 3.7.0)
24
+ rspec-expectations (~> 3.7.0)
25
+ rspec-mocks (~> 3.7.0)
26
+ rspec-core (3.7.1)
27
+ rspec-support (~> 3.7.0)
28
+ rspec-expectations (3.7.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.7.0)
31
+ rspec-mocks (3.7.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.7.0)
34
+ rspec-support (3.7.1)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ bundler (~> 1.16)
41
+ digital_nomad_jobs!
42
+ pry (~> 0.11.3)
43
+ rake (~> 10.0)
44
+ rspec (~> 3.0)
45
+
46
+ BUNDLED WITH
47
+ 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/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # DigitalNomadJobs
2
+
3
+ Welcome to your new ruby Gem!
4
+
5
+ Digital Nomad Jobs is a CLI gem which allows users to access the latest web developer, web designer and remote jobs available from Remoteok.io.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'digital_nomad_jobs'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install digital_nomad_jobs
22
+
23
+ ## Usage
24
+
25
+ Run digital_remote_jobs and follow the interactive prompts to choose between lists of hiring companies or lists of the latest job postings per industry.
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/KimGonzales/digital_nomad_jobs. 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 DigitalNomadJobs project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/KimGonzales/digital_nomad_jobs/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,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "digital_nomad_jobs"
5
+
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../lib/digital_nomad_jobs"
3
+
4
+ DigitalNomadJobs::CLI.new.call
data/bin/setup ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
@@ -0,0 +1,33 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "digital_nomad_jobs/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "digital_nomad_jobs"
8
+ spec.version = DigitalNomadJobs::VERSION
9
+ spec.authors = ["Kim Gonzales"]
10
+ spec.email = ["Kimgo589@gmail.com"]
11
+
12
+ spec.summary = "Remote Jobs for The Digital Nomad"
13
+ spec.description = "This CLI Ruby Gem provides users the most up-to-date web dev and design jobs from 'Remoteok.io'"
14
+ spec.homepage = "https://github.com/KimGonzales/digital_nomad_jobs"
15
+ spec.license = "MIT"
16
+
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
+ #spec.bindir = "exe"
22
+ spec.executables << 'digital-nomad-jobs'
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.16"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ spec.add_development_dependency "pry", '~> 0.11.3'
29
+
30
+ spec.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.1'
31
+ spec.add_dependency "colorize", "~>0.8.1"
32
+
33
+ end
@@ -0,0 +1,11 @@
1
+ require "nokogiri"
2
+ require "open-uri"
3
+ require "pry"
4
+ require "colorize"
5
+ require "colorized_string"
6
+
7
+ require_relative "./digital_nomad_jobs/version"
8
+ require_relative "./digital_nomad_jobs/cli"
9
+ require_relative "./digital_nomad_jobs/company"
10
+ require_relative "./digital_nomad_jobs/job"
11
+ require_relative "./digital_nomad_jobs/scraper"
@@ -0,0 +1,218 @@
1
+ class DigitalNomadJobs::CLI
2
+
3
+ PATH =('https://remoteok.io')
4
+
5
+ def call
6
+ welcome
7
+ main_menu
8
+ end
9
+
10
+ #---------------------------------- CLI MENUS ----------------------------------#
11
+
12
+ def welcome
13
+ puts "================================================".blue
14
+ puts ") Welcome to DIGITAL NOMAD JOBS! (".blue
15
+ puts "================================================".blue
16
+ puts " LET'S EXPLORE ".white.on_blue
17
+ end
18
+
19
+
20
+ def main_menu
21
+ puts ""
22
+ puts "======== 🌎 MAIN MENU 🌎 ===========".blue
23
+ puts " ".blue
24
+ puts " What Are You Looking For?".blue
25
+ puts ""
26
+ puts "Enter '1' for The Latest Web Developer Jobs"
27
+ puts "Enter '2' for The Latest UX/UI & Web Design Jobs"
28
+ puts "Enter '3' for The Latest Remote Jobs"
29
+ puts "Enter '0' or type 'exit' to exit"
30
+ puts ""
31
+ puts "========= x x x x x x x =============".blue
32
+ select_job_maker
33
+ end
34
+
35
+
36
+ def list_menu
37
+ puts "=========== LIST MENU ===================".blue
38
+ puts ""
39
+ puts "Enter '1' For A List of The Most Recent Job Postings"
40
+ puts "Enter '2' For A List of The Companies Hiring"
41
+ puts "Enter '0' To Exit"
42
+ puts "Enter 'Main' To Go Back To The Main Menu"
43
+ puts "================================================".blue
44
+ user_input = gets.strip.to_s
45
+
46
+ case user_input
47
+ when '1'
48
+ display_jobs
49
+ when '2'
50
+ display_companies
51
+ when 'Main', 'main'
52
+ main_menu
53
+ when '0', 'exit'
54
+ puts "Thanks for Visiting!"
55
+ exit
56
+ else
57
+ error
58
+ list_menu
59
+ end
60
+ end
61
+
62
+
63
+ def navigation
64
+ puts ""
65
+ puts "======== NAVIGATION ===========".blue
66
+ puts " Where Ya Headed Now?".blue
67
+ puts ""
68
+ puts "Enter 'Main' to go Back to the Main Menu"
69
+ puts "Enter 'List' To Go Back to the List Menu"
70
+ puts "Enter 'Exit' to Exit."
71
+ puts "========= x x x x x x x =============".blue
72
+ puts ""
73
+ input = gets.strip.to_s
74
+
75
+ case input
76
+ when 'main', 'Main'
77
+ main_menu
78
+ when 'list', 'List'
79
+ list_menu
80
+ when 'exit', 'Exit'
81
+ exit
82
+ else
83
+ puts 'Not All Those Who Wander Are Lost... But You Might Be!'.cyan
84
+ error
85
+ navigation
86
+ end
87
+ end
88
+
89
+ #---------------------------------- CLI INPUT SELECTORS ----------------------------------#
90
+
91
+ def select_job_maker
92
+ input = gets.strip.to_s
93
+ case input
94
+ when '1'
95
+ make_dev_jobs
96
+ when '2'
97
+ make_design_jobs
98
+ when '3'
99
+ make_all_the_jobs
100
+ when '0','exit'
101
+ puts "Bye!".blue
102
+ exit
103
+ else
104
+ puts "Whoops! Please enter a valid option.".magenta
105
+ main_menu
106
+ end
107
+ end
108
+
109
+
110
+ def select_company
111
+ puts ""
112
+ puts "Enter The Number of A Company To See It's Recent Job Posts"
113
+ cn = gets.strip.to_i
114
+ if valid_company?(cn)
115
+ comp = DigitalNomadJobs::Company.all[cn-1]
116
+ comp.print_company_jobs
117
+ navigation
118
+ else
119
+ error
120
+ select_company
121
+ end
122
+ end
123
+
124
+
125
+ def valid_company?(input)
126
+ input.between?(1, DigitalNomadJobs::Company.all.size)
127
+ end
128
+
129
+
130
+ def valid_job?(input)
131
+ input.between?(1, DigitalNomadJobs::Job.all.size)
132
+ end
133
+
134
+
135
+ def select_job
136
+ puts ""
137
+ puts "Enter The Number of a Job Post For a Detailed Description"
138
+ jp = gets.strip.to_i
139
+
140
+ if valid_job?(jp)
141
+ job = DigitalNomadJobs::Job.all[jp - 1]
142
+ job.print_job_description
143
+ navigation
144
+ else
145
+ error
146
+ select_job
147
+ end
148
+ end
149
+
150
+ def error
151
+ puts 'Whoops! Please Enter A Valid Option.'.magenta
152
+ end
153
+ #------------------------------------ CLI JOB FACTORY --------------------------------------#
154
+
155
+ def make_dev_jobs
156
+ DigitalNomadJobs::Job.reset
157
+ DigitalNomadJobs::Company.reset
158
+ job_array = DigitalNomadJobs::Scraper.scrape_jobs(PATH + '/remote-dev-jobs')
159
+ DigitalNomadJobs::Job.create_from_collection(job_array)
160
+ puts ""
161
+ puts ' 🖥️ '
162
+ puts "------------------------------------------------".blue
163
+ puts " NABBING WEB DEVELOPER JOBS ".white.on_blue
164
+ add_descriptions_to_jobs
165
+ list_menu
166
+ end
167
+
168
+
169
+ def make_design_jobs
170
+ DigitalNomadJobs::Job.reset
171
+ DigitalNomadJobs::Company.reset
172
+ job_array = DigitalNomadJobs::Scraper.scrape_jobs(PATH + '/remote-design-jobs')
173
+ DigitalNomadJobs::Job.create_from_collection(job_array)
174
+ puts ""
175
+ puts " 🎨 "
176
+ puts "------------------------------------------------".blue
177
+ puts " LOADING WEB DESIGN JOBS ".white.on_blue
178
+ add_descriptions_to_jobs
179
+ list_menu
180
+ end
181
+
182
+
183
+ def make_all_the_jobs
184
+ DigitalNomadJobs::Job.reset
185
+ DigitalNomadJobs::Company.reset
186
+ job_array = DigitalNomadJobs::Scraper.scrape_jobs(PATH)
187
+ DigitalNomadJobs::Job.create_from_collection(job_array)
188
+ puts ""
189
+ puts " 🌎 "
190
+ puts "------------------------------------------------".blue
191
+ puts " NABBING THE NEWEST REMOTE JOBS ".white.on_blue
192
+ add_descriptions_to_jobs
193
+ list_menu
194
+ end
195
+
196
+
197
+ def add_descriptions_to_jobs
198
+ DigitalNomadJobs::Job.all.each do |job|
199
+ description_hash = DigitalNomadJobs::Scraper.scrape_descriptions(PATH + job.job_url)
200
+ job.add_job_description(description_hash)
201
+ end
202
+ end
203
+
204
+ #-------------------------------- CLI DISPLAY METHODS -----------------------------#
205
+
206
+ def display_companies
207
+ DigitalNomadJobs::Company.list_companies
208
+ select_company
209
+ end
210
+
211
+
212
+ def display_jobs
213
+ DigitalNomadJobs::Job.list_all_jobs
214
+ select_job
215
+ end
216
+
217
+
218
+ end
@@ -0,0 +1,63 @@
1
+ class DigitalNomadJobs::Company
2
+
3
+ @@all = []
4
+ attr_accessor :name, :company_url
5
+ attr_reader :jobs
6
+
7
+ def initialize(name)
8
+ @name = name
9
+ @jobs = []
10
+ @@all << self
11
+ end
12
+
13
+ def self.find_by_name(name)
14
+ @@all.find {|company| company.name == name}
15
+ end
16
+
17
+ def self.create_by_name(name)
18
+ company = self.new(name)
19
+ end
20
+
21
+ def self.find_or_create_by_name(name)
22
+ find_by_name(name) || create_by_name(name)
23
+ end
24
+
25
+ def self.all
26
+ @@all
27
+ end
28
+
29
+ def self.reset
30
+ @@all.clear
31
+ end
32
+
33
+ def add_job(job)
34
+ @jobs << job
35
+ job.company = self.name
36
+ end
37
+
38
+ def self.list_companies
39
+ puts ""
40
+ puts "============ COMPANIES NOW HIRING! =============".blue
41
+ puts "================================================".blue
42
+ puts ""
43
+ all.each.with_index(1) do |company, i|
44
+ puts "#{i}. #{company.name}"
45
+ end
46
+ puts "================================================".blue
47
+ end
48
+
49
+ def print_company_jobs
50
+ puts ""
51
+ puts "#{self.name.upcase} IS LOOKING TO FILL THESE POSITIONS!".white.on_blue
52
+ puts "-----------------------------------------------------------------------------------------------".blue
53
+ jobs.each.with_index(1) do |job, i|
54
+ puts "#{i}. #{job.title} - Posted:#{job.time_posted} Ago"
55
+ puts ""
56
+ puts "About: ".blue + "#{job.description}"
57
+ puts ""
58
+ puts "TO APPLY OR SEE MORE FROM #{self.name.upcase} VISIT: ".blue + "#{'https://remoteok.io' + self.company_url}"
59
+ puts "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -".blue
60
+ end
61
+ puts "-----------------------------------------------------------------------------------------------".blue
62
+ end
63
+ end
@@ -0,0 +1,55 @@
1
+ class DigitalNomadJobs::Job
2
+
3
+ attr_accessor :title, :company, :description, :job_url, :skills, :time_posted
4
+ @@all = [ ]
5
+
6
+ def initialize(attributes)
7
+ attributes.each {|key, value| self.send(("#{key}="), value) unless key == :company_url}
8
+ @@all << self
9
+ company = DigitalNomadJobs::Company.find_or_create_by_name(self.company)
10
+ company.add_job(self)
11
+ company.company_url = attributes[:company_url]
12
+ end
13
+
14
+ def self.create_from_collection(array)
15
+ array.each do | hash |
16
+ job = new(hash)
17
+ end
18
+ end
19
+
20
+ def add_job_description(hash)
21
+ hash.each {|key, value| self.send(("#{key}="), value)}
22
+ end
23
+
24
+ def self.all
25
+ @@all
26
+ end
27
+
28
+ def self.reset
29
+ @@all.clear
30
+ end
31
+
32
+ def self.list_all_jobs
33
+ all.each.with_index(1) do | job, i |
34
+ puts "-----------------------------------------------------------------------------------------------".blue
35
+ puts "#{i}. #{job.title} - #{job.company} - Posted:#{job.time_posted} Ago"
36
+ puts "-----------------------------------------------------------------------------------------------".blue
37
+ puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX".blue
38
+ end
39
+ end
40
+
41
+ def print_job_description
42
+ puts "==========================================================================================".blue
43
+ puts ""
44
+ puts "Position: ".blue + "#{self.title}"
45
+ puts "Company: ".blue + "#{self.company}"
46
+ puts "Posted: ".blue + "#{self.time_posted} ago"
47
+ puts "Tags: ".blue + "#{self.skills}"
48
+ puts ""
49
+ puts "Description: ".blue + "#{self.description}"
50
+ puts ""
51
+ puts "Learn More or Apply at: ".blue + "#{'https://remoteok.io' + self.job_url}"
52
+ puts "==========================================================================================".blue
53
+ end
54
+
55
+ end
@@ -0,0 +1,30 @@
1
+ class DigitalNomadJobs::Scraper
2
+
3
+ def self.scrape_jobs(url)
4
+ html = open(url)
5
+ doc = Nokogiri::HTML(html)
6
+ posts = doc.css(".company_and_position_mobile")
7
+
8
+ job_array = posts.first(20).collect do |post|
9
+ {:title => post.css('h2').text,
10
+ :company => post.css('.preventLink h3').text,
11
+ :job_url => post.css('a')[0]['href'],
12
+ :company_url => post.css('a')[1]['href'],}
13
+ end
14
+ end
15
+
16
+ def self.scrape_descriptions(job_url)
17
+ html = open(job_url)
18
+ page = Nokogiri::HTML(html)
19
+
20
+ details = {}
21
+ details[:description] = page.css('.description').text
22
+ details[:time_posted] = page.css('.time').text
23
+ details[:skills] = page.css('.tags').text.gsub('3>', ' | ').insert(0,' | ')
24
+
25
+ details
26
+ end
27
+
28
+
29
+ end
30
+
@@ -0,0 +1,3 @@
1
+ module DigitalNomadJobs
2
+ VERSION = "0.1.0"
3
+ end
data/spec.md ADDED
@@ -0,0 +1,13 @@
1
+ # Specifications for the CLI Assessment
2
+
3
+ Specs:
4
+ - [x] Have a CLI for interfacing with the application
5
+ - The Digtal Nomad Jobs Gem is a Cli application that allows users to
6
+ access job or company information based on the information they input to the application.
7
+
8
+ - [x] Pull data from an external source
9
+ - Digital Nomad Jobs scraps the website 'Remoteok.io'
10
+
11
+ - [x] Implement both list and detail views
12
+ - Users have access to a list of job postings and a list of hiring companies. From that list view, users can enter a job or company number that they would like to know more about and obtain detailed information from the CLI.
13
+
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: digital_nomad_jobs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kim Gonzales
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-07 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: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.11.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.11.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: nokogiri
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.8'
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 1.8.1
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '1.8'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.8.1
89
+ - !ruby/object:Gem::Dependency
90
+ name: colorize
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 0.8.1
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.8.1
103
+ description: This CLI Ruby Gem provides users the most up-to-date web dev and design
104
+ jobs from 'Remoteok.io'
105
+ email:
106
+ - Kimgo589@gmail.com
107
+ executables:
108
+ - digital-nomad-jobs
109
+ extensions: []
110
+ extra_rdoc_files: []
111
+ files:
112
+ - ".gitignore"
113
+ - ".rspec"
114
+ - ".travis.yml"
115
+ - CODE_OF_CONDUCT.md
116
+ - Gemfile
117
+ - Gemfile.lock
118
+ - LICENSE.txt
119
+ - README.md
120
+ - Rakefile
121
+ - bin/console
122
+ - bin/digital-nomad-jobs
123
+ - bin/setup
124
+ - digital_nomad_jobs.gemspec
125
+ - lib/digital_nomad_jobs.rb
126
+ - lib/digital_nomad_jobs/cli.rb
127
+ - lib/digital_nomad_jobs/company.rb
128
+ - lib/digital_nomad_jobs/job.rb
129
+ - lib/digital_nomad_jobs/scraper.rb
130
+ - lib/digital_nomad_jobs/version.rb
131
+ - spec.md
132
+ homepage: https://github.com/KimGonzales/digital_nomad_jobs
133
+ licenses:
134
+ - MIT
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options: []
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 2.7.6
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: Remote Jobs for The Digital Nomad
156
+ test_files: []