module Bundler::Thor::Shell
def _shared_configuration #:nodoc:
Allow shell to be shared between invocations.
def _shared_configuration #:nodoc: super.merge!(:shell => shell) end
def initialize(args = [], options = {}, config = {})
MyScript.new [1.0], { :foo => :bar }, :shell => Bundler::Thor::Shell::Basic.new
end
argument :first, :type => :numeric
class MyScript < Bundler::Thor
==== Examples
shell
def initialize(args = [], options = {}, config = {}) super self.shell = config[:shell] shell.base ||= self if shell.respond_to?(:base) end
def shell
Holds the shell for the given Bundler::Thor instance. If no shell is given,
def shell @shell ||= Bundler::Thor::Base.shell.new end
def with_padding
def with_padding shell.padding += 1 yield ensure shell.padding -= 1 end