lib/chronicle/etl/cli/main.rb in chronicle-etl-0.5.5 vs lib/chronicle/etl/cli/main.rb in chronicle-etl-0.6.1
- old
+ new
@@ -11,11 +11,11 @@
class_option :log_level, desc: 'Log level (debug, info, warn, error, fatal, silent)', default: 'info'
class_option :verbose, aliases: '-v', desc: 'Set log level to verbose', type: :boolean
class_option :silent, desc: 'Silence all output', type: :boolean
class_option :'no-color', desc: 'Disable colour output', type: :boolean
- default_task "jobs"
+ default_task 'jobs'
desc 'connectors:COMMAND', 'Connectors available for ETL jobs', hide: true
subcommand 'connectors', Connectors
desc 'jobs:COMMAND', 'Configure and run jobs', hide: true
@@ -43,70 +43,70 @@
def self.exit_on_failure?
true
end
- desc "version", "Show version"
- map %w(--version -v) => :version
+ desc 'version', 'Show version'
+ map %w[--version -v] => :version
def version
shell.say "chronicle-etl #{Chronicle::ETL::VERSION}"
end
# Displays help options for chronicle-etl
- def help(meth = nil, subcommand = false)
+ def help(meth = nil, _subcommand = false)
if meth && !respond_to?(meth)
klass, task = ::Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
- klass.start(['-h', task].compact, shell: shell)
+ klass.start(['-h', task].compact, shell:)
else
- shell.say "ABOUT:".bold
+ shell.say 'ABOUT:'.bold
shell.say " #{'chronicle-etl'.italic} is a toolkit for extracting and working with your digital"
- shell.say " history. 📜"
+ shell.say ' history. 📜'
shell.say
shell.say " A job #{'extracts'.underline} personal data from a source, #{'transforms'.underline} it (Chronicle"
shell.say " Schema or preserves raw data), and then #{'loads'.underline} it to a destination. Use"
- shell.say " built-in extractors (json, csv, stdin) and loaders (csv, json, table,"
- shell.say " rest) or use plugins to connect to third-party services."
+ shell.say ' built-in extractors (json, csv, stdin) and loaders (csv, json, table,'
+ shell.say ' rest) or use plugins to connect to third-party services.'
shell.say
- shell.say " Plugins: https://github.com/chronicle-app/chronicle-etl#currently-available"
+ shell.say ' Plugins: https://github.com/chronicle-app/chronicle-etl#currently-available'
shell.say
- shell.say "USAGE:".bold
- shell.say " # Basic job usage:".italic.light_black
- shell.say " $ chronicle-etl --extractor NAME --transformer NAME --loader NAME"
+ shell.say 'USAGE:'.bold
+ shell.say ' # Basic job usage:'.italic.light_black
+ shell.say ' $ chronicle-etl --extractor NAME --transformer NAME --loader NAME'
shell.say
- shell.say " # Read test.csv and display it to stdout as a table:".italic.light_black
- shell.say " $ chronicle-etl --extractor csv --input data.csv --loader table"
+ shell.say ' # Read test.csv and display it to stdout as a table:'.italic.light_black
+ shell.say ' $ chronicle-etl --extractor csv --input data.csv --loader table'
shell.say
- shell.say " # Show available plugins:".italic.light_black
- shell.say " $ chronicle-etl plugins:list"
+ shell.say ' # Show available plugins:'.italic.light_black
+ shell.say ' $ chronicle-etl plugins:list'
shell.say
- shell.say " # Save an access token as a secret and use it in a job:".italic.light_black
- shell.say " $ chronicle-etl secrets:set pinboard access_token username:foo123"
- shell.say " $ chronicle-etl secrets:list"
- shell.say " $ chronicle-etl -e pinboard --since 1mo"
+ shell.say ' # Save an access token as a secret and use it in a job:'.italic.light_black
+ shell.say ' $ chronicle-etl secrets:set pinboard access_token username:foo123'
+ shell.say ' $ chronicle-etl secrets:list'
+ shell.say ' $ chronicle-etl -e pinboard --since 1mo'
shell.say
- shell.say " # Show full job options:".italic.light_black
- shell.say " $ chronicle-etl jobs help run"
+ shell.say ' # Show full job options:'.italic.light_black
+ shell.say ' $ chronicle-etl jobs help run'
shell.say
- shell.say "FULL DOCUMENTATION:".bold
- shell.say " https://github.com/chronicle-app/chronicle-etl".blue
+ shell.say 'FULL DOCUMENTATION:'.bold
+ shell.say ' https://github.com/chronicle-app/chronicle-etl'.blue
shell.say
list = []
::Thor::Util.thor_classes_in(Chronicle::ETL::CLI).each do |thor_class|
list += thor_class.printable_tasks(false)
end
list.sort! { |a, b| a[0] <=> b[0] }
- list.unshift ["help", "# This help menu"]
+ list.unshift ['help', '# This help menu']
shell.say
shell.say 'ALL COMMANDS:'.bold
shell.print_table(list, indent: 2, truncate: true)
shell.say
- shell.say "VERSION:".bold
+ shell.say 'VERSION:'.bold
shell.say " #{Chronicle::ETL::VERSION}"
shell.say
- shell.say " Display current version:".italic.light_black
- shell.say " $ chronicle-etl --version"
+ shell.say ' Display current version:'.italic.light_black
+ shell.say ' $ chronicle-etl --version'
end
end
no_commands do
def set_color_output