module Thor::Hollaback::CommandExt

Extensions that get loaded into the Thor command class

Public Class Methods

prepended(base) click to toggle source
# File lib/thor/hollaback.rb, line 54
def self.prepended(base)
  base.send(:attr_accessor, :callback_chain)
end

Public Instance Methods

run(cli, *args) click to toggle source
Calls superclass method
# File lib/thor/hollaback.rb, line 58
def run(cli, *args)
  if !callback_chain ||
     (callback_chain.empty? && cli.class.class_callback_chain.empty?)

    super
  else
    combined = callback_chain + cli.class.class_callback_chain
    combined.compile { super }.call(cli)
  end
end