class Fastball::CLI

Constants

HELP

Attributes

argv[R]

Public Class Methods

help_text() click to toggle source
# File lib/fastball/cli.rb, line 24
def self.help_text
  HELP.gsub(/^ {6}/, '')
end
new(argv) click to toggle source
# File lib/fastball/cli.rb, line 19
def initialize(argv)
  @argv = argv
  @command = argv.shift
end

Public Instance Methods

help_text() click to toggle source
# File lib/fastball/cli.rb, line 28
def help_text
  self.class.help_text
end
run() click to toggle source
# File lib/fastball/cli.rb, line 32
def run
  case @command
  when 'config'
    Fastball::Config.generate
  when 'help'
    puts help_text
  else
    puts help_text
    exit 1
  end
end