lib/chronicle/etl/cli/connectors.rb in chronicle-etl-0.5.5 vs lib/chronicle/etl/cli/connectors.rb in chronicle-etl-0.6.1
- old
+ new
@@ -8,19 +8,19 @@
# @todo make this work with new plugin system (i.e. no loading of all plugins)
class Connectors < SubcommandBase
default_task 'list'
namespace :connectors
- desc "list", "Lists available connectors"
+ desc 'list', 'Lists available connectors'
# Display all available connectors that chronicle-etl has access to
def list
connector_info = Chronicle::ETL::Registry::Connectors.connectors.map do |connector_registration|
{
identifier: connector_registration.identifier,
phase: connector_registration.phase,
description: connector_registration.descriptive_phrase,
- provider: connector_registration.provider,
+ source: connector_registration.source,
core: connector_registration.built_in? ? '✓' : '',
class: connector_registration.klass_name
}
end
@@ -34,14 +34,14 @@
table = TTY::Table.new(headers, connector_info.map(&:values))
puts table.render(indent: 0, padding: [0, 2])
end
- desc "show PHASE IDENTIFIER", "Show information about a connector"
+ desc 'show PHASE IDENTIFIER', 'Show information about a connector'
def show(phase, identifier)
- unless ['extractor', 'transformer', 'loader'].include?(phase)
- cli_fail(message: "Phase argument must be one of: [extractor, transformer, loader]")
+ unless %w[extractor transformer loader].include?(phase)
+ cli_fail(message: 'Phase argument must be one of: [extractor, transformer, loader]')
end
begin
connector = Chronicle::ETL::Registry::Connectors.find_by_phase_and_identifier(phase.to_sym, identifier)
rescue Chronicle::ETL::ConnectorNotAvailableError, Chronicle::ETL::PluginError => e
@@ -49,12 +49,12 @@
end
puts connector.klass.to_s.bold
puts " #{connector.descriptive_phrase}"
puts
- puts "Settings:"
+ puts 'Settings:'
- headers = ['name', 'default', 'required'].map{ |h| h.to_s.upcase.bold }
+ headers = %w[name default required].map { |h| h.to_s.upcase.bold }
settings = connector.klass.settings.map do |name, setting|
[
name,
setting.default,