class Twigg::Command::Help

Constants

HELP_TOPICS
PUBLIC_HELP_TOPICS
TOPIC_HEADERS

Public Class Methods

new(*args) click to toggle source
Calls superclass method Twigg::Command::new
# File lib/twigg/command/help.rb, line 7
def initialize(*args)
  super
  @topic = @args.shift
  ignore @args
end

Public Instance Methods

run() click to toggle source
# File lib/twigg/command/help.rb, line 13
def run
  if HELP_TOPICS.include?(@topic)
    show_help(@topic)
  else
    PUBLIC_HELP_TOPICS.each { |topic| show_help(topic) }
  end
end

Private Instance Methods

app() click to toggle source
# File lib/twigg/command/help.rb, line 34
      def app
        <<-DOC
          twigg app [-D|--daemon] [-P|--pidfile <pidfile>]
        DOC
      end
commands() click to toggle source
# File lib/twigg/command/help.rb, line 40
      def commands
        <<-DOC
          twigg app     # run the Twigg web app
          twigg gerrit  # clone/update/report from Gerrit
          twigg git     # perform operations on Git repos
          twigg github  # clone/update from GitHub
          twigg init    # generate a .twiggrc file
          twigg help    # this help information
          twigg pivotal # show open stories in Pivotal Tracker
          twigg stats   # show statistics about repos
        DOC
      end
gerrit() click to toggle source
# File lib/twigg/command/help.rb, line 53
      def gerrit
        <<-DOC
          twigg gerrit clone [repos dir]  # clone repos into repos dir
          twigg gerrit update [repos dir] # update repos in repos dir
          twigg gerrit stats [repos dir]  # show stats for repos in dir
        DOC
      end
git() click to toggle source
# File lib/twigg/command/help.rb, line 61
      def git
        <<-DOC
          twigg git gc [repos dir] # garbage collect repos in repos dir
        DOC
      end
github() click to toggle source
# File lib/twigg/command/help.rb, line 67
      def github
        <<-DOC
          twigg github clone [repos dir]  # clone repos into repos dir
          twigg github update [repos dir] # update repos in repos dir
        DOC
      end
help() click to toggle source
# File lib/twigg/command/help.rb, line 74
      def help
        <<-DOC
          twigg help              # this help information
          twigg help <subcommand> # help for a specific subcommand
          twigg help commands     # list all subcommands
        DOC
      end
init() click to toggle source
# File lib/twigg/command/help.rb, line 82
      def init
        <<-DOC
          twigg init # emit a sample .twiggrc file to standard out
        DOC
      end
pivotal() click to toggle source
# File lib/twigg/command/help.rb, line 88
      def pivotal
        <<-DOC
          twigg pivotal stats # show overview of open stories
        DOC
      end
russian() click to toggle source
# File lib/twigg/command/help.rb, line 94
      def russian
        <<-DOC
          twigg russian <repos dir> <number of days> # easter egg
        DOC
      end
show_help(topic) click to toggle source
# File lib/twigg/command/help.rb, line 29
def show_help(topic)
  puts TOPIC_HEADERS[topic] + ':'
  stderr strip_heredoc(send(topic), indent: 2) + "\n"
end
stats() click to toggle source
# File lib/twigg/command/help.rb, line 100
      def stats
        <<-DOC
          twigg stats [--verbose|-v] <repos dir> <number of days>
        DOC
      end
usage() click to toggle source
# File lib/twigg/command/help.rb, line 106
      def usage
        <<-DOC
          twigg <subcommand> [options] <arguments...>
          twigg help
        DOC
      end