In Files

Parent

Namespace

Class/Module Index [+]

Quicksearch

Rouge::CLI::Help

Public Class Methods

desc() click to toggle source
# File lib/rouge/cli.rb, line 114
def self.desc
  "print help info"
end
doc() click to toggle source
# File lib/rouge/cli.rb, line 118
  def self.doc
    return enum_for(:doc) unless block_given?

    yield %|usage: rougify help <command>|
    yield %||
    yield %|print help info for <command>.|
  end

  def self.parse(argv)
    opts = { :mode => CLI }
    until argv.empty?
      arg = argv.shift
      klass = class_from_arg(arg)
      if klass
        opts[:mode] = klass
        next
      end
    end
    new(opts)
  end

  def initialize(opts={})
    @mode = opts[:mode]
  end

  def run
    @mode.doc.each(&method(:puts))
  end
end
new(opts={}) click to toggle source
# File lib/rouge/cli.rb, line 139
def initialize(opts={})
  @mode = opts[:mode]
end
parse(argv) click to toggle source
# File lib/rouge/cli.rb, line 126
def self.parse(argv)
  opts = { :mode => CLI }
  until argv.empty?
    arg = argv.shift
    klass = class_from_arg(arg)
    if klass
      opts[:mode] = klass
      next
    end
  end
  new(opts)
end

Public Instance Methods

run() click to toggle source
# File lib/rouge/cli.rb, line 143
def run
  @mode.doc.each(&method(:puts))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.