Module: Embulk
- Defined in:
- lib/embulk/version.rb,
lib/embulk.rb,
lib/embulk/exec.rb,
lib/embulk/page.rb,
lib/embulk/error.rb,
lib/embulk/buffer.rb,
lib/embulk/column.rb,
lib/embulk/logger.rb,
lib/embulk/plugin.rb,
lib/embulk/runner.rb,
lib/embulk/schema.rb,
lib/embulk/guess/csv.rb,
lib/embulk/file_input.rb,
lib/embulk/guess/gzip.rb,
lib/embulk/guess/json.rb,
lib/embulk/data_source.rb,
lib/embulk/file_output.rb,
lib/embulk/guess/bzip2.rb,
lib/embulk/java_plugin.rb,
lib/embulk/guess_plugin.rb,
lib/embulk/input_plugin.rb,
lib/embulk/page_builder.rb,
lib/embulk/filter_plugin.rb,
lib/embulk/guess/charset.rb,
lib/embulk/guess/newline.rb,
lib/embulk/output_plugin.rb,
lib/embulk/parser_plugin.rb,
lib/embulk/decoder_plugin.rb,
lib/embulk/encoder_plugin.rb,
lib/embulk/java/bootstrap.rb,
lib/embulk/executor_plugin.rb,
lib/embulk/plugin_registry.rb,
lib/embulk/formatter_plugin.rb,
lib/embulk/java/time_helper.rb,
lib/embulk/data/package_data.rb,
lib/embulk/file_input_plugin.rb,
lib/embulk/file_output_plugin.rb,
lib/embulk/guess/csv_all_strings.rb,
lib/embulk/data/bundle/embulk/input/example.rb,
lib/embulk/data/bundle/embulk/filter/example.rb,
lib/embulk/data/bundle/embulk/output/example.rb
Overview
Defined Under Namespace
Modules: Exec, Filter, Guess, Impl, Input, Java, Output, Plugin, Type
Classes: Buffer, Column, ConfigError, DataError, DataSource, DecoderPlugin, EmbulkRunner, EncoderPlugin, ExecutorPlugin, FileInput, FileInputPlugin, FileOutput, FileOutputPlugin, FilterPlugin, FormatterPlugin, GuessPlugin, InputPlugin, JavaPlugin, LineGuessPlugin, Logger, OutputPlugin, PackageData, Page, PageBuilder, ParserPlugin, PluginLoadError, PluginManager, PluginRegistry, Schema, Slf4jAdapter, StandardLoggerAdapter, TextGuessPlugin
Constant Summary
collapse
- VERSION_INTERNAL =
'0.8.33'
- 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!'
- @@logger =
Logger.new(STDOUT)
- @@warned =
false
Class Method Summary
collapse
Class Method Details
.const_missing(name) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/embulk/version.rb', line 9
def self.const_missing(name)
if name == :VERSION
unless @@warned
if Embulk.method_defined?(:logger)
Embulk.logger.warn(DEPRECATED_MESSAGE)
@@warned = true
else
STDERR.puts(DEPRECATED_MESSAGE)
end
end
return VERSION_INTERNAL
else
super
end
end
|
.lib_path(path) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/embulk.rb', line 5
def self.lib_path(path)
path = '' if path == '/'
jar, resource = __FILE__.split("!", 2)
if resource
lib = resource.split("/")[0..-2].join("/")
"#{jar}!#{lib}/#{path}"
elsif __FILE__ =~ /^(?:classpath|uri:classloader):/
lib = __FILE__.split("/")[0..-2].join("/")
"#{lib}/#{path}"
else
lib = File.expand_path File.dirname(__FILE__)
File.join(lib, *path.split("/"))
end
end
|
.logger ⇒ Object
144
145
146
|
# File 'lib/embulk/logger.rb', line 144
def self.logger
@@logger
end
|
.logger=(logger) ⇒ Object
148
149
150
|
# File 'lib/embulk/logger.rb', line 148
def self.logger=(logger)
@@logger = logger
end
|
.require_classpath(already_warned = false) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/embulk.rb', line 20
def self.require_classpath(already_warned=false)
if __FILE__.include?("!")
elsif __FILE__ =~ /^(?:classpath|uri:classloader):/
else
unless already_warned
STDERR.puts "################################################################################"
STDERR.puts "[WARN] Embulk's gem package is deprecated, and will be removed from v0.9."
STDERR.puts "[WARN] Use the jar version installed from http://dl.embulk.org/ instead."
STDERR.puts "[WARN] See the issue and comment at: https://github.com/embulk/embulk/issues/628"
STDERR.puts "################################################################################"
STDERR.puts ""
end
gem_root = File.expand_path('..', File.dirname(__FILE__))
classpath_dir = File.join(gem_root, "classpath")
jars = Dir.entries(classpath_dir).select{|f| f =~ /\.jar$/ }.sort
jars.each do |jar|
require File.join(classpath_dir, jar)
end
end
end
|
.setup(system_config = {}) ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/embulk.rb', line 50
def self.setup(system_config={})
STDERR.puts "################################################################################"
STDERR.puts "[WARN] Embulk's gem package is deprecated, and will be removed from v0.9."
STDERR.puts "[WARN] Use the jar version installed from http://dl.embulk.org/ instead."
STDERR.puts "[WARN] See the issue and comment at: https://github.com/embulk/embulk/issues/628"
STDERR.puts "################################################################################"
STDERR.puts ""
unless RUBY_PLATFORM =~ /java/i
raise "Embulk.setup works only with JRuby."
end
require_classpath(true)
require 'embulk/runner'
runner_java = EmbulkRunner.new(Java::org.embulk.EmbulkSetup::setup(Java::java.util.HashMap.new(system_config)))
Embulk.const_set :Runner, runner_java
end
|