Module: Ing

Extended by:
Ing
Included in:
Ing
Defined in:
lib/ing.rb,
lib/ing/task.rb,
lib/ing/util.rb,
lib/ing/files.rb,
lib/ing/shell.rb,
lib/ing/command.rb,
lib/ing/version.rb,
lib/ing/generator.rb,
lib/ing/commands/boot.rb,
lib/ing/commands/help.rb,
lib/ing/commands/list.rb,
lib/ing/commands/setup.rb,
lib/ing/common_options.rb,
lib/ing/default_command.rb,
lib/ing/actions/directory.rb,
lib/ing/commands/generate.rb,
lib/ing/commands/implicit.rb,
lib/ing/actions/create_file.rb,
lib/ing/actions/create_link.rb,
lib/ing/option_parsers/trollop.rb,
lib/ing/actions/empty_directory.rb,
lib/ing/actions/inject_into_file.rb,
lib/ing/actions/file_manipulation.rb

Defined Under Namespace

Modules: Boot, Commands, CommonOptions, DefaultCommand, Files, OptionParsers, Shell, Util Classes: Command, Generator, Option, Task

Constant Summary collapse

Error =
Class.new(StandardError)
FileNotFoundError =
Class.new(Error)
VERSION =
'0.2.7'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#shell_classObject



31
32
33
# File 'lib/ing.rb', line 31

def shell_class
  @shell_class ||= Shell::Basic
end

Instance Method Details

#callstackObject



80
81
82
# File 'lib/ing.rb', line 80

def callstack
  _callstack.to_a
end

#execute(klass, meth = :call, *args, &config) ⇒ Object



66
67
68
69
70
# File 'lib/ing.rb', line 66

def execute(klass, meth=:call, *args, &config)
  cmd = command.new(klass, meth, *args)
  _callstack.push(cmd.command_class, cmd.command_meth)
  cmd.execute(&config)
end

#executed?(klass, meth) ⇒ Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/ing.rb', line 76

def executed?(klass, meth)
  !!_callstack.index(klass, meth)
end

#invoke(klass, meth = :call, *args, &config) ⇒ Object



72
73
74
# File 'lib/ing.rb', line 72

def invoke(klass, meth=:call, *args, &config)
  execute(klass, meth, *args, &config) unless executed?(klass, meth)
end

#run(args = ARGV) ⇒ Object



61
62
63
64
# File 'lib/ing.rb', line 61

def run(args=ARGV)
  booter = extract_boot_class!(args) || implicit_booter
  execute booter, *args
end