module Thor::Actions
def inside(dir='', config={}, &block)
config
dir
==== Parameters
the method exits.
to the block you provide. The path is set back to the previous path when
is given it's referenced from the current root. The full path is yielded
Do something in the root or on a provided subfolder. If a relative path
def inside(dir='', config={}, &block) verbose = config.fetch(:verbose, false) say_status :inside, dir, verbose shell.padding += 1 if verbose @destination_stack.push File.expand_path(dir, destination_root) FileUtils.mkdir_p(destination_root) unless File.exist?(destination_root) FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield } @destination_stack.pop shell.padding -= 1 if verbose end