ba_upload 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/lib/ba_upload/connection.rb +17 -6
- data/lib/ba_upload/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15804867b016b8c972bbb18385a2d1caec4a9729776ea2d1877dcddaeb73b15d
|
4
|
+
data.tar.gz: 930ef0bf4b3817c43616873144a43e46e482d5baa1efc5f5db63038dd44fd6e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b906aa0b7c5860142c9c2d01f1f6955b8ccf8217448fd9164e293081f697ff9d43de2411989ff266a4729eb79a087a73fd56124e79159ec146fb29bd72fe6a2
|
7
|
+
data.tar.gz: fa9aaa0351fdf5758cb2a770e2b0105c6f599bae516f416ffa1ef25de58727f20b0180574086079474050042b253789dded4d58ce78e0edb55f81c146107e2cf
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ Save to a file and just run it with the xml file as argument
|
|
61
61
|
|
62
62
|
BA provides a often updated Position description databae ("VAM" Berufe). The Gem can help to download it:
|
63
63
|
|
64
|
-
```
|
64
|
+
```ruby
|
65
65
|
connection.misc.each do |link|
|
66
66
|
target = "vendor/ba/#{link.href}"
|
67
67
|
next if File.exist?(target)
|
@@ -70,6 +70,23 @@ connection.misc.each do |link|
|
|
70
70
|
end
|
71
71
|
```
|
72
72
|
|
73
|
+
### Usage with multiple client certificats
|
74
|
+
|
75
|
+
Since September 2022, users with multiple client certificats issued to the same email address need to provide their respective partner ID when using the API.
|
76
|
+
For user with only one certificat issued to their email address, providing the partner ID is optional.
|
77
|
+
|
78
|
+
The partner ID can be provided as an optional keyword argument to the `upload`, `error_files` and `misc` methods:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
require 'ba_upload'
|
82
|
+
connection = BaUpload.open_connection(file_path: 'config/Zertifikat-1XXXX.p12', passphrase: 'YOURPASSPHRASE')
|
83
|
+
|
84
|
+
connection.upload(file: 'your_file_path', partner_id: 'P000XXXXXX')
|
85
|
+
connection.error_files(partner_id: 'P000XXXXXX')
|
86
|
+
connection.misc(partner_id: 'P000XXXXXX')
|
87
|
+
|
88
|
+
```
|
89
|
+
|
73
90
|
## License
|
74
91
|
|
75
92
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/ba_upload/connection.rb
CHANGED
@@ -14,23 +14,26 @@ module BaUpload
|
|
14
14
|
@m.cert = @cert.path
|
15
15
|
end
|
16
16
|
|
17
|
-
def upload(file: nil)
|
18
|
-
|
17
|
+
def upload(file: nil, partner_id: nil)
|
18
|
+
url = base_url(partner_id) + "in/"
|
19
|
+
m.get url
|
19
20
|
form = m.page.forms.first
|
20
21
|
form.file_uploads.first.file_name = file
|
21
22
|
form.submit
|
22
23
|
end
|
23
24
|
|
24
|
-
def error_files
|
25
|
-
|
25
|
+
def error_files(partner_id: nil)
|
26
|
+
url = base_url(partner_id)
|
27
|
+
m.get url
|
26
28
|
links = m.page.links_with(text: /ESP|ESV/)
|
27
29
|
links.map do |link|
|
28
30
|
ErrorFile.new(link)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
|
-
def misc
|
33
|
-
|
34
|
+
def misc(partner_id: nil)
|
35
|
+
url = base_url(partner_id)
|
36
|
+
m.get url
|
34
37
|
m.page.links_with(text: /sonstiges/).first.click
|
35
38
|
m.page.links.reject { |i| i.href[/^\?|mailto:/] || i.href == '/' }
|
36
39
|
end
|
@@ -38,5 +41,13 @@ module BaUpload
|
|
38
41
|
def shutdown
|
39
42
|
m.shutdown
|
40
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def base_url(partner_id)
|
48
|
+
url = "https://hrbaxml.arbeitsagentur.de/"
|
49
|
+
url += "daten/#{partner_id}/" unless partner_id.nil?
|
50
|
+
url
|
51
|
+
end
|
41
52
|
end
|
42
53
|
end
|
data/lib/ba_upload/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ba_upload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Wienert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -90,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
|
94
|
-
rubygems_version: 2.7.6
|
93
|
+
rubygems_version: 3.0.3
|
95
94
|
signing_key:
|
96
95
|
specification_version: 4
|
97
96
|
summary: Upload API for Bundesagentur fuer Arbeit (hrbaxml.arbeitsagentur)
|