embulk 0.7.3-java → 0.7.4-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/build.gradle +1 -1
- data/embulk-cli/src/main/java/org/embulk/cli/Main.java +18 -3
- data/embulk-cli/src/main/sh/selfrun.sh +2 -3
- data/embulk-cli/src/test/java/org/embulk/cli/SelfrunTest.java +5 -5
- data/embulk-core/src/main/java/org/embulk/exec/LoggerProvider.java +11 -3
- data/embulk-core/src/main/resources/embulk/logback-file.xml +5 -7
- data/embulk-docs/src/release.rst +1 -0
- data/embulk-docs/src/release/release-0.7.4.rst +14 -0
- data/lib/embulk/command/embulk_migrate_plugin.rb +1 -1
- data/lib/embulk/command/embulk_run.rb +17 -12
- data/lib/embulk/command/embulk_selfupdate.rb +3 -2
- data/lib/embulk/data/new/ruby/filter.rb.erb +10 -1
- data/lib/embulk/data/package_data.rb +4 -0
- data/lib/embulk/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a30e0a1ff4c4748f58b0539ec4c6b9e47acb850b
|
4
|
+
data.tar.gz: 3b6ca27d414f7c07be5d202dce02dc633d0f4438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16685804e873f6982886ada5f52f3dfb28b52de7adb98da4db8dcc42f09895c85e09235f02bf21d4413ebd0c60d9aa066d3213ae11802b00cb8b9e17e10fe3ad
|
7
|
+
data.tar.gz: 6a4f2599c7855ad4db74f7e4b91335689820062d3a098a21411e81756d43bd52d329646c4b656bcbca240dd64704c716d5b7bb9cedba0c7fefc23736695e0d4c
|
data/build.gradle
CHANGED
@@ -8,6 +8,23 @@ public class Main
|
|
8
8
|
{
|
9
9
|
// $ java -jar jruby-complete.jar embulk-core.jar!/embulk/command/embulk_bundle.rb "$@"
|
10
10
|
String[] jrubyArgs = new String[args.length + 1];
|
11
|
+
int i;
|
12
|
+
for (i = 0; i < args.length; i++) {
|
13
|
+
if (args[i].startsWith("-R")) {
|
14
|
+
jrubyArgs[i] = args[i].substring(2);
|
15
|
+
} else {
|
16
|
+
break;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
jrubyArgs[i] = getScriptPath();
|
20
|
+
for (; i < args.length; i++) {
|
21
|
+
jrubyArgs[i+1] = args[i];
|
22
|
+
}
|
23
|
+
org.jruby.Main.main(jrubyArgs);
|
24
|
+
}
|
25
|
+
|
26
|
+
private static String getScriptPath()
|
27
|
+
{
|
11
28
|
String resourcePath;
|
12
29
|
try {
|
13
30
|
resourcePath = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().toString() + "!/";
|
@@ -15,8 +32,6 @@ public class Main
|
|
15
32
|
catch (URISyntaxException ex) {
|
16
33
|
resourcePath = "classpath:";
|
17
34
|
}
|
18
|
-
|
19
|
-
System.arraycopy(args, 0, jrubyArgs, 1, args.length);
|
20
|
-
org.jruby.Main.main(jrubyArgs);
|
35
|
+
return resourcePath + "embulk/command/embulk_bundle.rb";
|
21
36
|
}
|
22
37
|
}
|
@@ -76,7 +76,7 @@ if "%status%" == "rest" (
|
|
76
76
|
)
|
77
77
|
|
78
78
|
) else if "%arg:~0,2%" == "-R" (
|
79
|
-
set jruby_args=%jruby_args% %arg
|
79
|
+
set jruby_args=%jruby_args% %arg%
|
80
80
|
|
81
81
|
) else if "%arg%" == "run" (
|
82
82
|
set default_optimize=true
|
@@ -134,8 +134,7 @@ while true; do
|
|
134
134
|
shift
|
135
135
|
;;
|
136
136
|
-R*)
|
137
|
-
|
138
|
-
jruby_args="$jruby_args $v"
|
137
|
+
jruby_args="$jruby_args $1"
|
139
138
|
shift
|
140
139
|
;;
|
141
140
|
run)
|
@@ -125,7 +125,7 @@ public class SelfrunTest {
|
|
125
125
|
"-Xverify:none",
|
126
126
|
"-jar",
|
127
127
|
testSelfrun.getAbsolutePath(),
|
128
|
-
"
|
128
|
+
"-Rr1",
|
129
129
|
"a1",
|
130
130
|
"a2"),
|
131
131
|
args);
|
@@ -141,8 +141,8 @@ public class SelfrunTest {
|
|
141
141
|
"-Xverify:none",
|
142
142
|
"-jar",
|
143
143
|
testSelfrun.getAbsolutePath(),
|
144
|
-
"
|
145
|
-
"
|
144
|
+
"-Rr1=v1",
|
145
|
+
"-Rr2=v2",
|
146
146
|
"a1",
|
147
147
|
"a2"),
|
148
148
|
args);
|
@@ -156,7 +156,7 @@ public class SelfrunTest {
|
|
156
156
|
"-XX:+UseConcMarkSweepGC",
|
157
157
|
"-jar",
|
158
158
|
testSelfrun.getAbsolutePath(),
|
159
|
-
"
|
159
|
+
"-Rr1",
|
160
160
|
"run",
|
161
161
|
"a1"),
|
162
162
|
args);
|
@@ -206,7 +206,7 @@ public class SelfrunTest {
|
|
206
206
|
"j1",
|
207
207
|
"-jar",
|
208
208
|
testSelfrun.getAbsolutePath(),
|
209
|
-
"
|
209
|
+
"-Rr1",
|
210
210
|
"a1",
|
211
211
|
"a2"),
|
212
212
|
args);
|
@@ -35,11 +35,19 @@ public class LoggerProvider
|
|
35
35
|
configurator.setContext(context);
|
36
36
|
context.reset();
|
37
37
|
|
38
|
+
String logPath = systemConfig.get(String.class, "log_path", "-");
|
39
|
+
|
38
40
|
String name;
|
39
|
-
if (
|
40
|
-
|
41
|
+
if (logPath.equals("-")) {
|
42
|
+
if (System.console() != null) {
|
43
|
+
name = "/embulk/logback-color.xml";
|
44
|
+
} else {
|
45
|
+
name = "/embulk/logback-console.xml";
|
46
|
+
}
|
41
47
|
} else {
|
42
|
-
|
48
|
+
// logback uses system property to embed variables in XML file
|
49
|
+
System.setProperty("embulk.logPath", logPath);
|
50
|
+
name = "/embulk/logback-file.xml";
|
43
51
|
}
|
44
52
|
try {
|
45
53
|
configurator.doConfigure(getClass().getResource(name));
|
@@ -1,16 +1,14 @@
|
|
1
1
|
<configuration>
|
2
|
-
<property name="embulk.logFile" value="embulk.log" />
|
3
|
-
|
4
2
|
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
5
|
-
<file>${embulk.
|
6
|
-
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
7
|
-
<maxFileSize>5kB</maxFileSize>
|
8
|
-
</triggeringPolicy>
|
3
|
+
<file>${embulk.logPath}</file>
|
9
4
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
|
10
|
-
<fileNamePattern>${embulk.
|
5
|
+
<fileNamePattern>${embulk.logPath}.%i.gz</fileNamePattern>
|
11
6
|
<minIndex>1</minIndex>
|
12
7
|
<maxIndex>5</maxIndex>
|
13
8
|
</rollingPolicy>
|
9
|
+
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
10
|
+
<maxFileSize>10MB</maxFileSize>
|
11
|
+
</triggeringPolicy>
|
14
12
|
<encoder>
|
15
13
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS Z} [%level] (%thread\): %m%n</pattern>
|
16
14
|
</encoder>
|
data/embulk-docs/src/release.rst
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
Release 0.7.4
|
2
|
+
==================================
|
3
|
+
|
4
|
+
General Changes
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Added ``--log PATH`` command line option to output log messages to a file.
|
8
|
+
* Fixed ``-R`` command line option handling to pass it to JRuby.
|
9
|
+
* Fixed gem installation failure when a gem includes native extension.
|
10
|
+
|
11
|
+
|
12
|
+
Release Date
|
13
|
+
------------------
|
14
|
+
2015-08-29
|
@@ -46,7 +46,7 @@ module Embulk
|
|
46
46
|
# gradle < 2.6
|
47
47
|
require 'embulk/data/package_data'
|
48
48
|
data = PackageData.new("new", migrator.path)
|
49
|
-
migrator.write "gradle/wrapper/gradle-wrapper.jar", data.
|
49
|
+
migrator.write "gradle/wrapper/gradle-wrapper.jar", data.bincontent("java/gradle/wrapper/gradle-wrapper.jar")
|
50
50
|
migrator.write "gradle/wrapper/gradle-wrapper.properties", data.content("java/gradle/wrapper/gradle-wrapper.properties")
|
51
51
|
end
|
52
52
|
|
@@ -41,6 +41,9 @@ module Embulk
|
|
41
41
|
java_embed_ops = lambda do
|
42
42
|
op.separator ""
|
43
43
|
op.separator " Other options:"
|
44
|
+
op.on('-l', '--log PATH', 'Output log messages to a file (default: -)') do |path|
|
45
|
+
options[:system_config][:log_path] = path
|
46
|
+
end
|
44
47
|
op.on('-l', '--log-level LEVEL', 'Log level (error, warn, info, debug or trace)') do |level|
|
45
48
|
options[:system_config][:log_level] = level
|
46
49
|
end
|
@@ -297,18 +300,20 @@ examples:
|
|
297
300
|
private
|
298
301
|
|
299
302
|
def self.fix_gem_ruby_path
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
303
|
+
# Oveerride Gem.ruby method so that rubygems can execute ruby command (as another process).
|
304
|
+
# By default, Gem.ruby uses "java -jar jar_path" command. However, it doesn't work because
|
305
|
+
# Main-Class is overwritten to org.embulk.cli.Main. Here fixes it to use
|
306
|
+
# "java -cp jar_path org.jruby.main" instead.
|
307
|
+
|
308
|
+
jar, resource = __FILE__.split("!", 2)
|
309
|
+
jar_uri = URI.parse(jar).path rescue jar
|
310
|
+
|
311
|
+
manifest = File.read("#{jar_uri}!/META-INF/MANIFEST.MF") rescue ""
|
312
|
+
m = /Main-Class: ([^\r\n]+)/.match(manifest)
|
313
|
+
if m && m[1] != "org.jruby.Main"
|
314
|
+
# Main-Class is not jruby
|
315
|
+
Gem.define_singleton_method(:ruby) do
|
316
|
+
"java -cp #{jar_path(jar_uri)} org.jruby.Main"
|
312
317
|
end
|
313
318
|
end
|
314
319
|
end
|
@@ -3,8 +3,8 @@ module Embulk
|
|
3
3
|
require 'uri'
|
4
4
|
|
5
5
|
jar, resource = __FILE__.split("!", 2)
|
6
|
-
|
7
|
-
unless resource && File.file?(
|
6
|
+
jar_uri = URI.parse(jar).path rescue jar
|
7
|
+
unless resource && File.file?(jar_uri)
|
8
8
|
STDERR.puts ""
|
9
9
|
STDERR.puts "Embulk is not installed by a single jar. Selfupdate is not supported."
|
10
10
|
STDERR.puts "If you used gem to install embulk, please run: "
|
@@ -13,6 +13,7 @@ module Embulk
|
|
13
13
|
STDERR.puts ""
|
14
14
|
raise SystemExit.new(1)
|
15
15
|
end
|
16
|
+
jar_path = jar_uri
|
16
17
|
|
17
18
|
if version = options[:version]
|
18
19
|
puts "Checking version #{version}..."
|
@@ -12,6 +12,14 @@ module Embulk
|
|
12
12
|
"option3" => config.param("option3", :string, default: nil), # string, optional
|
13
13
|
}
|
14
14
|
|
15
|
+
columns = [
|
16
|
+
Column.new(nil, "example", :string),
|
17
|
+
Column.new(nil, "column", :long),
|
18
|
+
Column.new(nil, "value", :double),
|
19
|
+
]
|
20
|
+
|
21
|
+
out_columns = in_schema + columns
|
22
|
+
|
15
23
|
yield(task, out_columns)
|
16
24
|
end
|
17
25
|
|
@@ -27,8 +35,9 @@ module Embulk
|
|
27
35
|
|
28
36
|
def add(page)
|
29
37
|
# filtering code:
|
38
|
+
add_columns = ["example",1,1.0]
|
30
39
|
page.each do |record|
|
31
|
-
page_builder.add(record)
|
40
|
+
page_builder.add(record + add_columns)
|
32
41
|
end
|
33
42
|
end
|
34
43
|
|
data/lib/embulk/version.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -133,8 +133,8 @@ files:
|
|
133
133
|
- classpath/bval-jsr303-0.5.jar
|
134
134
|
- classpath/commons-beanutils-core-1.8.3.jar
|
135
135
|
- classpath/commons-lang3-3.1.jar
|
136
|
-
- classpath/embulk-core-0.7.
|
137
|
-
- classpath/embulk-standards-0.7.
|
136
|
+
- classpath/embulk-core-0.7.4.jar
|
137
|
+
- classpath/embulk-standards-0.7.4.jar
|
138
138
|
- classpath/guava-18.0.jar
|
139
139
|
- classpath/guice-4.0.jar
|
140
140
|
- classpath/guice-multibindings-4.0.jar
|
@@ -433,6 +433,7 @@ files:
|
|
433
433
|
- embulk-docs/src/release/release-0.7.1.rst
|
434
434
|
- embulk-docs/src/release/release-0.7.2.rst
|
435
435
|
- embulk-docs/src/release/release-0.7.3.rst
|
436
|
+
- embulk-docs/src/release/release-0.7.4.rst
|
436
437
|
- embulk-standards/build.gradle
|
437
438
|
- embulk-standards/src/main/java/org/embulk/standards/CsvFormatterPlugin.java
|
438
439
|
- embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java
|