mawsitsit 0.1.14 → 0.1.16

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: 6bf107f10254c4381ea6ddb43804bab677e9d21652f88979c92aee21efe85bf0
4
- data.tar.gz: cae9847e3ed605ab6c9323883b4b04577455a42f52b3e27bc4f2305a39616122
3
+ metadata.gz: 7a409ba1e16eda39bf247662dd591410836837762c72df925f61d569880382f5
4
+ data.tar.gz: d942012dc8c5f52661085261af7ec0061da9f573b0c393c5a04026dcef1c578c
5
5
  SHA512:
6
- metadata.gz: 287bc58ab99f97a3f0c78c7ac71f558e5d3d40dafff21e7bcd41fdc08f3ddce1cbc2d152dd9cf035f332c5b97ad62f222d1d61016bde01ccaf68433e9716d7e4
7
- data.tar.gz: 61dfc1aec419c9e2665d71551bdcaf57bebf5e590a08e6a982d4ad413c6a82cc60af51451d8a1f942f552aa10f8c6060360f3bddf4f8684c947825d57183117e
6
+ metadata.gz: 450000bc0efef62b75fef2a5527addf42579479052bc8a5b58797e628bf37ca86b0a8e1af00078ef69daa60fc235eedea39d4c0c2b6b5c3d76ecd80139334d62
7
+ data.tar.gz: c39f153097cae9612732d6dea3f090c551a7e15e6d700d30b1c6b055c8ed7d006aeedd9da94d27e22b229f32efa86dec1bd2a37b6be59e05ebdf9efc257b7808
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ <a href="https://badge.fury.io/rb/mawsitsit"><img src="https://badge.fury.io/rb/mawsitsit.svg" alt="Gem Version" height="18"></a>
1
2
  # Mawsitsit
2
3
 
3
4
  TODO: Delete this and the text below, and describe your gem
@@ -141,8 +141,10 @@ pub fn like_lever(_args: &Value) -> Value {
141
141
  for value in arr {
142
142
  if let Value::Object(map) = value {
143
143
  if let Some(Value::Array(fields)) = map.get("fields") {
144
+ let mut num = 0;
144
145
  for field in fields {
145
- process_field(field, &mut new_appl);
146
+ process_field(field, &mut new_appl, "customQuestions", Some(num));
147
+ num += 1;
146
148
  }
147
149
  }
148
150
  }
@@ -152,7 +154,7 @@ pub fn like_lever(_args: &Value) -> Value {
152
154
  if let Some(Value::Array(arr)) = map.get("personalInformation") {
153
155
  for value in arr {
154
156
  if let Value::Object(_) = value {
155
- process_field(value, &mut new_appl);
157
+ process_field(value, &mut new_appl, "personalInformation", None);
156
158
  }
157
159
  }
158
160
  }
@@ -160,7 +162,7 @@ pub fn like_lever(_args: &Value) -> Value {
160
162
  if let Some(Value::Array(arr)) = map.get("urls") {
161
163
  for value in arr {
162
164
  if let Value::Object(_) = value {
163
- process_field(value, &mut new_appl);
165
+ process_field(value, &mut new_appl, "urls", None);
164
166
  }
165
167
  }
166
168
  }
@@ -177,12 +179,18 @@ pub fn like_lever(_args: &Value) -> Value {
177
179
  serde_json::Value::Array(new_appl)
178
180
  }
179
181
 
180
- fn process_field(value: &Value, new_appl: &mut Vec<serde_json::Value>) {
182
+ fn process_field(value: &Value, new_appl: &mut Vec<serde_json::Value>, ext_prefix: &str, ext_suffix: Option<u32>) {
181
183
  let question = value.get("text").and_then(Value::as_str).unwrap_or("Unknown question");
182
184
  let question_type = value.get("type").and_then(Value::as_str).unwrap_or("Unknown type");
183
185
  let ext_id = value.get("id").or_else(|| value.get("name"))
184
186
  .and_then(Value::as_str)
185
- .map(|s| format!("lever__{}", s))
187
+ .map(|s| {
188
+ if let Some(suffix) = ext_suffix {
189
+ format!("lever__{}__{}__{}",ext_prefix, s, suffix)
190
+ } else {
191
+ format!("lever__{}__{}",ext_prefix, s)
192
+ }
193
+ })
186
194
  .unwrap_or("Unknown question".to_string());
187
195
  let required = value.get("required").and_then(Value::as_bool).unwrap_or(false);
188
196
  let answer_options = value.get("options").and_then(Value::as_array).map(|array| {
@@ -216,11 +216,6 @@ impl JsonToJson {
216
216
  }
217
217
  *value = task_res;
218
218
  } else {
219
- let bin_spl:Vec<&str>= bin[0].split(".").collect();
220
- if bin_spl[0] == "ignore" {
221
- *value = bin[0].clone().into();
222
- return;
223
- }
224
219
  *value = reference
225
220
  .get_by_path(value_str)
226
221
  .map_or_else(|| serde_json::Value::Null, |v| v.clone().into());
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mawsitsit
4
- VERSION = "0.1.14"
4
+ VERSION = "0.1.16"
5
5
  end
@@ -25,8 +25,8 @@
25
25
  "city": "data.categories.allLocations-<flatten>",
26
26
  "address": null,
27
27
  "view_count": null,
28
- "created_at": null,
29
- "updated_at": null,
28
+ "created_at": "ignore.data.createdAt",
29
+ "updated_at": "ignore.data.updatedAt",
30
30
  "applications_count": null,
31
31
  "employer_rating": null,
32
32
  "job_notifications": null,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mawsitsit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Hummel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-29 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: