remote_job_scraper 0.4.1 → 0.4.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 +1 -1
- data/README.md +2 -9
- data/lib/remote_job_scraper/version.rb +1 -1
- data/lib/support/spreadsheet_creator.rb +20 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72ba313413dc7997be5ff27cd80872eadf9a6a42
|
4
|
+
data.tar.gz: f60d2785e8577ef7a1e567d5753eba66f0957912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aecc4a83e5c4a9737db7feca2029effcae08a618796c3dbe8b87f81c4373e1eee25cdc7726ebca1b8c220650840d7d0d59298e1c20291a5dc52bdfd29b4eadd
|
7
|
+
data.tar.gz: 54382e1d93daf8f50fc92ee79cc80a3527e93a1fbdceb5006e2db1ea4de71e2523cfce148ded18d59296bd79e8dca8121800b3afbe93815fb6858959653da3c6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -13,10 +13,10 @@ Going through many job listings and finding the right one may be a time-consumin
|
|
13
13
|
|
14
14
|
$ remote_job_scraper
|
15
15
|
|
16
|
-
*
|
16
|
+
* Supported Ruby versions:
|
17
17
|
|
18
18
|
* [x] 2.4.1
|
19
|
-
* [
|
19
|
+
* [ ] 2.0.0 (https://github.com/rafaltrojanowski/remote_job_scraper/issues/1)
|
20
20
|
|
21
21
|
## Development
|
22
22
|
|
@@ -24,13 +24,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
24
24
|
|
25
25
|
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).
|
26
26
|
|
27
|
-
## Todo
|
28
|
-
|
29
|
-
* [] Set offer limit through config (processing RemoteOk is very slow)
|
30
|
-
* [] Get rid if of all `if ENV['RAILS_ENV'] == test`
|
31
|
-
* [] Grab more data e.g. Company name
|
32
|
-
* [] Unify columns for sites and add headers in CSV/Excel (region)
|
33
|
-
|
34
27
|
## Contributing
|
35
28
|
|
36
29
|
Bug reports and pull requests are welcome on GitHub at https://github.com/rafaltrojanowski/remote_job_scraper. 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.
|
@@ -3,13 +3,15 @@ require 'spreadsheet'
|
|
3
3
|
module Support
|
4
4
|
module SpreadsheetCreator
|
5
5
|
|
6
|
-
def self.generate(
|
6
|
+
def self.generate(base_path: 'data/summary/', filename: 'remote_job_summary.xls')
|
7
7
|
Spreadsheet.client_encoding = 'UTF-8'
|
8
8
|
book = Spreadsheet::Workbook.new
|
9
9
|
|
10
10
|
dirnames.each_with_index do |dirname, index|
|
11
11
|
file = Dir.glob(dirname).first
|
12
12
|
sheet = book.create_worksheet name: dirname.split("/")[-2]
|
13
|
+
column_width.each { |idx, width| sheet.column(idx).width = width }
|
14
|
+
|
13
15
|
next if file.nil?
|
14
16
|
|
15
17
|
CSV.foreach(file).with_index(0) do |row, index|
|
@@ -17,10 +19,24 @@ module Support
|
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
|
-
FileUtils.mkdir_p absolute_path(
|
22
|
+
FileUtils.mkdir_p absolute_path(base_path)
|
23
|
+
book.write filepath(base_path, filename)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.column_width
|
27
|
+
{
|
28
|
+
0 => 90,
|
29
|
+
1 => 20,
|
30
|
+
2 => 20,
|
31
|
+
3 => 20
|
32
|
+
}
|
33
|
+
end
|
21
34
|
|
22
|
-
|
23
|
-
|
35
|
+
def self.filepath(path, filename)
|
36
|
+
absolute_path(path).concat(
|
37
|
+
Time.now.strftime("%Y%m%d%H%M%S")
|
38
|
+
.concat('_')
|
39
|
+
.concat(filename)
|
24
40
|
)
|
25
41
|
end
|
26
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_job_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Trojanowski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|