class StacksOnDeck::Mjolnir
Thor's hammer! Like Thor with better logging
Constants
- COMMON_OPTIONS
Common options for Thor commands
Public Class Methods
include_common_options()
click to toggle source
Decorate Thor commands with the options above
# File lib/stacksondeck/mjolnir.rb, line 27 def self.include_common_options COMMON_OPTIONS.each do |name, spec| option name, spec end end
Public Instance Methods
log()
click to toggle source
Construct a Logger given the command-line options
# File lib/stacksondeck/mjolnir.rb, line 37 def log return @logger if defined? @logger level = :info level = :debug if options.debug? device = options.log || $stderr pretty = device.tty? rescue false @logger = Slog.new \ out: device, level: level, colorize: pretty, prettify: pretty end