Top Level Namespace
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
|
Classes:
ARGF,
Array,
BasicObject,
Binding,
Class,
Complex,
ConditionVariable,
Continuation,
Data,
Dir,
ENV,
Encoding,
Enumerator,
FalseClass,
Fiber,
File,
Float,
Hash,
IO,
Integer,
MatchData,
Method,
Module,
Mutex,
NilClass,
Numeric,
Object,
Pool,
Proc,
Queue,
Random,
Range,
Rational,
Regexp,
RubyVM,
SizedQueue,
String,
Struct,
Symbol,
Thread,
ThreadGroup,
Time,
TracePoint,
TrueClass,
UnboundMethod | |
|
Exceptions:
ArgumentError,
ClosedQueueError,
EOFError,
EncodingError,
Exception,
FiberError,
FloatDomainError,
FrozenError,
IOError,
IndexError,
Interrupt,
KeyError,
LoadError,
LocalJumpError,
NameError,
NoMatchingPatternError,
NoMemoryError,
NoMethodError,
NotImplementedError,
RangeError,
RegexpError,
RuntimeError,
ScriptError,
SecurityError,
SignalException,
StandardError,
StopIteration,
SyntaxError,
SystemCallError,
SystemExit,
SystemStackError,
ThreadError,
TypeError,
UncaughtThrowError,
ZeroDivisionError,
fatal |
Constant Summary
-
ARGV =
# File 'ruby.c', line 2387
ARGVcontains the command line arguments used to run ruby.A library like OptionParser can be used to process command-line arguments.
rb_argv -
DATA =
# File 'ruby.c', line 2096
$ cat t.rb
puts DATA.gets __END__DATA is a File that contains the data section of the executed file. To create a data section use <tt>__END__</tt>
-
FALSE =
# File 'object.c', line 4738
An obsolete alias of
falseQfalse -
NIL =
# File 'object.c', line 4632
An obsolete alias of
nilQnil -
RUBY_COPYRIGHT =
# File 'version.c', line 79
The copyright string for ruby
MKSTR(copyright)
-
RUBY_DESCRIPTION =
# File 'version.c', line 114
MKSTR(description)
/* MKSTR(description) */ description
-
RUBY_ENGINE =
# File 'version.c', line 83
The engine or interpreter this ruby uses.
ruby_engine_name = MKSTR(engine)
-
RUBY_ENGINE_VERSION =
# File 'version.c', line 88
The version of the engine or interpreter this ruby uses.
(1 ? version : MKSTR(version))
-
RUBY_PATCHLEVEL =
# File 'version.c', line 71
The patchlevel for this ruby. If this is a development build of ruby the patchlevel will be -1
MKINT(patchlevel)
-
RUBY_PLATFORM =
# File 'version.c', line 66
The platform for this ruby
MKSTR(platform)
-
RUBY_RELEASE_DATE =
# File 'version.c', line 62
The date this ruby was released
MKSTR(release_date)
-
RUBY_REVISION =
# File 'version.c', line 75
The GIT commit hash for this ruby.
MKSTR(revision)
-
RUBY_VERSION =
# File 'version.c', line 58
The running version of ruby
(version = MKSTR(version))
-
STDERR =
# File 'io.c', line 13390
Holds the original stderr
rb_stderr -
STDIN =
# File 'io.c', line 13386
Holds the original stdin
rb_stdin -
STDOUT =
# File 'io.c', line 13388
Holds the original stdout
rb_stdout -
TOPLEVEL_BINDING =
# File 'vm.c', line 3276
The Binding of the top level scope
rb_binding_new() -
TRUE =
# File 'object.c', line 4721
An obsolete alias of
trueQtrue
Class Attribute Summary
- $!(*_) readonly
- $$(*_y) readonly
- $&(*_y) readonly
- $'(*_y) readonly
- $*(*var) readonly
- $+(*_y) readonly
- $, rw
-
$-0
rw
Alias for $/.
-
$-d
readonly
Alias for $DEBUG.
-
$-F
rw
Alias for $;.
- $-i(*var) rw
-
$-K(*_y)
rw
Alias for $KCODE.
-
$-v
rw
Alias for $VERBOSE.
-
$-w
rw
Alias for $VERBOSE.
- $-W(*variable) readonly
- $.(*var) rw
- $/ (also: .$-0) rw
- $0 (also: .$PROGRAM_NAME) rw
- $; (also: .$-F) rw
- $< readonly
- $=(*_y) rw
-
$>
rw
Alias for $stdout.
- $@(*_) rw
- $\(*_y) (also: .$LOADED_FEATURES) readonly
- $\\ rw
- $_(*_y) rw
- $`(*_y) readonly
- $DEBUG (also: .$-d) readonly
- $FILENAME(*var) readonly
- $find_time_numguess readonly
- $KCODE(*_y) (also: .$-K) rw
-
$LOADED_FEATURES(*_y)
readonly
Alias for $.
-
$PROGRAM_NAME
rw
Alias for $0.
- $SAFE(*_y) rw
- $stderr rw
- $stdin readonly
- $stdout (also: .$>) rw
-
$VERBOSE
(also: .$-v, .$-w)
rw
! Defines built-in variables.
-
$VERBOSE=
(also: .$-v=, .$-w=)
rw
! Defines built-in variables.
- $~(*_y) rw
Class Method Summary
Class Attribute Details
$!(*_) (readonly)
[ GitHub ]# File 'eval.c', line 1869
static VALUE
errinfo_getter(ID id, VALUE *_)
{
return get_errinfo();
}
$$(*_y) (readonly)
[ GitHub ]# File 'process.c', line 8345
static VALUE
get_PROCESS_ID(ID _x, VALUE *_y)
{
return get_pid();
}
$&(*_y) (readonly)
[ GitHub ]# File 're.c', line 1816
static VALUE
last_match_getter(ID _x, VALUE *_y)
{
return rb_reg_last_match(rb_backref_get());
}
$'(*_y) (readonly)
[ GitHub ]# File 're.c', line 1828
static VALUE
postmatch_getter(ID _x, VALUE *_y)
{
return rb_reg_match_post(rb_backref_get());
}
$*(*var) (readonly)
[ GitHub ]# File 'io.c', line 12897
static VALUE
argf_argv_getter(ID id, VALUE *var)
{
return argf_argv(*var);
}
$+(*_y) (readonly)
[ GitHub ]# File 're.c', line 1834
static VALUE
last_paren_match_getter(ID _x, VALUE *_y)
{
return rb_reg_match_last(rb_backref_get());
}
$, (rw)
[ GitHub ]# File 'io.c', line 13262
rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_output_fs_setter);
$-0 (rw)
Alias for $/.
# File 'io.c', line 13269
rb_define_hooked_variable("$-0", &rb_rs, 0, rb_str_setter);
$-d (readonly)
Alias for $DEBUG.
# File 'ruby.c', line 2373
rb_define_variable("$-d", &ruby_debug);
$-F (rw)
Alias for $;.
# File 'string.c', line 11366
rb_define_hooked_variable("$-F", &rb_fs, 0, rb_fs_setter);
$-i(*var) (rw)
[ GitHub ]# File 'io.c', line 12824
static VALUE
opt_i_get(ID id, VALUE *var)
{
return argf_inplace_mode_get(*var);
}
$-K(*_y) (rw)
Alias for $KCODE.
$-v (rw)
Alias for $VERBOSE.
# File 'ruby.c', line 2369
rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter);
$-W(*variable) (readonly)
[ GitHub ]# File 'ruby.c', line 2349
static VALUE
opt_W_getter(ID id, VALUE *variable)
{
switch (*variable) {
case Qnil:
return INT2FIX(0);
case Qfalse:
return INT2FIX(1);
case Qtrue:
return INT2FIX(2);
default:
return Qnil;
}
}
$-w (rw)
Alias for $VERBOSE.
# File 'ruby.c', line 2370
rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter);
$.(*var) (rw)
[ GitHub ]# File 'io.c', line 8817
static VALUE
argf_lineno_getter(ID id, VALUE *var)
{
VALUE argf = *var;
return INT2FIX(ARGF.last_lineno);
}
$/ (rw) Also known as: ::$-0
[ GitHub ]# File 'io.c', line 13268
rb_define_hooked_variable("$/", &rb_rs, 0, rb_str_setter);
$0 (rw) Also known as: ::$PROGRAM_NAME
[ GitHub ]# File 'ruby.c', line 2375
rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
$; (rw) Also known as: ::$-F
[ GitHub ]# File 'string.c', line 11365
rb_define_hooked_variable("$;", &rb_fs, 0, rb_fs_setter);
$< (readonly)
[ GitHub ]# File 'io.c', line 13469
rb_define_readonly_variable("$<", &argf);
$=(*_y) (rw)
[ GitHub ]# File 're.c', line 3911
static VALUE
ignorecase_getter(ID _x, VALUE *_y)
{
rb_warn("variable $= is no longer effective");
return Qfalse;
}
$> (rw)
Alias for $stdout.
# File 'io.c', line 13381
rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
$@(*_) (rw)
[ GitHub ]# File 'eval.c', line 1904
static VALUE
errat_getter(ID id, VALUE *_)
{
VALUE err = get_errinfo();
if (!NIL_P(err)) {
return rb_get_backtrace(err);
}
else {
return Qnil;
}
}
$\(*_y) (readonly) Also known as: ::$LOADED_FEATURES
[ GitHub ]# File 'load.c', line 155
static VALUE
get_LOADED_FEATURES(ID _x, VALUE *_y)
{
return get_loaded_features();
}
$\\ (rw)
[ GitHub ]# File 'io.c', line 13270
rb_define_hooked_variable("$\\", &rb_output_rs, 0, rb_str_setter);
$_(*_y) (rw)
[ GitHub ]# File 'io.c', line 12987
static VALUE
get_LAST_READ_LINE(ID _x, VALUE *_y)
{
return rb_lastline_get();
}
$`(*_y) (readonly)
[ GitHub ]# File 're.c', line 1822
static VALUE
prematch_getter(ID _x, VALUE *_y)
{
return rb_reg_match_pre(rb_backref_get());
}
$DEBUG (readonly) Also known as: ::$-d
[ GitHub ]# File 'ruby.c', line 2372
rb_define_variable("$DEBUG", &ruby_debug);
$FILENAME(*var) (readonly)
[ GitHub ]# File 'io.c', line 12657
static VALUE
argf_filename_getter(ID id, VALUE *var)
{
return argf_filename(*var);
}
$find_time_numguess (readonly)
[ GitHub ]# File 'time.c', line 3135
static VALUE find_time_numguess_getter(void)
{
return ULL2NUM(find_time_numguess);
}
$KCODE(*_y) (rw) Also known as: ::$-K
[ GitHub ]# File 're.c', line 3898
static VALUE
kcode_getter(ID _x, VALUE *_y)
{
rb_warn("variable $KCODE is no longer effective");
return Qnil;
}
$LOADED_FEATURES(*_y) (readonly)
Alias for $.
$PROGRAM_NAME (rw)
Alias for $0.
# File 'ruby.c', line 2376
rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
$SAFE(*_y) (rw)
[ GitHub ]# File 'safe.c', line 67
static VALUE
safe_getter(ID _x, VALUE *_y)
{
rb_warn("$SAFE will become a normal global variable in Ruby 3.0");
return INT2NUM(GET_VM()->safe_level_);
}
$stderr (rw)
[ GitHub ]# File 'io.c', line 13379
rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter);
$stdin (readonly)
[ GitHub ]# File 'io.c', line 13375
rb_define_variable("$stdin", &rb_stdin);
$stdout (rw) Also known as: ::$>
[ GitHub ]# File 'io.c', line 13377
rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
$VERBOSE (rw) Also known as: ::$-v, ::$-w
! Defines built-in variables
# File 'ruby.c', line 2368
rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter);
$VERBOSE= (rw) Also known as: ::$-v=, ::$-w=
! Defines built-in variables
# File 'ruby.c', line 2343
static void
verbose_setter(VALUE val, ID id, VALUE *variable)
{
*variable = RTEST(val) ? Qtrue : val;
}
$~(*_y) (rw)
[ GitHub ]# File 're.c', line 3934
static VALUE
get_LAST_MATCH_INFO(ID _x, VALUE *_y)
{
return match_getter();
}
Class Method Details
$?(*_y) ⇒ Boolean
# File 'process.c', line 8339
static VALUE
get_CHILD_STATUS(ID _x, VALUE *_y)
{
return rb_last_status_get();
}