Class: RemoteJobScraper::CLI
- Inherits:
-
Thor
- Object
- Thor
- RemoteJobScraper::CLI
- Defined in:
- lib/remote_job_scraper.rb
Instance Method Summary collapse
- #collect_jobs ⇒ Object
- #collect_jobs_from(site) ⇒ Object
- #generate_summary ⇒ Object
- #remove(dirname = 'data') ⇒ Object
Instance Method Details
#collect_jobs ⇒ Object
23 24 25 26 27 |
# File 'lib/remote_job_scraper.rb', line 23 def collect_jobs [Sites::WeWorkRemotely, Sites::RemoteOk].each do |klass| klass.new.collect_jobs end end |
#collect_jobs_from(site) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/remote_job_scraper.rb', line 30 def collect_jobs_from(site) case site when 'we_work_remotely' then Sites::WeWorkRemotely.new.collect_jobs when 'remote_ok' then Sites::RemoteOk.new.collect_jobs when '42jobs_rails' then Sites::JobsRails42.new.collect_jobs else raise "#{site} is not correct. Use: #{AVAILABLE_SITES.join(', ')}." end end |
#generate_summary ⇒ Object
44 45 46 |
# File 'lib/remote_job_scraper.rb', line 44 def generate_summary Support::SpreadsheetCreator.generate end |
#remove(dirname = 'data') ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/remote_job_scraper.rb', line 49 def remove(dirname = 'data') puts "[Warning!]" puts "This command will remove #{Dir.pwd}/#{dirname} permanently" puts "Press Ctrl-C to abort." sleep 3 FileUtils.rm_rf(dirname) puts "Removed data in #{Dir.pwd}/#{dirname}." end |