embulk-filter-to_json 0.0.4 → 0.0.5

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: 8a2d6613b30db7bf15e431eaa828fa6266548b09
4
- data.tar.gz: e4f4bdc55bca27448165e800a3e661c63bf21f00
3
+ metadata.gz: d8fbca15491e71b243c408b5754567d915cedf6e
4
+ data.tar.gz: e0b1398e5c5abc50b3898d500daaa15e463dffad
5
5
  SHA512:
6
- metadata.gz: 63edc8f69fc088734834d8672192c30fb44bb3cb6107eacb82a918fe2b2983e3156be8b5c0cd57fca0cb2d3898fcc615521647ee64ead6467ab6e7d3119e35f6
7
- data.tar.gz: f104fe440ab7d1b46579d22c3a93a51abd906c9af0534a592e568d6bed5f146cea7b5412efe4c17534f094309a87f664ae609c279dfb43225580291e0b650815
6
+ metadata.gz: 9beae4e09a010357a338dad9acbb6edd217dd8b392a530f8c1039cd654bfc255a2710fad14f1d90620699f602d4a23f945f2c84d3dea6b5db35907f8202330d6
7
+ data.tar.gz: b79a0459d1b8c747cddf860127fc49f9a885eacb767a3adf6f5f1e264c359bb7a9158edabdd2508be64fffb7df0706fa4ce81fcac9ccae4de2714fb931cb7da1
@@ -1,3 +1,8 @@
1
+ 0.0.5 (2017-11-17)
2
+ ==================
3
+ - Use traditional constructors of TimestampFormatter against Embulk core deprecation.
4
+ - https://github.com/civitaspo/embulk-filter-to_json/pull/6
5
+
1
6
  0.0.4 (2016-01-25)
2
7
  ==================
3
8
  - incompatible change: `timezone` / `format` options removed
data/README.md CHANGED
@@ -24,7 +24,7 @@ filters:
24
24
  name: test
25
25
  type: string
26
26
  skip_if_null: [id]
27
- timezone: Asia/Tokyo
27
+ default_timezone: Asia/Tokyo
28
28
  ```
29
29
 
30
30
  ## Run Example
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.0.4"
16
+ version = "0.0.5"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -22,7 +22,6 @@ import org.embulk.spi.time.TimestampFormatter;
22
22
  import org.embulk.spi.type.Type;
23
23
  import org.embulk.spi.type.Types;
24
24
  import org.joda.time.DateTimeZone;
25
- import org.jruby.embed.ScriptingContainer;
26
25
  import org.slf4j.Logger;
27
26
 
28
27
  import java.util.List;
@@ -54,9 +53,6 @@ public class ToJsonFilterPlugin
54
53
  @Config("default_format")
55
54
  @ConfigDefault("\"%Y-%m-%d %H:%M:%S.%N %z\"")
56
55
  String getDefaultFormat();
57
-
58
- @ConfigInject
59
- ScriptingContainer getJRuby();
60
56
  }
61
57
 
62
58
  public interface JsonColumn
@@ -124,13 +120,23 @@ public class ToJsonFilterPlugin
124
120
  return new Schema(builder.build());
125
121
  }
126
122
 
123
+ private static interface FormatterIntlTask extends Task, TimestampFormatter.Task {}
124
+ private static interface FormatterIntlColumnOption extends Task, TimestampFormatter.TimestampColumnOption {}
125
+
127
126
  @Override
128
127
  public PageOutput open(TaskSource taskSource, final Schema inputSchema,
129
128
  final Schema outputSchema, final PageOutput output)
130
129
  {
131
130
  final PluginTask task = taskSource.loadTask(PluginTask.class);
132
- final DateTimeZone timezone = DateTimeZone.forID(task.getDefaultTimezone());
133
- final TimestampFormatter timestampFormatter = new TimestampFormatter(task.getJRuby(), task.getDefaultFormat(), timezone);
131
+ final DateTimeZone timezone = DateTimeZone.forID(task.getDefaultTimezone());
132
+ // TODO: Switch to a newer TimestampFormatter constructor after a reasonable interval.
133
+ // Traditional constructor is used here for compatibility.
134
+ final ConfigSource configSource = Exec.newConfigSource();
135
+ configSource.set("format", task.getDefaultFormat());
136
+ configSource.set("timezone", timezone);
137
+ final TimestampFormatter timestampFormatter = new TimestampFormatter(
138
+ Exec.newConfigSource().loadConfig(FormatterIntlTask.class),
139
+ Optional.fromNullable(configSource.loadConfig(FormatterIntlColumnOption.class)));
134
140
  final List<String> columnNamesSkipIfNull = task.getColumnNamesSkipIfNull();
135
141
 
136
142
  return new PageOutput()
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-filter-to_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Civitaspo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2017-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - ~>
23
17
  - !ruby/object:Gem::Version
24
18
  version: '1.0'
19
+ name: bundler
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - ~>
32
25
  - !ruby/object:Gem::Version
33
- version: '10.0'
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - '>='
37
31
  - !ruby/object:Gem::Version
38
32
  version: '10.0'
33
+ name: rake
39
34
  prerelease: false
40
35
  type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
41
  description: To Json
42
42
  email:
43
43
  - civitaspo@gmail.com
@@ -62,7 +62,7 @@ files:
62
62
  - src/main/java/org/embulk/filter/to_json/ColumnVisitorToJsonImpl.java
63
63
  - src/main/java/org/embulk/filter/to_json/ToJsonFilterPlugin.java
64
64
  - src/test/java/org/embulk/filter/to_json/TestToJsonFilterPlugin.java
65
- - classpath/embulk-filter-to_json-0.0.4.jar
65
+ - classpath/embulk-filter-to_json-0.0.5.jar
66
66
  homepage: https://github.com/civitaspo/embulk-filter-to_json
67
67
  licenses:
68
68
  - MIT