Class: Mjolnir

Inherits:
Thor
  • Object
show all
Defined in:
lib/bender/mjolnir.rb

Overview

Thor’s hammer! Like Thor with better logging

Direct Known Subclasses

Bender::Main

Constant Summary collapse

COMMON_OPTIONS =

Common options for Thor commands

{
  log: {
    type: :string,
    aliases: %w[ -L ],
    desc: 'Log to file instead of STDOUT',
    default: ENV['BENDER_LOG'] || nil
  },
  debug: {
    type: :boolean,
    aliases: %w[ -V ],
    desc: 'Enable DEBUG-level logging',
    default: ENV['BENDER_DEBUG'] || false
  }
}

Class Method Summary collapse

Class Method Details

.include_common_optionsObject

Decorate Thor commands with the options above



25
26
27
28
29
# File 'lib/bender/mjolnir.rb', line 25

def self.include_common_options
  COMMON_OPTIONS.each do |name, spec|
    option name, spec
  end
end