embulk 0.7.3-java → 0.7.4-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
  SHA1:
3
- metadata.gz: dcb703697162b5a2914a16080bd8de7451901c16
4
- data.tar.gz: 90be92f711d748415cc73c6f92ad0004dac67ac5
3
+ metadata.gz: a30e0a1ff4c4748f58b0539ec4c6b9e47acb850b
4
+ data.tar.gz: 3b6ca27d414f7c07be5d202dce02dc633d0f4438
5
5
  SHA512:
6
- metadata.gz: f7103a37b583f96b2b1113d2add98acb8b346c053e91c2576bd8a6acae65d3390d4caa53fa8ed3ad863a93a8e5cc1b063cae8ba1bdf66692a273b087b1cc3b1a
7
- data.tar.gz: f6154d43fb57162af37fa741e136a67baabde33ac479093fc00d8547f2aec69064763b60ee6f4c1fded88494f2d3cb92106e38f605a1a4518ed3b601bc0494a8
6
+ metadata.gz: 16685804e873f6982886ada5f52f3dfb28b52de7adb98da4db8dcc42f09895c85e09235f02bf21d4413ebd0c60d9aa066d3213ae11802b00cb8b9e17e10fe3ad
7
+ data.tar.gz: 6a4f2599c7855ad4db74f7e4b91335689820062d3a098a21411e81756d43bd52d329646c4b656bcbca240dd64704c716d5b7bb9cedba0c7fefc23736695e0d4c
@@ -16,7 +16,7 @@ def release_projects = [project(":embulk-core"), project(":embulk-standards")]
16
16
 
17
17
  allprojects {
18
18
  group = 'org.embulk'
19
- version = '0.7.3'
19
+ version = '0.7.4'
20
20
 
21
21
  ext {
22
22
  jrubyVersion = '9.0.0.0'
@@ -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
- jrubyArgs[0] = resourcePath + "embulk/command/embulk_bundle.rb";
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:~2%
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
- v="${1#-R}"
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
- "r1",
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
- "r1=v1",
145
- "r2=v2",
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
- "r1",
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
- "r1",
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 (System.console() != null) {
40
- name = "/embulk/logback-color.xml";
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
- name = "/embulk/logback-console.xml";
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.logFile}</file>
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.logFile}.%i</fileNamePattern>
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>
@@ -4,6 +4,7 @@ Release Notes
4
4
  .. toctree::
5
5
  :maxdepth: 1
6
6
 
7
+ release/release-0.7.4
7
8
  release/release-0.7.3
8
9
  release/release-0.7.2
9
10
  release/release-0.7.1
@@ -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.content("java/gradle/wrapper/gradle-wrapper.jar")
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
- ruby_path = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["ruby_install_name"])
301
- jar, resource = ruby_path.split("!")
302
-
303
- if resource && jar =~ /^file:/
304
- # java
305
- manifest = File.read("#{jar}!/META-INF/MANIFEST.MF") rescue ""
306
- m = /Main-Class: ([^\r\n]+)/.match(manifest)
307
- if m && m[1] != "org.jruby.Main"
308
- # Main-Class is not jruby
309
- Gem.define_singleton_method(:ruby) do
310
- "java -cp #{jar_path(jar)} org.jruby.Main"
311
- end
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
- jar_path = URI.parse(jar).path rescue jar
7
- unless resource && File.file?(jar_path)
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
 
@@ -16,6 +16,10 @@ module Embulk
16
16
  File.read(path(src))
17
17
  end
18
18
 
19
+ def bincontent(src)
20
+ File.binread(path(src))
21
+ end
22
+
19
23
  def erb(src)
20
24
  require 'erb'
21
25
  ERB.new(content(src), nil, '%').result(@erb_binding)
@@ -1,3 +1,3 @@
1
1
  module Embulk
2
- VERSION = '0.7.3'
2
+ VERSION = '0.7.4'
3
3
  end
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.3
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-23 00:00:00.000000000 Z
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.3.jar
137
- - classpath/embulk-standards-0.7.3.jar
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