Module Command
In: lib/command/definition.rb
lib/command/env.rb
lib/command/decoratinghash.rb
lib/command/parser.rb
lib/command/argument.rb
lib/command/nofileerror.rb
lib/command/result.rb
lib/command/types.rb
lib/command/nodirectoryerror.rb
lib/command/version.rb
lib/command/directorynotfounderror.rb
lib/command/option.rb
lib/command/filenotfounderror.rb
lib/command.rb

Methods

define   with  

Classes and Modules

Module Command::VERSION
Class Command::DecoratingHash
Class Command::Definition
Class Command::DirectoryNotFoundError
Class Command::FileNotFoundError
Class Command::NoDirectoryError
Class Command::NoFileError
Class Command::Parser

Constants

Env = Struct.new(:name, :variable)
Argument = Struct.new(:name, :bare, :usage, :type, :description)
Result = Struct.new(:command, :options, :arguments)
Types = { :Virtual => nil, :Boolean => proc { |v| v =~ /\A(?:true|y(?:es)?)\z/i }, :String => proc { |v| v }, :Integer => proc { |v| Integer(v) }, :Octal => proc { |v| Intever("0#{v}") }, :Hex => proc { |v| Integer("0x#{v}") }, :Float => proc { |v| Float(v) }, :File => proc { |v| raise FileNotFoundError, "No such file or directory - #{v}" unless File.exist?(v)
Option = Struct.new(:name, :short, :long, :negated, :necessity, :type, :declaration, :description) do def process!(argument)

Public Class methods

[Source]

    # File lib/command.rb, line 26
26:   def self.define(*args, &block)
27:     @main = Definition.new(*args, &block)
28:     @main
29:   end

[Source]

    # File lib/command.rb, line 31
31:   def self.with(argv, &block)
32:     parser = Parser.new($command, argv)
33:     parser.instance_eval(&block)
34:     parser
35:   end

[Validate]