embulk-output-kintone 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29cb270e92a0d79d50c33b6e4e6622d7bab0c6b9
4
- data.tar.gz: 8ea4ec1c7e157a99aaf364d8adf0e17387e5c363
3
+ metadata.gz: 7107e79ed02bf30d233e34a3606bc84851e65b04
4
+ data.tar.gz: 4c8c90cd5f2e3c72a3b1cb10f4b0f3373c626a06
5
5
  SHA512:
6
- metadata.gz: 9ee3d4c0d1e8a015064a5c4683bc5ee23c06c4da172315a068c715abca55b865f2481e0a2aca5d094b9a35ed3f07118be7d23064995073b54e33c39b64017afa
7
- data.tar.gz: 30bc14642e24cadd7af74b7ffb5fe7b03d5be8f93989ea496f9577587f18066342ddf2c9c5e2b93b03f1f0087662fd5554cb268efab5c0bc08ad2cd767d5e3f4
6
+ metadata.gz: ec15b3471eb9cca3b7804a62f3beed3242e6ef8c4b547d5995f826fb9840f0505e5705ae26856a27dea5653caf0500d9bde3e58de39e0f385ec51a428d024379
7
+ data.tar.gz: ab6ea4f392578a902bd778136e5b2b9972f93b0836aa515db48110001e6b984c867a11c7fb2cb08192afb3d8eda334b8e72ff007b7704984f98ea84cc4d91e08
data/build.gradle CHANGED
@@ -4,6 +4,7 @@ plugins {
4
4
  id "com.github.johnrengelman.shadow" version "4.0.3"
5
5
  id "java"
6
6
  id "checkstyle"
7
+ id "com.palantir.git-version" version "0.12.3"
7
8
  }
8
9
  import com.github.jrubygradle.JRubyExec
9
10
  repositories {
@@ -14,7 +15,15 @@ configurations {
14
15
  provided
15
16
  }
16
17
 
17
- version = "0.3.1"
18
+ version = {
19
+ def vd = versionDetails()
20
+ if (vd.commitDistance == 0 && vd.lastTag ==~ /^[0-9]+\.[0-9]+\.[0-9]$/) {
21
+ vd.lastTag
22
+ } else {
23
+ "0.0.0.${vd.gitHash}"
24
+ }
25
+ }()
26
+
18
27
 
19
28
  sourceCompatibility = 1.8
20
29
  targetCompatibility = 1.8
@@ -193,11 +193,17 @@ public class KintoneColumnVisitor
193
193
  {
194
194
  String fieldCode = getFieldCode(column);
195
195
  FieldType type = getType(column, FieldType.MULTI_LINE_TEXT);
196
+ Object value = pageReader.getString(column);
196
197
  if (type == FieldType.CHECK_BOX) {
197
- setCheckBoxValue(fieldCode, pageReader.getString(column), getValueSeparator(column));
198
+ String stringValue = Objects.toString(value, "");
199
+ if (stringValue == "") {
200
+ return;
201
+ } else {
202
+ setCheckBoxValue(fieldCode, value, getValueSeparator(column));
203
+ }
198
204
  return;
199
205
  }
200
- setValue(fieldCode, pageReader.getString(column), type, isUpdateKey(column));
206
+ setValue(fieldCode, value, type, isUpdateKey(column));
201
207
  }
202
208
 
203
209
  @Override
@@ -119,7 +119,11 @@ public class KintonePageOutput
119
119
  private void execute(Consumer<KintoneClient> operation)
120
120
  {
121
121
  connect(task);
122
- operation.accept(this.client);
122
+ if (this.client != null) {
123
+ operation.accept(this.client);
124
+ } else {
125
+ throw new RuntimeException("Failed to connect to kintone.");
126
+ }
123
127
  }
124
128
 
125
129
  private void insertPage(final Page page)
@@ -309,11 +313,12 @@ public class KintonePageOutput
309
313
  case SINGLE_LINE_TEXT:
310
314
  return distRecords
311
315
  .stream()
312
- .anyMatch(d -> d.getSingleLineTextFieldValue(fieldCode).equals(updateKey.getValue()));
316
+ .anyMatch(d -> d.getSingleLineTextFieldValue(fieldCode).equals(updateKey.getValue().toString()));
313
317
  case NUMBER:
314
318
  return distRecords
315
319
  .stream()
316
- .anyMatch(d -> d.getNumberFieldValue(fieldCode).equals(updateKey.getValue()));
320
+ .anyMatch(d -> d.getNumberFieldValue(fieldCode).toPlainString()
321
+ .equals(updateKey.getValue().toString()));
317
322
  default:
318
323
  throw new RuntimeException("The update_key must be 'SINGLE_LINE_TEXT' or 'NUMBER'.");
319
324
  }
@@ -45,7 +45,7 @@ public interface PluginTask
45
45
  Map<String, KintoneColumnOption> getColumnOptions();
46
46
 
47
47
  @Config("mode")
48
- @ConfigDefault("insert")
48
+ @ConfigDefault("\"insert\"")
49
49
  String getMode();
50
50
 
51
51
  @Config("update_key")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-kintone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - takeshi fujita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2023-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - build.gradle
55
- - classpath/embulk-output-kintone-0.3.1.jar
55
+ - classpath/embulk-output-kintone-0.3.3.jar
56
56
  - config/checkstyle/checkstyle.xml
57
57
  - config/checkstyle/default.xml
58
58
  - gradle/wrapper/gradle-wrapper.jar