module System

System

The System module provides Platform and Ruby system information. The module should also be able to stand in for rbconfig. It is intended for use as a service module although it can be mixed-in too.

Public Instance Methods

argf() click to toggle source
Alias for: default_input
argv() click to toggle source
# File lib/more/facets/rbsystem.rb, line 55
def argv; $* ; end
Also aliased as: options
child_status() click to toggle source
# File lib/more/facets/rbsystem.rb, line 66
def child_status; $? ; end
Also aliased as: exit_status
coding() click to toggle source
# File lib/more/facets/rbsystem.rb, line 79
def coding; $-K ; end
coding=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 80
def coding=(x); $-K=x ; end
current_platform() click to toggle source

platform -----------------------------------------------------

# File lib/more/facets/rbsystem.rb, line 188
def current_platform
  arch = Config::CONFIG['arch']
  #cpu, os = arch.split '-', 2
  return match_platform(arch)
end
data() click to toggle source

Miscellaneous ---------------------------------------------

# File lib/more/facets/rbsystem.rb, line 134
def data; DATA ; end
debug() click to toggle source
# File lib/more/facets/rbsystem.rb, line 72
def debug; $DEBUG; end
default_input() click to toggle source
# File lib/more/facets/rbsystem.rb, line 100
def default_input ; $< ; end
Also aliased as: defin, argf
default_output() click to toggle source
# File lib/more/facets/rbsystem.rb, line 104
def default_output ; $> ; end
Also aliased as: defout
default_output=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 105
def default_output=(x); $defout=x ; end
Also aliased as: defout=
defin() click to toggle source
Alias for: default_input
defout() click to toggle source
Alias for: default_output
defout=(x) click to toggle source
Alias for: default_output=
env() click to toggle source
# File lib/more/facets/rbsystem.rb, line 87
def env; ENV ; end
environment() click to toggle source
# File lib/more/facets/rbsystem.rb, line 86
def environment; ENV ; end
error_info() click to toggle source
# File lib/more/facets/rbsystem.rb, line 69
def error_info; $! ; end
error_position() click to toggle source
# File lib/more/facets/rbsystem.rb, line 70
def error_position; $@ ; end
exit_status() click to toggle source
Alias for: child_status
extentions() click to toggle source
# File lib/more/facets/rbsystem.rb, line 160
def extentions
  [ 'rb', DLEXT ]
end
fs() click to toggle source
fs=(x) click to toggle source
input_field_separator() click to toggle source
# File lib/more/facets/rbsystem.rb, line 124
def input_field_separator ; $/ ; end
Also aliased as: fs
input_field_separator=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 125
def input_field_separator=(x) ; $/=x ; end
Also aliased as: fs=
input_line_number() click to toggle source
# File lib/more/facets/rbsystem.rb, line 129
def input_line_number ; $. ; end
Also aliased as: input_lineno
input_lineno() click to toggle source
Alias for: input_line_number
input_record_separator() click to toggle source
# File lib/more/facets/rbsystem.rb, line 119
def input_record_separator ; $/ ; end
Also aliased as: rs
input_record_separator=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 120
def input_record_separator=(x) ; $/=x ; end
Also aliased as: rs=
line_end_processing() click to toggle source
# File lib/more/facets/rbsystem.rb, line 82
def line_end_processing; $-l ; end
load_path() click to toggle source

load path ----------------------------------------------------

# File lib/more/facets/rbsystem.rb, line 181
def load_path; $: ; end
loaded_features() click to toggle source
# File lib/more/facets/rbsystem.rb, line 183
def loaded_features; $" ; end
Also aliased as: required
match_platform(arch) click to toggle source
# File lib/more/facets/rbsystem.rb, line 196
def match_platform(arch)
  cpu, os = arch.split '-', 2
  cpu, os = nil, cpu if os.nil? # java

  cpu = case cpu
        when %ri\d86/ then 'x86'
        else cpu
        end

  os  = case os
        when %rcygwin/ then            [ 'cygwin',  nil ]
        when %rdarwin(\d+)?/ then      [ 'darwin',  $1  ]
        when %rfreebsd(\d+)/ then      [ 'freebsd', $1  ]
        when %r^java$/ then            [ 'java',    nil ]
        when %r^java([\d.]*)/ then     [ 'java',    $1  ]
        when %rlinux/ then             [ 'linux',   $1  ]
        when %rmingw32/ then           [ 'mingw32', nil ]
        when %rmswin32/ then           [ 'mswin32', nil ]
        when %ropenbsd(\d+\.\d+)/ then [ 'openbsd', $1  ]
        when %rsolaris(\d+\.\d+)/ then [ 'solaris', $1  ]
        else                          [ 'unknown', nil ]
        end

  [cpu, os].flatten.compact.join("-")
end
ofs() click to toggle source
ofs=(x) click to toggle source
options() click to toggle source
Alias for: argv
ors() click to toggle source
ors=(x) click to toggle source
output_field_separator() click to toggle source
# File lib/more/facets/rbsystem.rb, line 114
def output_field_separator ; $-F ; end
Also aliased as: ofs
output_field_separator=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 115
def output_field_separator=(x) ; $-F=x ; end
Also aliased as: ofs=
output_record_separator() click to toggle source
# File lib/more/facets/rbsystem.rb, line 109
def output_record_separator ; $\ ; end
Also aliased as: ors
output_record_separator=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 110
def output_record_separator=(x) ; $\=x ; end
Also aliased as: ors=
pid() click to toggle source
Alias for: process_id
platform() click to toggle source
# File lib/more/facets/rbsystem.rb, line 148
def platform
  RUBY_PLATFORM
end
process_id() click to toggle source
these won't work here

def file; __FILE__ ; end def filepath; File.expand_path(__FILE__) ; end def lineno; __LINE__ ; end

# File lib/more/facets/rbsystem.rb, line 63
def process_id; $$ ; end
Also aliased as: pid
program_loop() click to toggle source
# File lib/more/facets/rbsystem.rb, line 84
def program_loop; $-p ; end
program_name() click to toggle source

Execution Environment -------------------------------------

# File lib/more/facets/rbsystem.rb, line 52
def program_name; $0 ; end
program_name=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 53
def program_name=(x); $0=x ; end
release() click to toggle source
# File lib/more/facets/rbsystem.rb, line 156
def release
  RUBY_RELEASE_DATE
end
required() click to toggle source
Alias for: loaded_features
rs() click to toggle source
rs=(x) click to toggle source
rubylibdir() click to toggle source
# File lib/more/facets/rbsystem.rb, line 164
def rubylibdir
  File.join( libdir, 'ruby'  )
end
rubypath() click to toggle source
# File lib/more/facets/rbsystem.rb, line 144
def rubypath
  File.join( bindir, ruby_install_name )
end
safe() click to toggle source
# File lib/more/facets/rbsystem.rb, line 74
def safe; $SAFE; end
stderr() click to toggle source
# File lib/more/facets/rbsystem.rb, line 97
def stderr ; $stderr ; end
stderr=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 98
def stderr=(x); $stderr=x ; end
stdin() click to toggle source

Input/Ouput Variables -------------------------------------

# File lib/more/facets/rbsystem.rb, line 91
def stdin; $stdin ; end
stdin=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 92
def stdin=(x); $stdin=x ; end
stdout() click to toggle source
# File lib/more/facets/rbsystem.rb, line 94
def stdout ; $stdout ; end
stdout=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 95
def stdout=(x); $stdout=x ; end
verbose() click to toggle source
# File lib/more/facets/rbsystem.rb, line 76
def verbose; $VERBOSE; end
verbose=(x) click to toggle source
# File lib/more/facets/rbsystem.rb, line 77
def verbose=(x); $VERBOSE=x; end
version() click to toggle source
# File lib/more/facets/rbsystem.rb, line 152
def version
  RUBY_VERSION
end