embulk-filter-typecast 0.1.5 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58d54323014090807f457eec3b84aef29060ddd2
4
- data.tar.gz: eb7be6477a3a993ce83da5a3e404fa0e7fd3a50d
3
+ metadata.gz: d936b48df269ca51c971f2f258c2ae54abd492b5
4
+ data.tar.gz: 7611a81214e865fb9f63ab3d346f45b4e2d68063
5
5
  SHA512:
6
- metadata.gz: f19f899b820a7faccca9d261b8cc807ac230321b26b4ccde552e7308c6853bc01a24b7cefde15eef9061f1b06e55f0b1b31e8ff67f29ab83d4f07ac3feb488db
7
- data.tar.gz: 479bce7de22d8ecefdd6ddde53cd602f44fefdab0394cb0b83df9eb1f67cf2aeb980aa87b24da62f72a3ce47192f13af5ba6b9c1006116fb1da0f64156313ad2
6
+ metadata.gz: 588142a7396f9a03ac3820276e5cf213345bb0674e72364faba6f0de26157d3184c16edee9d7b874fc2b0a7e73305661a74cc5f81819568c12d3c7b0d127032b
7
+ data.tar.gz: 6806eff6b7f631388ca2946b2a8732b824f40418b9e347fc674c9616e4cff1741278da825a3a8f2b8e987626d27dc6bc0c154bf86f71d8d459d0ea956e11ba54
@@ -1,3 +1,10 @@
1
+ # 0.2.0 (2017-08-23)
2
+
3
+ Changes:
4
+
5
+ * Support new TimestampParser and TimestampFormatter API of embulk >= 0.8.29
6
+ * Note that this plugin now requires embulk >= 0.8.29
7
+
1
8
  # 0.1.5 (2016-11-06)
2
9
 
3
10
  Enhancements:
@@ -13,13 +13,13 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.5"
16
+ version = "0.2.0"
17
17
  sourceCompatibility = 1.7
18
18
  targetCompatibility = 1.7
19
19
 
20
20
  dependencies {
21
- compile "org.embulk:embulk-core:0.8.+"
22
- provided "org.embulk:embulk-core:0.8.+"
21
+ compile "org.embulk:embulk-core:0.8.29+"
22
+ provided "org.embulk:embulk-core:0.8.29+"
23
23
  compile "io.github.medjed:JsonPathCompiler:0.1.1"
24
24
 
25
25
  testCompile "junit:junit:4.+"
@@ -1,6 +1,6 @@
1
- #Wed Jan 13 12:41:02 JST 2016
1
+ #Wed Aug 09 13:08:20 JST 2017
2
2
  distributionBase=GRADLE_USER_HOME
3
3
  distributionPath=wrapper/dists
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
@@ -95,14 +95,14 @@ class ColumnCaster
95
95
  {
96
96
  DateTimeZone timezone = columnConfig.getTimeZone().or(task.getDefaultTimeZone());
97
97
  String format = columnConfig.getFormat().or(task.getDefaultTimestampFormat());
98
- return new TimestampParser(task.getJRuby(), format, timezone);
98
+ return new TimestampParser(format, timezone);
99
99
  }
100
100
 
101
101
  private TimestampFormatter getTimestampFormatter(ColumnConfig columnConfig, PluginTask task)
102
102
  {
103
103
  String format = columnConfig.getFormat().or(task.getDefaultTimestampFormat());
104
104
  DateTimeZone timezone = columnConfig.getTimeZone().or(task.getDefaultTimeZone());
105
- return new TimestampFormatter(task.getJRuby(), format, timezone);
105
+ return new TimestampFormatter(format, timezone);
106
106
  }
107
107
 
108
108
  public void setFromBoolean(Column outputColumn, boolean value)
@@ -22,7 +22,6 @@ import org.embulk.spi.Schema;
22
22
  import org.embulk.spi.type.TimestampType;
23
23
  import org.embulk.spi.type.Type;
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;
@@ -70,9 +69,6 @@ public class TypecastFilterPlugin implements FilterPlugin
70
69
  @Config("default_timestamp_format")
71
70
  @ConfigDefault("\"%Y-%m-%d %H:%M:%S.%N %z\"")
72
71
  public String getDefaultTimestampFormat();
73
-
74
- @ConfigInject
75
- ScriptingContainer getJRuby();
76
72
  }
77
73
 
78
74
  @Override
@@ -5,7 +5,6 @@ import org.embulk.spi.DataException;
5
5
  import org.embulk.spi.time.Timestamp;
6
6
  import org.embulk.spi.time.TimestampParser;
7
7
  import org.joda.time.DateTimeZone;
8
- import org.jruby.embed.ScriptingContainer;
9
8
  import org.junit.Before;
10
9
  import org.junit.Rule;
11
10
  import org.junit.Test;
@@ -20,12 +19,10 @@ public class TestStringCast
20
19
  {
21
20
  @Rule
22
21
  public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
23
- public ScriptingContainer jruby;
24
22
 
25
23
  @Before
26
24
  public void createResource()
27
25
  {
28
- jruby = new ScriptingContainer();
29
26
  }
30
27
 
31
28
  @Test
@@ -102,7 +99,7 @@ public class TestStringCast
102
99
  public void asTimestamp()
103
100
  {
104
101
  Timestamp expected = Timestamp.ofEpochSecond(1463084053, 123456000);
105
- TimestampParser parser = new TimestampParser(jruby, "%Y-%m-%d %H:%M:%S.%N", DateTimeZone.UTC);
102
+ TimestampParser parser = new TimestampParser("%Y-%m-%d %H:%M:%S.%N", DateTimeZone.UTC);
106
103
  assertEquals(expected, StringCast.asTimestamp("2016-05-12 20:14:13.123456", parser));
107
104
 
108
105
  try {
@@ -6,7 +6,6 @@ import org.embulk.spi.time.Timestamp;
6
6
  import org.embulk.spi.time.TimestampFormatter;
7
7
  import org.embulk.spi.time.TimestampParser;
8
8
  import org.joda.time.DateTimeZone;
9
- import org.jruby.embed.ScriptingContainer;
10
9
  import org.junit.Before;
11
10
  import org.junit.Rule;
12
11
  import org.junit.Test;
@@ -21,14 +20,12 @@ public class TestTimestampCast
21
20
  {
22
21
  @Rule
23
22
  public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
24
- public ScriptingContainer jruby;
25
23
  public Timestamp timestamp;
26
24
 
27
25
  @Before
28
26
  public void createResource()
29
27
  {
30
28
  timestamp = Timestamp.ofEpochSecond(1463084053, 500000000);
31
- jruby = new ScriptingContainer();
32
29
  }
33
30
 
34
31
  @Test(expected = DataException.class)
@@ -53,7 +50,7 @@ public class TestTimestampCast
53
50
  @Test
54
51
  public void asString()
55
52
  {
56
- TimestampFormatter formatter = new TimestampFormatter(jruby, "%Y-%m-%d %H:%M:%S.%6N", DateTimeZone.UTC);
53
+ TimestampFormatter formatter = new TimestampFormatter("%Y-%m-%d %H:%M:%S.%6N", DateTimeZone.UTC);
57
54
  assertEquals("2016-05-12 20:14:13.500000", TimestampCast.asString(timestamp, formatter));
58
55
  }
59
56
 
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-filter-typecast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-06 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ~>
17
18
  - !ruby/object:Gem::Version
18
19
  version: '1.0'
19
- name: bundler
20
- prerelease: false
21
- type: :development
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - ~>
25
23
  - !ruby/object:Gem::Version
26
24
  version: '1.0'
25
+ prerelease: false
26
+ type: :development
27
27
  - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '10.0'
33
- name: rake
34
- prerelease: false
35
- type: :development
36
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
37
35
  requirements:
38
36
  - - '>='
39
37
  - !ruby/object:Gem::Version
40
38
  version: '10.0'
39
+ prerelease: false
40
+ type: :development
41
41
  description: A filter plugin for Embulk to cast column type.
42
42
  email:
43
43
  - sonots@gmail.com
@@ -88,8 +88,7 @@ files:
88
88
  - src/test/java/org/embulk/filter/typecast/cast/TestTimestampCast.java
89
89
  - classpath/accessors-smart-1.1.jar
90
90
  - classpath/asm-5.0.3.jar
91
- - classpath/commons-lang3-3.4.jar
92
- - classpath/embulk-filter-typecast-0.1.5.jar
91
+ - classpath/embulk-filter-typecast-0.2.0.jar
93
92
  - classpath/json-smart-2.2.1.jar
94
93
  - classpath/JsonPathCompiler-0.1.1.jar
95
94
  - classpath/slf4j-api-1.7.21.jar