Class: Embulk::PluginManager
- Inherits:
-
Object
- Object
- Embulk::PluginManager
- Defined in:
- lib/embulk/plugin.rb
Instance Method Summary collapse
- #get_decoder(type) ⇒ Object
- #get_encoder(type) ⇒ Object
- #get_formatter(type) ⇒ Object
- #get_guess(type) ⇒ Object
- #get_input(type) ⇒ Object
- #get_output(type) ⇒ Object
- #get_parser(type) ⇒ Object
-
#initialize ⇒ PluginManager
constructor
A new instance of PluginManager.
- #new_java_decoder(type) ⇒ Object
- #new_java_encoder(type) ⇒ Object
- #new_java_formatter(type) ⇒ Object
- #new_java_guess(type) ⇒ Object
- #new_java_input(type) ⇒ Object
- #new_java_output(type) ⇒ Object
- #new_java_parser(type) ⇒ Object
- #register_decoder(type, klass) ⇒ Object
- #register_encoder(type, klass) ⇒ Object
- #register_formatter(type, klass) ⇒ Object
- #register_guess(type, klass) ⇒ Object
- #register_input(type, klass) ⇒ Object
- #register_output(type, klass) ⇒ Object
- #register_parser(type, klass) ⇒ Object
Constructor Details
#initialize ⇒ PluginManager
Returns a new instance of PluginManager.
15 16 17 18 19 20 |
# File 'lib/embulk/plugin.rb', line 15 def initialize @registries = {} %w[input output parser formatter decoder encoder line_filter guess].each do |category| @registries[category.to_sym] = PluginRegistry.new(category, "embulk/#{category}_") end end |
Instance Method Details
#get_decoder(type) ⇒ Object
72 73 74 75 |
# File 'lib/embulk/plugin.rb', line 72 def get_decoder(type) # TODO not implemented yet lookup(:guess, type) end |
#get_encoder(type) ⇒ Object
77 78 79 80 |
# File 'lib/embulk/plugin.rb', line 77 def get_encoder(type) # TODO not implemented yet lookup(:guess, type) end |
#get_formatter(type) ⇒ Object
67 68 69 70 |
# File 'lib/embulk/plugin.rb', line 67 def get_formatter(type) # TODO not implemented yet lookup(:guess, type) end |
#get_guess(type) ⇒ Object
82 83 84 85 |
# File 'lib/embulk/plugin.rb', line 82 def get_guess(type) # TODO not implemented yet lookup(:guess, type) end |
#get_input(type) ⇒ Object
52 53 54 55 |
# File 'lib/embulk/plugin.rb', line 52 def get_input(type) # TODO not implemented yet lookup(:guess, type) end |
#get_output(type) ⇒ Object
57 58 59 60 |
# File 'lib/embulk/plugin.rb', line 57 def get_output(type) # TODO not implemented yet lookup(:guess, type) end |
#get_parser(type) ⇒ Object
62 63 64 65 |
# File 'lib/embulk/plugin.rb', line 62 def get_parser(type) # TODO not implemented yet lookup(:guess, type) end |
#new_java_decoder(type) ⇒ Object
103 104 105 |
# File 'lib/embulk/plugin.rb', line 103 def new_java_decoder(type) lookup(:decoder, type).java_object end |
#new_java_encoder(type) ⇒ Object
107 108 109 |
# File 'lib/embulk/plugin.rb', line 107 def new_java_encoder(type) lookup(:encoder, type).java_object end |
#new_java_formatter(type) ⇒ Object
99 100 101 |
# File 'lib/embulk/plugin.rb', line 99 def new_java_formatter(type) lookup(:formatter, type).java_object end |
#new_java_guess(type) ⇒ Object
111 112 113 |
# File 'lib/embulk/plugin.rb', line 111 def new_java_guess(type) lookup(:guess, type).java_object end |
#new_java_input(type) ⇒ Object
87 88 89 |
# File 'lib/embulk/plugin.rb', line 87 def new_java_input(type) lookup(:input, type).java_object end |
#new_java_output(type) ⇒ Object
91 92 93 |
# File 'lib/embulk/plugin.rb', line 91 def new_java_output(type) lookup(:output, type).java_object end |
#new_java_parser(type) ⇒ Object
95 96 97 |
# File 'lib/embulk/plugin.rb', line 95 def new_java_parser(type) lookup(:parser, type).java_object end |
#register_decoder(type, klass) ⇒ Object
39 40 41 |
# File 'lib/embulk/plugin.rb', line 39 def register_decoder(type, klass) register_plugin(:decoder, type, klass, DecoderPlugin) end |
#register_encoder(type, klass) ⇒ Object
43 44 45 |
# File 'lib/embulk/plugin.rb', line 43 def register_encoder(type, klass) register_plugin(:encoder, type, klass, EncoderPlugin) end |
#register_formatter(type, klass) ⇒ Object
35 36 37 |
# File 'lib/embulk/plugin.rb', line 35 def register_formatter(type, klass) register_plugin(:formatter, type, klass, FormatterPlugin) end |
#register_guess(type, klass) ⇒ Object
47 48 49 50 |
# File 'lib/embulk/plugin.rb', line 47 def register_guess(type, klass) register_plugin(:guess, type, klass, GuessPlugin, "Guess plugin #{klass} must extend GuessPlugin, LineGuessPlugin, or TextGuessPlugin class") end |
#register_input(type, klass) ⇒ Object
22 23 24 |
# File 'lib/embulk/plugin.rb', line 22 def register_input(type, klass) register_plugin(:input, type, klass, InputPlugin) end |
#register_output(type, klass) ⇒ Object
26 27 28 29 |
# File 'lib/embulk/plugin.rb', line 26 def register_output(type, klass) register_plugin(:output, type, klass, OutputPlugin, "Output plugin #{klass} must extend OutputPlugin") end |
#register_parser(type, klass) ⇒ Object
31 32 33 |
# File 'lib/embulk/plugin.rb', line 31 def register_parser(type, klass) register_plugin(:parser, type, klass, ParserPlugin) end |