ba_upload 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a97b2695bf77d8a8693710f458561034c58ae2a43e737863f283e65301e8aa65
4
- data.tar.gz: 8e3da29f1068f76f6f5320110ab68a99a0d3240e1b8d4ea589bb82771b02a676
3
+ metadata.gz: 929ae4afa02061b2855f56812284f7353e446b10a9d5c331f10d9bfee70df29b
4
+ data.tar.gz: 5897f8e1d95d1b4252c0ad34119d92ba608edd7482267ce539ce42bc3b6becb3
5
5
  SHA512:
6
- metadata.gz: 53b3dcee1f488d9b4758a03d9263bc6787a7b9b74680ef999d1ba1c01eb9625c3d2ea9210a2681a3804dd8727b43c9f745374e0f94567694a4470d9214c3d88a
7
- data.tar.gz: 262b6794309cf833bc0d2a6301c0a757d036a3ac917a54c2eb9cea1301c02456359fa4a886e33b028ca8a264ac64dfeaadee8e3b9c67a2f30b057645e2b1c587
6
+ metadata.gz: 572fb95d84d934a4679eb97621ecaf8205290328196a75ab4a5c900826ff4490f666cdfbc83b946cf7df67246ca51bf5c6ffe612ac1b0d5ecec36567b49c2954
7
+ data.tar.gz: 05d3339b30db3866917a28386fb7f080ba7e921aec04ff7d32b0bc52b7be66aa0601b0bb57f8708136774154e7e3b9863331a1013291d4ecacb52511f3f7da56
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 0.6.0
4
+
5
+ - Feat: Add `Connection#job_proposals` to list Vermittlungsvorschlag zip files from the BA `VV/` directory
6
+ - Feat: New `BaUpload::JobProposalFile` wrapper (binary-safe read/tempfile) analogous to `ErrorFile`
data/ba_upload.gemspec CHANGED
@@ -14,6 +14,11 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/pludoni/ba_upload"
15
15
  spec.license = "MIT"
16
16
 
17
+ spec.metadata = {
18
+ "source_code_uri" => "https://github.com/pludoni/ba_upload",
19
+ "changelog_uri" => "https://github.com/pludoni/ba_upload/blob/master/CHANGELOG.md",
20
+ }
21
+
17
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
23
  spec.bindir = "exe"
19
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -1,5 +1,6 @@
1
1
  require 'ba_upload/error_file'
2
2
  require 'ba_upload/statistic_file'
3
+ require 'ba_upload/job_proposal_file'
3
4
  module BaUpload
4
5
  class Connection
5
6
  attr_reader :m
@@ -40,6 +41,18 @@ module BaUpload
40
41
  end
41
42
  end
42
43
 
44
+ def job_proposals(partner_id: nil)
45
+ url = base_url(partner_id) + "VV/"
46
+ m.get(url)
47
+ m.page.links.reject { |l| l.href.to_s[/^\?|mailto:/] || l.href == "/" }.map do |link|
48
+ JobProposalFile.new(link)
49
+ end
50
+ rescue Mechanize::ResponseCodeError => e
51
+ return [] if e.response_code.to_i == 404
52
+
53
+ raise
54
+ end
55
+
43
56
  def misc(partner_id: nil)
44
57
  url = base_url(partner_id)
45
58
  m.get url
@@ -0,0 +1,25 @@
1
+ module BaUpload
2
+ class JobProposalFile
3
+ def initialize(mechanize_link)
4
+ @mechanize_link = mechanize_link
5
+ @link = mechanize_link.href
6
+ end
7
+
8
+ def read
9
+ response = @mechanize_link.click
10
+ response.body
11
+ end
12
+
13
+ def filename
14
+ @mechanize_link.text
15
+ end
16
+
17
+ def tempfile
18
+ tf = Tempfile.new(['job_proposal', '.zip'])
19
+ tf.binmode
20
+ tf.write(read)
21
+ tf.flush
22
+ tf
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module BaUpload
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.0
4
+ version: 0.6.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: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2026-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
@@ -70,12 +71,15 @@ files:
70
71
  - lib/ba_upload.rb
71
72
  - lib/ba_upload/connection.rb
72
73
  - lib/ba_upload/error_file.rb
74
+ - lib/ba_upload/job_proposal_file.rb
73
75
  - lib/ba_upload/statistic_file.rb
74
76
  - lib/ba_upload/version.rb
75
77
  homepage: https://github.com/pludoni/ba_upload
76
78
  licenses:
77
79
  - MIT
78
- metadata: {}
80
+ metadata:
81
+ source_code_uri: https://github.com/pludoni/ba_upload
82
+ changelog_uri: https://github.com/pludoni/ba_upload/blob/master/CHANGELOG.md
79
83
  post_install_message:
80
84
  rdoc_options: []
81
85
  require_paths:
@@ -91,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
95
  - !ruby/object:Gem::Version
92
96
  version: '0'
93
97
  requirements: []
94
- rubygems_version: 3.5.21
98
+ rubygems_version: 3.5.16
95
99
  signing_key:
96
100
  specification_version: 4
97
101
  summary: Upload API for Bundesagentur fuer Arbeit (hrbaxml.arbeitsagentur)