laddro-career 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/laddro/client.rb +42 -1
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3223cb1c47a28a841c9a997bd8e87f6a25fd09a05603b272f99d95429b8708f
4
- data.tar.gz: bea19fa64c7a69566b4deee620a4dd96ea53ac7401e6d1d9b2bff55daeebb942
3
+ metadata.gz: 6d7d907d91233d48768c74575797a6cad95c8e46c65a03f8f39cfa0c02e74cdb
4
+ data.tar.gz: 88862c60c18d686432538dbd45f034c15df73834feda8725ea38390183c19b5e
5
5
  SHA512:
6
- metadata.gz: c577e3d08890b6fbaff28578099e68218e0509ab4ee7263cdd9210ed2be52993c10c699e0808c897a6c1dc5c14dcf76754e06b85ff6600ba5780443312e51841
7
- data.tar.gz: 016b868020aafe548b43460a3ceb680f183808aaefa81dcd76c2ba25a72853f2d6815389ced644bdbf69c06335490d0db8263b614d70bb34a7dc7bb6980660ea
6
+ metadata.gz: 28e2cb21a88f88d7446d53d7e5aa2f45e3a0ea44cd4f7cfb8fea854b5ca22f7639f303b75bf50bdfbbb4cdade5f4e5d44f66e09352a32eb1a9ef5113f892e3f3
7
+ data.tar.gz: c810454bb3d32d216f88cc39830c50bea860b115afa4f428dd7bc9eff5fd1fd8fa1d972daadcba088cdfcf6e7a64e5f15d0b6f17c3f13ae8b6093d3ce72da79c
data/lib/laddro/client.rb CHANGED
@@ -47,6 +47,10 @@ module Laddro
47
47
  post_binary("/v1/tailor", request)
48
48
  end
49
49
 
50
+ def tailor_detailed(request)
51
+ post_binary_detailed("/v1/tailor", request)
52
+ end
53
+
50
54
  def export_pdf(request)
51
55
  post_binary("/v1/export", request)
52
56
  end
@@ -67,6 +71,10 @@ module Laddro
67
71
  post_binary("/v1/cover-letters/generate", request)
68
72
  end
69
73
 
74
+ def generate_cover_letter_detailed(request)
75
+ post_binary_detailed("/v1/cover-letters/generate", request)
76
+ end
77
+
70
78
  def render_cover_letter(id, options)
71
79
  put_binary("/v1/cover-letters/#{id}/render", options)
72
80
  end
@@ -105,6 +113,10 @@ module Laddro
105
113
  request_binary(:post, path, body)
106
114
  end
107
115
 
116
+ def post_binary_detailed(path, body)
117
+ request_binary_detailed(:post, path, body)
118
+ end
119
+
108
120
  def put_binary(path, body)
109
121
  request_binary(:put, path, body)
110
122
  end
@@ -116,9 +128,16 @@ module Laddro
116
128
  end
117
129
 
118
130
  def request_binary(method, path, body = nil)
131
+ request_binary_detailed(method, path, body)[:data]
132
+ end
133
+
134
+ def request_binary_detailed(method, path, body = nil)
119
135
  response = execute(method, path, body)
120
136
  handle_error(response) unless response.is_a?(Net::HTTPSuccess)
121
- response.body
137
+ {
138
+ data: response.body,
139
+ metadata: artifact_metadata(response)
140
+ }
122
141
  end
123
142
 
124
143
  def execute(method, path, body)
@@ -149,5 +168,27 @@ module Laddro
149
168
  code = body["code"]
150
169
  raise APIError.new(message, response.code.to_i, code)
151
170
  end
171
+
172
+ def artifact_metadata(response)
173
+ {
174
+ resume_id: response["x-resume-id"],
175
+ cover_letter_id: response["x-cover-letter-id"],
176
+ filename: content_disposition_filename(response["content-disposition"]),
177
+ mime_type: response["content-type"]&.split(";")&.first
178
+ }
179
+ end
180
+
181
+ def content_disposition_filename(value)
182
+ return nil unless value
183
+
184
+ value.split(";").each do |part|
185
+ key, filename = part.strip.split("=", 2)
186
+ next unless key&.downcase&.start_with?("filename")
187
+
188
+ filename = filename.to_s.delete_prefix("UTF-8''").delete_prefix('"').delete_suffix('"')
189
+ return URI.decode_www_form_component(filename)
190
+ end
191
+ nil
192
+ end
152
193
  end
153
194
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laddro-career
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laddro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-10 00:00:00.000000000 Z
11
+ date: 2026-05-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tailor resumes, generate cover letters, and export PDFs via the Laddro
14
14
  Career API
@@ -26,7 +26,7 @@ licenses:
26
26
  metadata:
27
27
  source_code_uri: https://github.com/laddro-app/laddro-career-sdk-ruby
28
28
  homepage_uri: https://docs.laddro.com
29
- post_install_message:
29
+ post_install_message:
30
30
  rdoc_options: []
31
31
  require_paths:
32
32
  - lib
@@ -41,8 +41,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  requirements: []
44
- rubygems_version: 3.0.3.1
45
- signing_key:
44
+ rubygems_version: 3.4.19
45
+ signing_key:
46
46
  specification_version: 4
47
47
  summary: Ruby SDK for the Laddro Career API
48
48
  test_files: []