Methods
E
I
L
N
O
P
R
S
Included Modules
Constants
Version = '3.3.1'
 
Copyright = 'Copyright (c) 2000-2004 Minero Aoki'
 
TASKS = [ [ 'all', 'do config, setup, then install' ], [ 'config', 'saves your configurations' ], [ 'show', 'shows current configuration' ], [ 'setup', 'compiles ruby extentions and others' ], [ 'install', 'installs files' ], [ 'clean', "does `make clean' for each extention" ], [ 'distclean',"does `make distclean' for each extention" ] ]
 
Class Public methods
instance()
# File rails/actionwebservice/setup.rb, line 698
def ToplevelInstaller.instance
  @singleton ||= new(File.dirname($0))
  @singleton
end
invoke()
# File rails/actionwebservice/setup.rb, line 692
def ToplevelInstaller.invoke
  instance().invoke
end
new(ardir_root)
# File rails/actionwebservice/setup.rb, line 705
def initialize(ardir_root)
  @config = nil
  @options = { 'verbose' => true }
  @ardir = File.expand_path(ardir_root)
end
Instance Public methods
exec_clean()
# File rails/actionwebservice/setup.rb, line 915
def exec_clean
  @installer.exec_clean
end
exec_config()

Task Handlers

# File rails/actionwebservice/setup.rb, line 896
def exec_config
  @installer.exec_config
  @config.save   # must be final
end
exec_distclean()
# File rails/actionwebservice/setup.rb, line 919
def exec_distclean
  @installer.exec_distclean
end
exec_install()
# File rails/actionwebservice/setup.rb, line 905
def exec_install
  @installer.exec_install
end
exec_setup()
# File rails/actionwebservice/setup.rb, line 901
def exec_setup
  @installer.exec_setup
end
exec_show()
# File rails/actionwebservice/setup.rb, line 909
def exec_show
  ConfigTable.each do |i|
    printf "%-20s %s\n", i.name, i.value
  end
end
init_installers()
# File rails/actionwebservice/setup.rb, line 751
def init_installers
  @installer = Installer.new(@config, @options, @ardir, File.expand_path('.'))
end
inspect()
# File rails/actionwebservice/setup.rb, line 711
def inspect
  "#<#{self.class} #{__id__()}>"
end
invoke()
# File rails/actionwebservice/setup.rb, line 715
def invoke
  run_metaconfigs
  case task = parsearg_global()
  when nil, 'all'
    @config = load_config('config')
    parsearg_config
    init_installers
    exec_config
    exec_setup
    exec_install
  else
    @config = load_config(task)
    __send__ "parsearg_#{task}"
    init_installers
    __send__ "exec_#{task}"
  end
end
load_config(task)
# File rails/actionwebservice/setup.rb, line 737
def load_config(task)
  case task
  when 'config'
    ConfigTable.new
  when 'clean', 'distclean'
    if File.exist?(ConfigTable.savefile)
    then ConfigTable.load
    else ConfigTable.new
    end
  else
    ConfigTable.load
  end
end
objdir_root()
# File rails/actionwebservice/setup.rb, line 763
def objdir_root
  '.'
end
parsearg_clean()
parsearg_config()
# File rails/actionwebservice/setup.rb, line 822
def parsearg_config
  re = %r\A--(#{ConfigTable.map {|i| i.name }.join('|')})(?:=(.*))?\z/
  @options['config-opt'] = []

  while i = ARGV.shift
    if %r\A--?\z/ =~ i
      @options['config-opt'] = ARGV.dup
      break
    end
    m = re.match(i)  or setup_rb_error "config: unknown option #{i}"
    name, value = *m.to_a[1,2]
    @config[name] = value
  end
end
parsearg_distclean()
parsearg_global()

Option Parsing

# File rails/actionwebservice/setup.rb, line 775
def parsearg_global
  valid_task = %r\A(?:#{TASKS.map {|task,desc| task }.join '|'})\z/

  while arg = ARGV.shift
    case arg
    when %r\A\w+\z/
      setup_rb_error "invalid task: #{arg}" unless valid_task =~ arg
      return arg

    when '-q', '--quiet'
      @options['verbose'] = false

    when       '--verbose'
      @options['verbose'] = true

    when '-h', '--help'
      print_usage $stdout
      exit 0

    when '-v', '--version'
      puts "#{File.basename($0)} version #{Version}"
      exit 0
    
    when '--copyright'
      puts Copyright
      exit 0

    else
      setup_rb_error "unknown global option '#{arg}'"
    end
  end

  nil
end
parsearg_install()
# File rails/actionwebservice/setup.rb, line 837
def parsearg_install
  @options['no-harm'] = false
  @options['install-prefix'] = ''
  while a = ARGV.shift
    case a
    when %r\A--no-harm\z/
      @options['no-harm'] = true
    when %r\A--prefix=(.*)\z/
      path = $1
      path = File.expand_path(path) unless path[0,1] == '/'
      @options['install-prefix'] = path
    else
      setup_rb_error "install: unknown option #{a}"
    end
  end
end
parsearg_no_options()
# File rails/actionwebservice/setup.rb, line 811
def parsearg_no_options
  unless ARGV.empty?
    setup_rb_error "#{task}:  unknown options: #{ARGV.join ' '}"
  end
end
parsearg_setup()
parsearg_show()
print_usage(out)
# File rails/actionwebservice/setup.rb, line 854
def print_usage(out)
  out.puts 'Typical Installation Procedure:'
  out.puts "  $ ruby #{File.basename $0} config"
  out.puts "  $ ruby #{File.basename $0} setup"
  out.puts "  # ruby #{File.basename $0} install (may require root privilege)"
  out.puts
  out.puts 'Detailed Usage:'
  out.puts "  ruby #{File.basename $0} <global option>"
  out.puts "  ruby #{File.basename $0} [<global options>] <task> [<task options>]"

  fmt = "  %-24s %s\n"
  out.puts
  out.puts 'Global options:'
  out.printf fmt, '-q,--quiet',   'suppress message outputs'
  out.printf fmt, '   --verbose', 'output messages verbosely'
  out.printf fmt, '-h,--help',    'print this message'
  out.printf fmt, '-v,--version', 'print version and quit'
  out.printf fmt, '   --copyright',  'print copyright and quit'
  out.puts
  out.puts 'Tasks:'
  TASKS.each do |name, desc|
    out.printf fmt, name, desc
  end

  fmt = "  %-24s %s [%s]\n"
  out.puts
  out.puts 'Options for CONFIG or ALL:'
  ConfigTable.each do |item|
    out.printf fmt, item.help_opt, item.description, item.help_default
  end
  out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's"
  out.puts
  out.puts 'Options for INSTALL:'
  out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
  out.printf fmt, '--prefix=path',  'install path prefix', '$prefix'
  out.puts
end
relpath()
# File rails/actionwebservice/setup.rb, line 767
def relpath
  '.'
end
run_metaconfigs()
# File rails/actionwebservice/setup.rb, line 733
def run_metaconfigs
  eval_file_ifexist "#{@ardir}/metaconfig"
end
srcdir_root()

Hook Script API bases

# File rails/actionwebservice/setup.rb, line 759
def srcdir_root
  @ardir
end