embulk 0.3.0 → 0.3.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2ZlNTcxZjM0ZjA4MDE5YmM0NmU2ZTQ3ZmZkM2ZkZDM5OWFkNjRiNA==
4
+ MjA1Mzc3ZGRhMDY2ZWI5N2NkZjM1ZDg4Yzc4MGE0MjljM2Q0ZjYxYw==
5
5
  data.tar.gz: !binary |-
6
- NzU2NjYzOTQzM2ExYzdiNzc0YzUzYWZiNzcwZTU2ZmFkZmUxYjMzOQ==
6
+ Y2JhZDM0MTk2YzliZGIzYmUwNzM1ZjFmNmU0OGRiYzNiM2IwYjUwMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWM5ZjJiNjhkNDQwZDgyZGU4MzhiMmNmYjI5OGZhMjk2OTAyM2FlOWM4YzYy
10
- ZTczZTgzMDBkYjY3ZmZmODM0NGU0NmM2MTBjYmRiNDY1ZDliY2QzZmM2OTZi
11
- ZmIzZjZmYzc4MTJkOWE2ODM5ODAxYTZhMzgzNzE0NzM5YzgyODU=
9
+ MDEyYjU0YjM0OWNlZjA1NmMzMWI2NTZhMTFiMjM0MGU5M2VkZjA2ODQyNzBk
10
+ M2NiNzJiYzJhMTcxYzFhZjQ3ZGRhM2IyZDI4NzVhYzU5MjBmMGFhNWQ2NGEw
11
+ NmRhZTdkYWIzZGY3NmQ1Mzg0YWNkMzZkYjYzN2ZlMDU4NzYwZmY=
12
12
  data.tar.gz: !binary |-
13
- NTg3MjdiZWNjNGYzN2MzZTM0YzY0OTRmNGJlYmI5ODY3ZmY5ZWFiY2RkN2Yy
14
- NjI0ZmIzOWJjNDU0NzM4ZDhlYTJjZTBkODc3MmRjYjI5Mzc5OWUyZDQwYzA5
15
- MTRiMGE1NmU4YmI1MWU1Yjk1ZmJlZTU3Y2Y0NDY5YTFjN2EzOTQ=
13
+ MThhMzNlNjgxYjEwY2Q0NDA2MWMzOTlhZjEyZDA4OTM0ODQ3MzkwZWYzMjdh
14
+ OTFlNGZjNGMzZTZhNDE1ZWI1MzFmMjBiZGUwODY1Yjc4YjNjNGU0ZmExMTA0
15
+ ZDlkNzhiZDZiZTM3OWEyYmI4ODFlYjY2OWI1OTBkODgyNDZjZTk=
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ 2015-02-04 version 0.3.1:
3
+
4
+ * Added -C, --classpath option to add java classpath
5
+
6
+
2
7
  2015-02-03 version 0.3.0:
3
8
 
4
9
  * Added resume functionality. InputPlugin and OutputPlugin needs to implement
data/README.md CHANGED
@@ -24,7 +24,7 @@ You can release plugins to share your efforts of data cleaning, error handling,
24
24
  The single-file package is the simplest way to try Embulk. You can download the latest embulk-VERSION.jar from [the releases page](https://bintray.com/embulk/maven/embulk/view#files) and run it with java:
25
25
 
26
26
  ```
27
- wget https://bintray.com/artifact/download/embulk/maven/embulk-0.3.0.jar -O embulk.jar
27
+ wget https://bintray.com/artifact/download/embulk/maven/embulk-0.3.1.jar -O embulk.jar
28
28
  java -jar embulk.jar --help
29
29
  ```
30
30
 
@@ -28,7 +28,7 @@ allprojects {
28
28
  apply plugin: 'com.github.ben-manes.versions'
29
29
 
30
30
  group = 'org.embulk'
31
- version = '0.3.0'
31
+ version = '0.3.1'
32
32
 
33
33
  // to upload artifacts to Bintray by gradle-bintray-plugin
34
34
  // $ gradle bintrayUpload
@@ -5,7 +5,7 @@
5
5
  <parent>
6
6
  <groupId>org.embulk</groupId>
7
7
  <artifactId>embulk-parent</artifactId>
8
- <version>0.3.0-SNAPSHOT</version>
8
+ <version>0.3.1-SNAPSHOT</version>
9
9
  </parent>
10
10
 
11
11
  <artifactId>embulk-cli</artifactId>
@@ -5,7 +5,7 @@
5
5
  <parent>
6
6
  <groupId>org.embulk</groupId>
7
7
  <artifactId>embulk-parent</artifactId>
8
- <version>0.3.0-SNAPSHOT</version>
8
+ <version>0.3.1-SNAPSHOT</version>
9
9
  </parent>
10
10
 
11
11
  <artifactId>embulk-core</artifactId>
@@ -5,7 +5,7 @@
5
5
  <parent>
6
6
  <groupId>org.embulk</groupId>
7
7
  <artifactId>embulk-parent</artifactId>
8
- <version>0.3.0-SNAPSHOT</version>
8
+ <version>0.3.1-SNAPSHOT</version>
9
9
  </parent>
10
10
 
11
11
  <artifactId>embulk-standards</artifactId>
@@ -18,15 +18,18 @@ module Embulk
18
18
  usage nil unless i
19
19
  subcmd = argv.slice!(i)
20
20
 
21
- load_paths = []
22
- options = {}
23
-
24
21
  # to make sure org.embulk.jruby.JRubyScriptingModule can require 'embulk/java/bootstrap'
25
22
  $LOAD_PATH << Embulk.home('lib')
26
23
 
24
+ require 'java'
27
25
  require 'optparse'
28
26
  op = OptionParser.new
29
27
 
28
+ load_paths = []
29
+ classpaths = []
30
+ classpath_separator = java.io.File.pathSeparator
31
+ options = {}
32
+
30
33
  op.on('-b', '--bundle BUNDLE_DIR', 'Path to a Gemfile directory') do |path|
31
34
  # only for help message. implemented at lib/embulk/command/embulk.rb
32
35
  end
@@ -45,9 +48,12 @@ module Embulk
45
48
  op.banner = "Usage: run <config.yml>"
46
49
  op.on('-b', '--bundle BUNDLE_DIR', 'Path to a Gemfile directory') do |path|
47
50
  end
48
- op.on('-I', '--load-path PATH', 'Add ruby script directory path or jar file path') do |load_path|
51
+ op.on('-I', '--load-path PATH', 'Add ruby script directory path ($LOAD_PATH)') do |load_path|
49
52
  load_paths << load_path
50
53
  end
54
+ op.on('-C', '--classpath PATH', "Add java classpath separated by #{classpath_separator} (CLASSPATH)") do |classpath|
55
+ classpaths.concat classpath.split(classpath_separator)
56
+ end
51
57
  op.on('-o', '--output PATH', 'Path to a file to write the next configuration') do |path|
52
58
  options[:nextConfigOutputPath] = path
53
59
  end
@@ -60,9 +66,12 @@ module Embulk
60
66
  op.banner = "Usage: run <config.yml>"
61
67
  op.on('-b', '--bundle BUNDLE_DIR', 'Path to a Gemfile directory') do |path|
62
68
  end
63
- op.on('-I', '--load-path PATH', 'Add ruby script directory path or jar file path') do |load_path|
69
+ op.on('-I', '--load-path PATH', 'Add ruby script directory path ($LOAD_PATH)') do |load_path|
64
70
  load_paths << load_path
65
71
  end
72
+ op.on('-C', '--classpath PATH', "Add java classpath separated by #{classpath_separator} (CLASSPATH)") do |classpath|
73
+ classpaths.concat classpath.split(classpath_separator)
74
+ end
66
75
  op.on('-r', '--resume-state PATH', 'Path to a file to write or read resume state') do |path|
67
76
  options[:resumeStatePath] = path
68
77
  end
@@ -72,9 +81,12 @@ module Embulk
72
81
  op.banner = "Usage: preview <config.yml>"
73
82
  op.on('-b', '--bundle BUNDLE_DIR', 'Path to a Gemfile directory') do |path|
74
83
  end
75
- op.on('-I', '--load-path PATH', 'Add ruby script directory path or jar file path') do |load_path|
84
+ op.on('-I', '--load-path PATH', 'Add ruby script directory path ($LOAD_PATH)') do |load_path|
76
85
  load_paths << load_path
77
86
  end
87
+ op.on('-C', '--classpath PATH', "Add java classpath separated by #{classpath_separator} (CLASSPATH)") do |classpath|
88
+ classpaths.concat classpath.split(classpath_separator)
89
+ end
78
90
  args = 1..1
79
91
 
80
92
  when :guess
@@ -82,9 +94,12 @@ module Embulk
82
94
  op.on('-o', '--output PATH', 'Path to a file to write the guessed configuration') do |path|
83
95
  options[:nextConfigOutputPath] = path
84
96
  end
85
- op.on('-I', '--load-path PATH', 'Add ruby script directory path or jar file path') do |load_path|
97
+ op.on('-I', '--load-path PATH', 'Add ruby script directory path ($LOAD_PATH)') do |load_path|
86
98
  load_paths << load_path
87
99
  end
100
+ op.on('-C', '--classpath PATH', "Add java classpath separated by #{classpath_separator} (CLASSPATH)") do |classpath|
101
+ classpaths.concat classpath.split(classpath_separator)
102
+ end
88
103
  args = 1..1
89
104
 
90
105
  #when :generate # or :new
@@ -122,6 +137,7 @@ module Embulk
122
137
  require 'fileutils'
123
138
  require 'rubygems/gem_runner'
124
139
  setup_load_paths(load_paths)
140
+ setup_classpaths(classpaths)
125
141
 
126
142
  unless File.exists?(path)
127
143
  puts "Initializing #{path}..."
@@ -206,6 +222,7 @@ module Embulk
206
222
  end
207
223
 
208
224
  setup_load_paths(load_paths)
225
+ setup_classpaths(classpaths)
209
226
 
210
227
  org.embulk.command.Runner.new(options.to_json).main(subcmd, argv.to_java(:string))
211
228
  end
@@ -226,17 +243,19 @@ module Embulk
226
243
  end
227
244
 
228
245
  def self.setup_load_paths(load_paths)
246
+ # first $LOAD_PATH has highet priority. later load_paths should have highest priority.
229
247
  load_paths.each do |load_path|
230
- if File.file?(load_path)
231
- # jar files
232
- require File.expand_path(load_path)
233
- else
234
- # ruby script directory (add at the beginning of $LOAD_PATH to make it highest priority)
235
- $LOAD_PATH.unshift File.expand_path(load_path)
236
- end
248
+ # ruby script directory (use unshift to make it highest priority)
249
+ $LOAD_PATH.unshift File.expand_path(load_path)
237
250
  end
238
251
  end
239
252
 
253
+ def self.setup_classpaths(classpaths)
254
+ classpaths.each {|classpath|
255
+ $CLASSPATH << classpath # $CLASSPATH object doesn't have concat method
256
+ }
257
+ end
258
+
240
259
  def self.usage(message)
241
260
  STDERR.puts "usage: <command> [--options]"
242
261
  STDERR.puts "commands:"
@@ -1,3 +1,3 @@
1
1
  module Embulk
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <groupId>org.embulk</groupId>
6
6
  <artifactId>embulk-parent</artifactId>
7
- <version>0.3.0-SNAPSHOT</version>
7
+ <version>0.3.1-SNAPSHOT</version>
8
8
  <packaging>pom</packaging>
9
9
 
10
10
  <name>Embulk</name>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -122,9 +122,9 @@ files:
122
122
  - classpath/commons-codec-1.3.jar
123
123
  - classpath/commons-lang3-3.1.jar
124
124
  - classpath/commons-logging-1.2.jar
125
- - classpath/embulk-cli-0.3.0-SNAPSHOT.jar
126
- - classpath/embulk-core-0.3.0-SNAPSHOT.jar
127
- - classpath/embulk-standards-0.3.0-SNAPSHOT.jar
125
+ - classpath/embulk-cli-0.3.1-SNAPSHOT.jar
126
+ - classpath/embulk-core-0.3.1-SNAPSHOT.jar
127
+ - classpath/embulk-standards-0.3.1-SNAPSHOT.jar
128
128
  - classpath/guava-17.0.jar
129
129
  - classpath/guice-3.0.jar
130
130
  - classpath/guice-multibindings-3.0.jar