embulk 0.8.38-java → 0.8.39-java

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: 26c4e1f7527d4fe85d833c5ca1a381206e241af4e916be3a1485ec722892d879
4
- data.tar.gz: 1f57b5bb3efab313a372cb4dd3c7f94293fdfa07cf820df0142880f9fecf67d7
3
+ metadata.gz: e5e2c9aab6d9b8e2978251ab9137ac74f1eff007e19a6b791a9c09e947c2ff90
4
+ data.tar.gz: b33cab64b71744693ce05f7110427985719e11aa309da49eb3064bdf72406c8e
5
5
  SHA512:
6
- metadata.gz: 13b6ffefcbb71f95eca21f866c41236773ac30d2ab5abb33404d421a55d52941f5558f0abd0469224effef84437fbae66570ba32408448eece5fca2548931488
7
- data.tar.gz: 8aa8b1dec4b29708227ba6301448460ea1416aa23fd64f44d81abc69dc25ef464befb70390b0e491ca6c579ba15b2e98e4194d0ad18ea7acbf9c72f442139c4a
6
+ metadata.gz: c7d83d9bdef928ff4bd3d0291d3bdc34b588c7062e6cd0514338b2a8904bd21b84361581ddfe750a4ebe48aa106abcb4ce5bcdedc8f97c5853194a6604662232
7
+ data.tar.gz: abe661ae8c053ff0ac2c8caafd3736c2225c07192fb9d2a4672dcb81d31418eb62e4e4ed07ea5adb758c65ba9e7ad6d1527dc0f6d4ff90862238f5591d393929
@@ -24,7 +24,7 @@ def release_projects = [project(":embulk-core"), project(":embulk-standards"), p
24
24
 
25
25
  allprojects {
26
26
  group = 'org.embulk'
27
- version = '0.8.38'
27
+ version = '0.8.39'
28
28
 
29
29
  ext {
30
30
  jrubyVersion = '9.1.13.0'
@@ -333,7 +333,7 @@ task releaseCheck {
333
333
  if (!file("embulk-docs/src/release.rst").getText().contains("release-${project.version}")) {
334
334
  throw new GradleException("embulk-docs/src/release.rst doesn't include release-${project.version}")
335
335
  }
336
- String date = new Date().format("yyyy-MM-dd")
336
+ String date = new Date().format("yyyy-MM-d")
337
337
  if (!file("embulk-docs/src/release/release-${project.version}.rst").getText().contains(date)) {
338
338
  throw new GradleException("embulk-docs/src/release/release-${project.version}.rst doesn't include today's release date")
339
339
  }
@@ -57,20 +57,39 @@ public class TimestampFormat
57
57
 
58
58
  public static DateTimeZone parseDateTimeZone(String s)
59
59
  {
60
- final int rubyStyleTimeOffsetInSecond = TimeZoneConverter.dateZoneToDiff(s);
61
-
62
- if (rubyStyleTimeOffsetInSecond != Integer.MIN_VALUE) {
63
- return DateTimeZone.forOffsetMillis(rubyStyleTimeOffsetInSecond * 1000);
60
+ DateTimeZone jodaDateTimeZoneTemporary = null;
61
+ try {
62
+ // Use TimeZone#forID, not TimeZone#getTimeZone.
63
+ // Because getTimeZone returns GMT even if given timezone id is not found.
64
+ jodaDateTimeZoneTemporary = DateTimeZone.forID(s);
65
+ }
66
+ catch (IllegalArgumentException ex) {
67
+ jodaDateTimeZoneTemporary = null;
64
68
  }
69
+ final DateTimeZone jodaDateTimeZone = jodaDateTimeZoneTemporary;
65
70
 
66
- if(s.startsWith("+") || s.startsWith("-")) {
67
- return DateTimeZone.forID(s);
71
+ if (jodaDateTimeZone != null && (s.startsWith("+") || s.startsWith("-"))) {
72
+ return jodaDateTimeZone;
68
73
 
69
74
  } else if (s.equals("Z")) {
70
75
  return DateTimeZone.UTC;
71
76
 
72
77
  } else {
73
78
  try {
79
+ // DateTimeFormat.forPattern("z").parseMillis(s) is incorrect, but kept for compatibility as of now.
80
+ //
81
+ // The offset of PDT (Pacific Daylight Time) should be -07:00.
82
+ // DateTimeFormat.forPattern("z").parseMillis("PDT") however returns 8 hours (-08:00).
83
+ // DateTimeFormat.forPattern("z").parseMillis("PDT") == 28800000
84
+ // https://github.com/JodaOrg/joda-time/blob/v2.9.2/src/main/java/org/joda/time/DateTimeUtils.java#L446
85
+ //
86
+ // Embulk has used it to parse time zones for a very long time since it was v0.1.
87
+ // https://github.com/embulk/embulk/commit/b97954a5c78397e1269bbb6979d6225dfceb4e05
88
+ //
89
+ // It is kept as -08:00 for compatibility as of now.
90
+ //
91
+ // TODO: Make time zone parsing consistent.
92
+ // @see <a href="https://github.com/embulk/embulk/issues/860">https://github.com/embulk/embulk/issues/860</a>
74
93
  int rawOffset = (int) DateTimeFormat.forPattern("z").parseMillis(s);
75
94
  if(rawOffset == 0) {
76
95
  return DateTimeZone.UTC;
@@ -83,12 +102,24 @@ public class TimestampFormat
83
102
  // parseMillis failed
84
103
  }
85
104
 
86
- // TimeZone.getTimeZone returns GMT zone if given timezone id is not found
87
- // we want to only return timezone if exact match, otherwise exception
88
- if (availableTimeZoneNames.contains(s)) {
89
- //return TimeZone.getTimeZone(s);
90
- return DateTimeZone.forID(s);
105
+ if (jodaDateTimeZone != null && availableTimeZoneNames.contains(s)) {
106
+ return jodaDateTimeZone;
91
107
  }
108
+
109
+ // Parsing Ruby-style time zones in lower priority than Joda-Time because
110
+ // TimestampParser has parsed time zones with Joda-Time for a long time
111
+ // since ancient. The behavior is kept for compatibility.
112
+ //
113
+ // The following time zone IDs are duplicated in Ruby and Joda-Time 2.9.2
114
+ // while Ruby does not care summer time and Joda-Time cares summer time.
115
+ // "CET", "EET", "Egypt", "Iran", "MET", "WET"
116
+ //
117
+ // Some zone IDs (ex. "PDT") are parsed by DateTimeFormat#parseMillis as shown above.
118
+ final int rubyStyleTimeOffsetInSecond = TimeZoneConverter.dateZoneToDiff(s);
119
+ if (rubyStyleTimeOffsetInSecond != Integer.MIN_VALUE) {
120
+ return DateTimeZone.forOffsetMillis(rubyStyleTimeOffsetInSecond * 1000);
121
+ }
122
+
92
123
  return null;
93
124
  }
94
125
  }
@@ -55,7 +55,22 @@ public class TestTimestampParser {
55
55
  public void test__strptime__3_rfc822() {
56
56
  testToParse("Thu, 29 Jul 1999 09:54:21 UT", "%a, %d %b %Y %H:%M:%S %Z", 933242061L);
57
57
  testToParse("Thu, 29 Jul 1999 09:54:21 GMT", "%a, %d %b %Y %H:%M:%S %Z", 933242061L);
58
- testToParse("Thu, 29 Jul 1999 09:54:21 PDT", "%a, %d %b %Y %H:%M:%S %Z", 933267261L);
58
+
59
+ // It should be 933267261L if PDT (Pacific Daylight Time) is correctly -07:00.
60
+ //
61
+ // Joda-Time's DateTimeFormat.forPattern("z").parseMillis("PDT") however returns 8 hours (-08:00).
62
+ // DateTimeFormat.forPattern("z").parseMillis("PDT") == 28800000
63
+ // https://github.com/JodaOrg/joda-time/blob/v2.9.2/src/main/java/org/joda/time/DateTimeUtils.java#L446
64
+ //
65
+ // Embulk has used it to parse time zones for a very long time since it was v0.1.
66
+ // https://github.com/embulk/embulk/commit/b97954a5c78397e1269bbb6979d6225dfceb4e05
67
+ //
68
+ // It is kept as -08:00 for compatibility as of now.
69
+ //
70
+ // TODO: Make time zone parsing consistent.
71
+ // @see <a href="https://github.com/embulk/embulk/issues/860">https://github.com/embulk/embulk/issues/860</a>
72
+ testToParse("Thu, 29 Jul 1999 09:54:21 PDT", "%a, %d %b %Y %H:%M:%S %Z", 933270861L);
73
+
59
74
  testToParse("Thu, 29 Jul 1999 09:54:21 z", "%a, %d %b %Y %H:%M:%S %Z", 933242061L);
60
75
  testToParse("Thu, 29 Jul 1999 09:54:21 +0900", "%a, %d %b %Y %H:%M:%S %Z", 933209661L);
61
76
  testToParse("Thu, 29 Jul 1999 09:54:21 +0430", "%a, %d %b %Y %H:%M:%S %Z", 933225861L);
@@ -4,6 +4,7 @@ Release Notes
4
4
  .. toctree::
5
5
  :maxdepth: 1
6
6
 
7
+ release/release-0.8.39
7
8
  release/release-0.8.38
8
9
  release/release-0.8.37
9
10
  release/release-0.8.36
@@ -0,0 +1,12 @@
1
+ Release 0.8.39
2
+ ==================================
3
+
4
+ General Changes
5
+ ----------------
6
+
7
+ * Backport hot-fix: Parse time zones in Ruby-style in lower priority than Joda-Time [#864]
8
+
9
+
10
+ Release Date
11
+ ------------------
12
+ 2017-12-6
@@ -3,7 +3,7 @@
3
3
  module Embulk
4
4
  @@warned = false
5
5
 
6
- VERSION_INTERNAL = '0.8.38'
6
+ VERSION_INTERNAL = '0.8.39'
7
7
 
8
8
  DEPRECATED_MESSAGE = 'Embulk::VERSION in (J)Ruby is deprecated. Use org.embulk.EmbulkVersion::VERSION instead. If this message is from a plugin, please tell this to the author of the plugin!'
9
9
  def self.const_missing(name)
@@ -45,7 +45,22 @@ class TimestampParserTest < ::Test::Unit::TestCase
45
45
  # rfc822
46
46
  ['Thu, 29 Jul 1999 09:54:21 UT', '%a, %d %b %Y %H:%M:%S %Z'],
47
47
  ['Thu, 29 Jul 1999 09:54:21 GMT', '%a, %d %b %Y %H:%M:%S %Z'],
48
- ['Thu, 29 Jul 1999 09:54:21 PDT', '%a, %d %b %Y %H:%M:%S %Z'],
48
+
49
+ # They should be the same if PDT (Pacific Daylight Time) is correctly -07:00.
50
+ #
51
+ # Joda-Time's DateTimeFormat.forPattern("z").parseMillis("PDT") however returns 8 hours (-08:00).
52
+ # DateTimeFormat.forPattern("z").parseMillis("PDT") == 28800000
53
+ # https://github.com/JodaOrg/joda-time/blob/v2.9.2/src/main/java/org/joda/time/DateTimeUtils.java#L446
54
+ #
55
+ # Embulk has used it to parse time zones for a very long time since it was v0.1.
56
+ # https://github.com/embulk/embulk/commit/b97954a5c78397e1269bbb6979d6225dfceb4e05
57
+ #
58
+ # It is kept as -08:00 for compatibility as of now.
59
+ #
60
+ # TODO: Make time zone parsing consistent.
61
+ # See https://github.com/embulk/embulk/issues/860
62
+ # ['Thu, 29 Jul 1999 09:54:21 PDT', '%a, %d %b %Y %H:%M:%S %Z'],
63
+
49
64
  ['Thu, 29 Jul 1999 09:54:21 z', '%a, %d %b %Y %H:%M:%S %Z'],
50
65
  ['Thu, 29 Jul 1999 09:54:21 +0900', '%a, %d %b %Y %H:%M:%S %Z'],
51
66
  ['Thu, 29 Jul 1999 09:54:21 +0430', '%a, %d %b %Y %H:%M:%S %Z'],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.38
4
+ version: 0.8.39
5
5
  platform: java
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-22 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -157,10 +157,10 @@ files:
157
157
  - classpath/commons-compress-1.10.jar
158
158
  - classpath/commons-lang-2.4.jar
159
159
  - classpath/commons-lang3-3.4.jar
160
- - classpath/embulk-cli-0.8.38.jar
161
- - classpath/embulk-core-0.8.38.jar
162
- - classpath/embulk-jruby-strptime-0.8.38.jar
163
- - classpath/embulk-standards-0.8.38.jar
160
+ - classpath/embulk-cli-0.8.39.jar
161
+ - classpath/embulk-core-0.8.39.jar
162
+ - classpath/embulk-jruby-strptime-0.8.39.jar
163
+ - classpath/embulk-standards-0.8.39.jar
164
164
  - classpath/guava-18.0.jar
165
165
  - classpath/guice-4.0.jar
166
166
  - classpath/guice-bootstrap-0.1.1.jar
@@ -569,6 +569,7 @@ files:
569
569
  - embulk-docs/src/release/release-0.8.36.rst
570
570
  - embulk-docs/src/release/release-0.8.37.rst
571
571
  - embulk-docs/src/release/release-0.8.38.rst
572
+ - embulk-docs/src/release/release-0.8.39.rst
572
573
  - embulk-docs/src/release/release-0.8.4.rst
573
574
  - embulk-docs/src/release/release-0.8.5.rst
574
575
  - embulk-docs/src/release/release-0.8.6.rst