⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.13
Server IP:
109.199.105.153
Server:
Linux connect.inboxifs.com 5.15.0-152-generic #162-Ubuntu SMP Wed Jul 23 09:48:42 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
IRB
/
View File Name :
cdesc-IRB.ri
U:RDoc::NormalModule[iI"IRB:ET@0o:RDoc::Markup::Document:@parts[o;;[oo:RDoc::Markup::Paragraph;[I"SIRB stands for "interactive Ruby" and is a tool to interactively execute Ruby ;TI".expressions read from the standard input.;To:RDoc::Markup::BlankLine o; ;[I"BThe +irb+ command from your shell will start the interpreter.;T@S:RDoc::Markup::Heading: leveli: textI" Usage;T@o; ;[I")Use of irb is easy if you know Ruby.;T@o; ;[I"PWhen executing irb, prompts are displayed as follows. Then, enter the Ruby ;TI"Hexpression. An input is executed when it is syntactically complete.;T@o:RDoc::Markup::Verbatim;[I"$ irb ;TI"irb(main):001:0> 1+2 ;TI"#=> 3 ;TI" irb(main):002:0> class Foo ;TI"irb(main):003:1> def foo ;TI"!irb(main):004:2> print 1 ;TI"irb(main):005:2> end ;TI"irb(main):006:1> end ;TI" #=> nil ;T:@format0o; ;[I"SThe singleline editor module or multiline editor module can be used with irb. ;TI":Use of multiline editor is default if it's installed.;T@S;;i; I"Command line options;T@o;;[,I"8Usage: irb.rb [options] [programfile] [arguments] ;TI"3 -f Suppress read of ~/.irbrc ;TI"@ -d Set $DEBUG to true (same as `ruby -d') ;TI"+ -r load-module Same as `ruby -r' ;TI"6 -I path Specify $LOAD_PATH directory ;TI"+ -U Same as `ruby -U` ;TI"+ -E enc Same as `ruby -E` ;TI"+ -w Same as `ruby -w` ;TI"+ -W[level=2] Same as `ruby -W` ;TI"H --context-mode n Set n[0-4] to method to create Binding Object, ;TI"8 when new workspace was created ;TI". --echo Show result(default) ;TI"+ --noecho Don't show result ;TI"2 --inspect Use `inspect' for output ;TI"6 --noinspect Don't use inspect for output ;TI"5 --multiline Use multiline editor module ;TI"; --nomultiline Don't use multiline editor module ;TI"6 --singleline Use singleline editor module ;TI"< --nosingleline Don't use singleline editor module ;TI"* --colorize Use colorization ;TI"0 --nocolorize Don't use colorization ;TI"6 --prompt prompt-mode/--prompt-mode prompt-mode ;TI"J Switch prompt mode. Pre-defined prompt modes are ;TI"C `default', `simple', `xmp' and `inf-ruby' ;TI"L --inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs. ;TI"B Suppresses --multiline and --singleline. ;TI"* --sample-book-mode/--simple-prompt ;TI", Simple prompt mode ;TI"( --noprompt No prompt mode ;TI"2 --single-irb Share self with sub-irb. ;TI"G --tracer Display trace for each execution of commands. ;TI" --back-trace-limit n ;TI"I Display backtrace top n and tail n. The default ;TI"& value is 16. ;TI"& --verbose Show details ;TI", --noverbose Don't show details ;TI"6 -v, --version Print the version of irb ;TI"$ -h, --help Print help ;TI"T -- Separate options of irb from the list of command-line args ;T;0S;;i; I"Configuration;T@o; ;[I"<IRB reads from <code>~/.irbrc</code> when it's invoked.;T@o; ;[I"[If <code>~/.irbrc</code> doesn't exist, +irb+ will try to read in the following order:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0;[o; ;[I" +.irbrc+;To;;0;[o; ;[I" +irb.rc+;To;;0;[o; ;[I" +_irbrc+;To;;0;[o; ;[I"<code>$irbrc</code>;T@o; ;[I"RThe following are alternatives to the command line options. To use them type ;TI"$as follows in an +irb+ session:;T@o;;[I"IRB.conf[:IRB_NAME]="irb" ;TI"!IRB.conf[:INSPECT_MODE]=nil ;TI"IRB.conf[:IRB_RC] = nil ;TI"$IRB.conf[:BACK_TRACE_LIMIT]=16 ;TI"#IRB.conf[:USE_LOADER] = false ;TI"$IRB.conf[:USE_MULTILINE] = nil ;TI"%IRB.conf[:USE_SINGLELINE] = nil ;TI"$IRB.conf[:USE_COLORIZE] = true ;TI"#IRB.conf[:USE_TRACER] = false ;TI"%IRB.conf[:IGNORE_SIGINT] = true ;TI"#IRB.conf[:IGNORE_EOF] = false ;TI"'IRB.conf[:PROMPT_MODE] = :DEFAULT ;TI"IRB.conf[:PROMPT] = {...} ;T;0S;;i; I"Auto indentation;T@o; ;[I"LTo disable auto-indent mode in irb, add the following to your +.irbrc+:;T@o;;[I"$IRB.conf[:AUTO_INDENT] = false ;T;0S;;i; I"Autocompletion;T@o; ;[I"JTo enable autocompletion for irb, add the following to your +.irbrc+:;T@o;;[I"require 'irb/completion' ;T;0S;;i; I"History;T@o; ;[I"CBy default, irb will store the last 1000 commands you used in ;TI"S<code>IRB.conf[:HISTORY_FILE]</code> (<code>~/.irb_history</code> by default).;T@o; ;[I"HIf you want to disable history, add the following to your +.irbrc+:;T@o;;[I"#IRB.conf[:SAVE_HISTORY] = nil ;T;0o; ;[I"9See IRB::Context#save_history= for more information.;T@o; ;[I"NThe history of _results_ of commands evaluated is not stored by default, ;TI"Bbut can be turned on to be stored with this +.irbrc+ setting:;T@o;;[I"(IRB.conf[:EVAL_HISTORY] = <number> ;T;0o; ;[I"NSee IRB::Context#eval_history= and History class. The history of command ;TI"2results is not permanently saved in any file.;T@S;;i; I"Customizing the IRB Prompt;T@o; ;[I"IIn order to customize the prompt, you can change the following Hash:;T@o;;[I"IRB.conf[:PROMPT] ;T;0o; ;[I".This example can be used in your +.irbrc+;T@o;;[I"=IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode ;TI"C :AUTO_INDENT => false, # disables auto-indent mode ;TI"7 :PROMPT_I => ">> ", # simple prompt ;TI"H :PROMPT_S => nil, # prompt for continuated strings ;TI"J :PROMPT_C => nil, # prompt for continuated statement ;TI"@ :RETURN => " ==>%s\n" # format to return value ;TI"} ;TI" ;TI")IRB.conf[:PROMPT_MODE] = :MY_PROMPT ;T;0o; ;[I"2Or, invoke irb with the above prompt mode by:;T@o;;[I"irb --prompt my-prompt ;T;0o; ;[I"PConstants +PROMPT_I+, +PROMPT_S+ and +PROMPT_C+ specify the format. In the ;TI">prompt specification, some special strings are available:;T@o;;[ I"+%N # command name which is running ;TI"(%m # to_s of main object (self) ;TI"+%M # inspect of main object (self) ;TI">%l # type of string(", ', /, ]), `]' is inner %w[...] ;TI"M%NNi # indent level. NN is digits and means as same as printf("%NNd"). ;TI" # It can be omitted ;TI"%NNn # line number. ;TI"%% # % ;T;0o; ;[I"AFor instance, the default prompt mode is defined as follows:;T@o;;[I"*IRB.conf[:PROMPT_MODE][:DEFAULT] = { ;TI"( :PROMPT_I => "%N(%m):%03n:%i> ", ;TI"( :PROMPT_N => "%N(%m):%03n:%i> ", ;TI") :PROMPT_S => "%N(%m):%03n:%i%l ", ;TI"( :PROMPT_C => "%N(%m):%03n:%i* ", ;TI"* :RETURN => "%s\n" # used to printf ;TI"} ;T;0o; ;[I"0irb comes with a number of available modes:;T@o;;[0I"# :NULL: ;TI"# :PROMPT_I: ;TI"# :PROMPT_N: ;TI"# :PROMPT_S: ;TI"# :PROMPT_C: ;TI"# :RETURN: | ;TI"# %s ;TI"# :DEFAULT: ;TI")# :PROMPT_I: ! '%N(%m):%03n:%i> ' ;TI")# :PROMPT_N: ! '%N(%m):%03n:%i> ' ;TI"*# :PROMPT_S: ! '%N(%m):%03n:%i%l ' ;TI")# :PROMPT_C: ! '%N(%m):%03n:%i* ' ;TI"# :RETURN: | ;TI"# => %s ;TI"# :CLASSIC: ;TI")# :PROMPT_I: ! '%N(%m):%03n:%i> ' ;TI")# :PROMPT_N: ! '%N(%m):%03n:%i> ' ;TI"*# :PROMPT_S: ! '%N(%m):%03n:%i%l ' ;TI")# :PROMPT_C: ! '%N(%m):%03n:%i* ' ;TI"# :RETURN: | ;TI"# %s ;TI"# :SIMPLE: ;TI"# :PROMPT_I: ! '>> ' ;TI"# :PROMPT_N: ! '>> ' ;TI"# :PROMPT_S: ;TI"# :PROMPT_C: ! '?> ' ;TI"# :RETURN: | ;TI"# => %s ;TI"# :INF_RUBY: ;TI")# :PROMPT_I: ! '%N(%m):%03n:%i> ' ;TI"# :PROMPT_N: ;TI"# :PROMPT_S: ;TI"# :PROMPT_C: ;TI"# :RETURN: | ;TI"# %s ;TI"# :AUTO_INDENT: true ;TI" # :XMP: ;TI"# :PROMPT_I: ;TI"# :PROMPT_N: ;TI"# :PROMPT_S: ;TI"# :PROMPT_C: ;TI"# :RETURN: |2 ;TI"# ==>%s ;T;0S;;i; I"Restrictions;T@o; ;[I"QBecause irb evaluates input immediately after it is syntactically complete, ;TI"Dthe results may be slightly different than directly using Ruby.;T@S;;i; I"IRB Sessions;T@o; ;[I"PIRB has a special feature, that allows you to manage many sessions at once.;T@o; ;[I"RYou can create new sessions with Irb.irb, and get a list of current sessions ;TI"+with the +jobs+ command in the prompt.;T@S;;i; I" Commands;T@o; ;[I"AJobManager provides commands to handle the current sessions:;T@o;;[I"(jobs # List of current sessions ;TI";fg # Switches to the session of the given number ;TI"7kill # Kills the session with the given number ;T;0o; ;[I"SThe +exit+ command, or ::irb_exit, will quit the current session and call any ;TI"%exit hooks with IRB.irb_at_exit.;T@o; ;[I"LA few commands for loading files within the session are also available:;T@o;;: NOTE;[o;;[I" +source+;T;[o; ;[I"NLoads a given file in the current session and displays the source lines, ;TI"see IrbLoader#source_file;To;;[I"+irb_load+;T;[o; ;[I"JLoads the given file similarly to Kernel#load, see IrbLoader#irb_load;To;;[I"+irb_require+;T;[o; ;[I"5Loads the given file similarly to Kernel#require;T@S;;i; I"Configuration;T@o; ;[I"LThe command line options, or IRB.conf, specify the default behavior of ;TI" Irb.irb.;T@o; ;[I"IOn the other hand, each conf in IRB@Command+line+options is used to ;TI"$individually configure IRB.irb.;T@o; ;[I"^If a proc is set for <code>IRB.conf[:IRB_RC]</code>, its will be invoked after execution ;TI"Pof that proc with the context of the current session as its argument. Each ;TI"4session can be configured using this mechanism.;T@S;;i; I"Session variables;T@o; ;[I"KThere are a few variables in every Irb session that can come in handy:;T@o;;;;[o;;[I"<code>_</code>;T;[o; ;[I"4The value command executed, as a local variable;To;;[I"<code>__</code>;T;[o; ;[I":The history of evaluated commands. Available only if ;TI"O<code>IRB.conf[:EVAL_HISTORY]</code> is not +nil+ (which is the default). ;TI":See also IRB::Context#eval_history= and IRB::History.;To;;[I"<code>__[line_no]</code>;T;[o; ;[I"GReturns the evaluation value at the given line number, +line_no+. ;TI"NIf +line_no+ is a negative, the return value +line_no+ many lines before ;TI""the most recent return value.;T@S;;i; I"Example using IRB Sessions;T@o;;[?I"# invoke a new session ;TI"irb(main):001:0> irb ;TI"# list open sessions ;TI"irb.1(main):001:0> jobs ;TI"5 #0->irb on main (#<Thread:0x400fb7e4> : stop) ;TI": #1->irb#1 on main (#<Thread:0x40125d64> : running) ;TI" ;TI"!# change the active session ;TI"irb.1(main):002:0> fg 0 ;TI"-# define class Foo in top-level session ;TI"$irb(main):002:0> class Foo;end ;TI"4# invoke a new session with the context of Foo ;TI"irb(main):003:0> irb Foo ;TI"# define Foo#foo ;TI"irb.2(Foo):001:0> def foo ;TI"!irb.2(Foo):002:1> print 1 ;TI"irb.2(Foo):003:1> end ;TI" ;TI"!# change the active session ;TI"irb.2(Foo):004:0> fg 0 ;TI"# list open sessions ;TI"irb(main):004:0> jobs ;TI"8 #0->irb on main (#<Thread:0x400fb7e4> : running) ;TI"7 #1->irb#1 on main (#<Thread:0x40125d64> : stop) ;TI"6 #2->irb#2 on Foo (#<Thread:0x4011d54c> : stop) ;TI"%# check if Foo#foo is available ;TI";irb(main):005:0> Foo.instance_methods #=> [:foo, ...] ;TI" ;TI"!# change the active session ;TI"irb(main):006:0> fg 2 ;TI",# define Foo#bar in the context of Foo ;TI"irb.2(Foo):005:0> def bar ;TI"$irb.2(Foo):006:1> print "bar" ;TI"irb.2(Foo):007:1> end ;TI"Cirb.2(Foo):010:0> Foo.instance_methods #=> [:bar, :foo, ...] ;TI" ;TI"!# change the active session ;TI"irb.2(Foo):011:0> fg 0 ;TI"9irb(main):007:0> f = Foo.new #=> #<Foo:0x4010af3c> ;TI"D# invoke a new session with the context of f (instance of Foo) ;TI"irb(main):008:0> irb f ;TI"# list open sessions ;TI")irb.3(<Foo:0x4010af3c>):001:0> jobs ;TI"5 #0->irb on main (#<Thread:0x400fb7e4> : stop) ;TI"7 #1->irb#1 on main (#<Thread:0x40125d64> : stop) ;TI"6 #2->irb#2 on Foo (#<Thread:0x4011d54c> : stop) ;TI"G #3->irb#3 on #<Foo:0x4010af3c> (#<Thread:0x4010a1e0> : running) ;TI"# evaluate f.foo ;TI"5irb.3(<Foo:0x4010af3c>):002:0> foo #=> 1 => nil ;TI"# evaluate f.bar ;TI"7irb.3(<Foo:0x4010af3c>):003:0> bar #=> bar => nil ;TI"# kill jobs 1, 2, and 3 ;TI"1irb.3(<Foo:0x4010af3c>):004:0> kill 1, 2, 3 ;TI"<# list open sessions, should only include main session ;TI"irb(main):009:0> jobs ;TI"8 #0->irb on main (#<Thread:0x400fb7e4> : running) ;TI"# quit irb ;TI"irb(main):010:0> exit;T;0: @fileI"lib/irb.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ;I"lib/irb/color_printer.rb;T;0o;;[ ;I"lib/irb/completion.rb;T;0o;;[ ;I"lib/irb/context.rb;T;0o;;[ ;I"lib/irb/easter-egg.rb;T;0o;;[ ;I"lib/irb/ext/multi-irb.rb;T;0o;;[o;;[ I"save-history.rb - ;TI"" $Release Version: 0.9.6$ ;TI" $Revision$ ;TI"1 by Keiju ISHITSUKA(keiju@ruby-lang.org) ;T;0o; ;[I"--;T;I" lib/irb/ext/save-history.rb;T;0o;;[ ;I"lib/irb/ext/tracer.rb;T;0o;;[ ;@�;0o;;[ ;I"lib/irb/ext/use-loader.rb;T;0o;;[o;;[ I"frame.rb - ;TI" $Release Version: 0.9$ ;TI" $Revision$ ;TI"= by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) ;T;0o; ;[I"--;T;I"lib/irb/frame.rb;T;0o;;[ ;I"lib/irb/help.rb;T;0o;;[ ;I"lib/irb/input-method.rb;T;0o;;[ ;I"lib/irb/magic-file.rb;T;0o;;[ ;I"lib/irb/notifier.rb;T;0o;;[o;;[ I"3output-method.rb - output methods used by irb ;TI"" $Release Version: 0.9.6$ ;TI" $Revision$ ;TI"1 by Keiju ISHITSUKA(keiju@ruby-lang.org) ;T;0o; ;[I"--;T;I"lib/irb/output-method.rb;T;0o;;[o; ;[I")DO NOT WRITE ANY MAGIC COMMENT HERE.;T;I"lib/irb/src_encoding.rb;T;0;0;0[ [U:RDoc::Constant[i I"TracerLoadError;TI"IRB::TracerLoadError;T:public0o;;[ ;@�;0@�@cRDoc::NormalModule0[ [[I" class;T[[;[[I"CurrentContext;TI"lib/irb.rb;T[I"JobManager;TI"lib/irb/ext/multi-irb.rb;T[I" conf;T@[I"default_src_encoding;TI"lib/irb/src_encoding.rb;T[I"initialize_tracer;TI"lib/irb/ext/tracer.rb;T[I"irb;T@[I"irb_abort;T@[I"irb_at_exit;T@[I" irb_exit;T@[I"print_usage;TI"lib/irb/help.rb;T[I" start;T@[I"version;T@[:protected[ [:private[[I"easter_egg;TI"lib/irb/easter-egg.rb;T[I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[1@�I"lib/irb/cmd/chws.rb;TI"lib/irb/cmd/fork.rb;TI"lib/irb/cmd/help.rb;TI"lib/irb/cmd/info.rb;TI"lib/irb/cmd/load.rb;TI"lib/irb/cmd/ls.rb;TI"lib/irb/cmd/measure.rb;TI"lib/irb/cmd/nop.rb;TI"lib/irb/cmd/pushws.rb;TI"lib/irb/cmd/show_source.rb;TI"lib/irb/cmd/subirb.rb;TI"lib/irb/cmd/whereami.rb;TI"lib/irb/color.rb;T@�@�@�@�I"lib/irb/ext/change-ws.rb;TI"lib/irb/ext/history.rb;TI"lib/irb/ext/loader.rb;T@�@�@�@�I"lib/irb/ext/workspaces.rb;TI"lib/irb/extend-command.rb;T@�@�I"lib/irb/init.rb;T@�I"lib/irb/inspector.rb;TI"lib/irb/lc/error.rb;TI"&lib/irb/lc/ja/encoding_aliases.rb;TI"lib/irb/lc/ja/error.rb;TI"lib/irb/locale.rb;T@�@�@�@I"lib/irb/version.rb;TI"lib/irb/workspace.rb;TI"lib/irb/ws-for-case-2.rb;TI"lib/irb/xmp.rb;T@ccRDoc::TopLevel