module Peony::Shell

Constants

SHELL_DELEGATED_METHODS

Public Instance Methods

shell() click to toggle source

Holds the shell for the given Thor instance. If no shell is given, it gets a default shell from Thor::Base.shell.

# File lib/peony/shell.rb, line 15
def shell
  @shell ||= if ENV['PEONY_SHELL'] && ENV['PEONY_SHELL'].size > 0
    Peony::Shell.const_get(ENV['PEONY_SHELL']).new
  elsif (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/) && !(ENV['ANSICON'])
    Peony::Shell::Basic.new
  else
    Peony::Shell::Color.new
  end
end
with_padding() { || ... } click to toggle source

Yields the given block with padding.

# File lib/peony/shell.rb, line 35
def with_padding
  self.padding.up
  yield
ensure
  self.padding.down
end