module Refuge
Namespace
Constants
- COMMON_OPTIONS
- DEFAULT_COMMAND
- DEFAULT_SETTINGS
- EXIT_CODES
Standard exit code mappings.
- LIBBASE
- LIBBASE_COMMANDS
- LIBBASE_NATIVE
- LIBBASE_UTILS
Public Instance Methods
load_libs( base, names )
click to toggle source
Loads a set of library scripts under a common base path.
# File lib/refuge.rb, line 56 def load_libs ( base, names ) names.each do | elem | require base + elem end end
option_parser()
click to toggle source
# File lib/refuge/options.rb, line 44 def option_parser @@option_parser ||= OptionParser.new do | op | op.banner = "Usage: #{ $0 } [common-options] command [options]" op.separator '' op.separator 'Common Options:' op.on( '-?', '--help', 'Show quick usage information.' ) do | x | @@options.help = x end COMMON_OPTIONS.sort.each do | tag, desc | op.on( "-#{ tag.to_s[ 0, 1 ] }", "--[no-]#{ tag }", desc ) do | x | #@@options.__send__( "#{ tag }=", x ) @@options[ tag ] = x end end end end
options()
click to toggle source
# File lib/refuge/options.rb, line 42 def options; @@options; end
update_options( table )
click to toggle source
# File lib/refuge/options.rb, line 64 def update_options ( table ) table.each_pair do | key, value | #@@options.__send__( "#{ key }=", value ) @@options[ key ] = value end end