Module: DBum::Helpers

Included in:
App, Main
Defined in:
lib/dbum/helpers.rb

Overview

Mixins for DBum’s Thor subclasses.

Instance Method Summary collapse

Instance Method Details

#actionsObject

Shortcut for Thor::Actions.



25
# File 'lib/dbum/helpers.rb', line 25

def actions ; Thor::Actions end

#old_putsObject

Save the canonical implementation of “puts”



11
# File 'lib/dbum/helpers.rb', line 11

alias_method :old_puts, :puts

#puts(*args) ⇒ Object

Monkeypatch puts to support Thor::Shell::Color.



14
15
16
17
# File 'lib/dbum/helpers.rb', line 14

def puts *args
  return old_puts if args.empty?
  old_puts shell.set_color(*args)
end

#utilObject

Shortcut for Thor::Util.



21
# File 'lib/dbum/helpers.rb', line 21

def util ; Thor::Util end