adp-downloader 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/adp-downloader/config.rb +3 -1
- data/lib/adp-downloader/runner.rb +1 -0
- data/lib/adp-downloader/statement/statement.rb +7 -2
- data/lib/adp-downloader/version.rb +1 -1
- 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: 74636952a5502d798d4324d53ee023be0b73af7d
|
4
|
+
data.tar.gz: f861249c96f55e16bb560abff6796ce50a024155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd8ff91bf6864ad6d46b197aa58d764e757e68251556080db71143c05886cd10af5a9ad5a0e688ca4600b6ef905367802a5ba3df54592a30d83b719e3d37a2cd
|
7
|
+
data.tar.gz: 27ee300c652947c7b85e6df5e9309600d195ad92c9d0aeeecfab60b9e67364e43ae781e388cde63d3d0f3644950bed23126b30872767d1bab6462f988de2131a
|
data/README.md
CHANGED
@@ -30,6 +30,9 @@ Go to the directory where you want the pay stubs to be saved and run:
|
|
30
30
|
|
31
31
|
adp-downloader
|
32
32
|
|
33
|
+
# if you want to download stubs from multiple employers/accounts
|
34
|
+
adp-downloader --employer <employername>
|
35
|
+
|
33
36
|
Enter your credentials and profit: all pay statements currently
|
34
37
|
available will be downloaded, both in JSON and PDF formats. When you
|
35
38
|
receive your next paycheck, just go back to the directory and re-run
|
@@ -41,8 +44,12 @@ If you want to run it automatically (e.g. in a cron job), create or edit
|
|
41
44
|
you local [`.netrc` file][netrc] (usually in your home directory, unless
|
42
45
|
you put it somewhere else) with your credentials:
|
43
46
|
|
47
|
+
# in case of a single employer/account
|
44
48
|
machine adp-downloader login ___username___ password ___password___
|
45
49
|
|
50
|
+
# for multiple employers/accounts
|
51
|
+
machine adp-downloader-employername login ___username___ password ___password___
|
52
|
+
|
46
53
|
Adding your credentials to this file will skip the interactive step.
|
47
54
|
|
48
55
|
|
@@ -5,6 +5,7 @@ module ADPDownloader
|
|
5
5
|
class Config
|
6
6
|
class << self
|
7
7
|
attr_writer :quiet
|
8
|
+
attr_accessor :employer
|
8
9
|
|
9
10
|
def credentials
|
10
11
|
from_netrc or from_stdin
|
@@ -21,7 +22,8 @@ module ADPDownloader
|
|
21
22
|
|
22
23
|
def from_netrc
|
23
24
|
n = Netrc.read
|
24
|
-
|
25
|
+
credential_string = [MACHINE_NAME, employer].compact.join('-')
|
26
|
+
username, password = n[credential_string]
|
25
27
|
creds(username, password) if username and password
|
26
28
|
end
|
27
29
|
|
@@ -33,6 +33,7 @@ module ADPDownloader
|
|
33
33
|
def parse_options
|
34
34
|
options = OptionParser.new
|
35
35
|
options.banner = "Usage: adp-downloader [options]"
|
36
|
+
options.on("-e", "--employer EMP", "Employer name") { |e| Config.employer = e }
|
36
37
|
options.on("-v", "--quiet", "Only display errors") { Config.quiet = true }
|
37
38
|
options.on("-h", "--help", "Show this message") { puts(options); exit }
|
38
39
|
options.parse!(@arguments)
|
@@ -21,6 +21,11 @@ module ADPDownloader
|
|
21
21
|
[date, id, file_suffix].compact.join("-")
|
22
22
|
end
|
23
23
|
|
24
|
+
def full_path(name)
|
25
|
+
parts = [Config.employer, year, name].compact
|
26
|
+
File.join(*parts)
|
27
|
+
end
|
28
|
+
|
24
29
|
def file_suffix
|
25
30
|
nil
|
26
31
|
end
|
@@ -35,11 +40,11 @@ module ADPDownloader
|
|
35
40
|
end
|
36
41
|
|
37
42
|
def pdf
|
38
|
-
|
43
|
+
full_path("#{filename}.pdf")
|
39
44
|
end
|
40
45
|
|
41
46
|
def json
|
42
|
-
|
47
|
+
full_path("#{filename}.json")
|
43
48
|
end
|
44
49
|
|
45
50
|
def _(string)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adp-downloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anderson Mesquita (andersonvom)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|