module Ratch::CLI

TODO: How best to support CLI interface?

Public Class Methods

extended(base) click to toggle source
# File lib/ratch/utils/cli.rb, line 12
def self.extended(base)
  require 'facets/argvector'
end
included(base) click to toggle source
# File lib/ratch/utils/cli.rb, line 7
def self.included(base)
  require 'facets/argvector'
end
new(*args) click to toggle source
Calls superclass method
# File lib/ratch/utils/cli.rb, line 17
def initialize(*args)
  argv = ArgVector.new(ARGV)

  @arguments, parameters = *argv.parameters

  args << {} unless Hash === args.last

  opts = args.last

  opts.merge!(parameters)

  super(*args)
end

Public Instance Methods

arguments() click to toggle source
# File lib/ratch/utils/cli.rb, line 32
def arguments
  @arguments
end