ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- limit-c.ri000064400000006407152352347730006460 0ustar00U:RDoc::AnyMethod[iI" limit:ETI"Thread::Backtrace::limit;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I"HReturns maximum backtrace length set by --backtrace-limit ;TI"Jcommand-line option. The defalt is -1 which means unlimited ;TI"Ibacktraces. If the value is zero or positive, the error backtraces, ;TI"Mproduced by Exception#full_message, are abbreviated and the extra lines ;TI".are replaced by ... 3 levels... ;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [,I"c$ ruby -r net/http -e "p Thread::Backtrace.limit; Net::HTTP.get(URI('http://wrong.address'))" ;TI" - 1 ;TI"œ.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': Failed to open TCP connection to wrong.address:80 (getaddrinfo: Name or service not known) (SocketError) ;TI"< from .../lib/ruby/3.1.0/socket.rb:227:in `foreach' ;TI"8 from .../lib/ruby/3.1.0/socket.rb:632:in `tcp' ;TI"> from .../lib/ruby/3.1.0/net/http.rb:998:in `connect' ;TI"? from .../lib/ruby/3.1.0/net/http.rb:976:in `do_start' ;TI"< from .../lib/ruby/3.1.0/net/http.rb:965:in `start' ;TI"< from .../lib/ruby/3.1.0/net/http.rb:627:in `start' ;TI"C from .../lib/ruby/3.1.0/net/http.rb:503:in `get_response' ;TI": from .../lib/ruby/3.1.0/net/http.rb:474:in `get' ;TI"m.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError) ;TI"< from .../lib/ruby/3.1.0/socket.rb:227:in `foreach' ;TI"8 from .../lib/ruby/3.1.0/socket.rb:632:in `tcp' ;TI"> from .../lib/ruby/3.1.0/net/http.rb:998:in `connect' ;TI"? from .../lib/ruby/3.1.0/net/http.rb:976:in `do_start' ;TI"< from .../lib/ruby/3.1.0/net/http.rb:965:in `start' ;TI"< from .../lib/ruby/3.1.0/net/http.rb:627:in `start' ;TI"C from .../lib/ruby/3.1.0/net/http.rb:503:in `get_response' ;TI": from .../lib/ruby/3.1.0/net/http.rb:474:in `get' ;TI" from -e:1:in `
' ;TI" ;TI"w$ ruby --backtrace-limit 2 -r net/http -e "p Thread::Backtrace.limit; Net::HTTP.get(URI('http://wrong.address'))" ;TI"2 ;TI"œ.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': Failed to open TCP connection to wrong.address:80 (getaddrinfo: Name or service not known) (SocketError) ;TI"< from .../lib/ruby/3.1.0/socket.rb:227:in `foreach' ;TI"8 from .../lib/ruby/3.1.0/socket.rb:632:in `tcp' ;TI" ... 7 levels... ;TI"m.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError) ;TI"< from .../lib/ruby/3.1.0/socket.rb:227:in `foreach' ;TI"8 from .../lib/ruby/3.1.0/socket.rb:632:in `tcp' ;TI" ... 7 levels... ;TI" ;TI"w$ ruby --backtrace-limit 0 -r net/http -e "p Thread::Backtrace.limit; Net::HTTP.get(URI('http://wrong.address'))" ;TI"0 ;TI"œ.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': Failed to open TCP connection to wrong.address:80 (getaddrinfo: Name or service not known) (SocketError) ;TI" ... 9 levels... ;TI"m.../lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError) ;TI" ... 9 levels...;T: @format0: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below0I"*Threade::Backtrace::limit -> integer ;T0[I"();T@ruby caller_locations.rb will produce:;T@o; ;[I""caller_locations.rb:2:in `a' ;TI""caller_locations.rb:5:in `b' ;TI""caller_locations.rb:8:in `c' ;T; 0o; ;[I"=Here's another example with a slightly different result:;T@o; ;[I"# foo.rb ;TI"class Foo ;TI" attr_accessor :locations ;TI" def initialize(skip) ;TI"- @locations = caller_locations(skip) ;TI" end ;TI" end ;TI" ;TI"+Foo.new(0..2).locations.map do |call| ;TI" puts call.to_s ;TI" end ;T; 0o; ;[I"9Now run ruby foo.rb and you should see:;T@o; ;[I"init.rb:4:in `initialize' ;TI"init.rb:8:in `new' ;TI"init.rb:8:in `
';T; 0: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[[[[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[;[[;[[;[ [I"absolute_path;TI"vm_backtrace.c;T[I"base_label;T@_[I" inspect;T@_[I" label;T@_[I" lineno;T@_[I" path;T@_[I" to_s;T@_[[U:RDoc::Context::Section[i0o;;[; 0;0[I" vm.c;TI"Thread::Backtrace;TcRDoc::NormalClassLocation/label-i.ri000064400000001642152352347730010173 0ustar00U:RDoc::AnyMethod[iI" label:ETI"&Thread::Backtrace::Location#label;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"%Returns the label of this frame.;To:RDoc::Markup::BlankLineo; ; [I"JUsually consists of method, class, module, etc names with decoration.;T@o; ; [I"$Consider the following example:;T@o:RDoc::Markup::Verbatim; [I" def foo ;TI", puts caller_locations(0).first.label ;TI" ;TI" 1.times do ;TI". puts caller_locations(0).first.label ;TI" ;TI" 1.times do ;TI"0 puts caller_locations(0).first.label ;TI" end ;TI" ;TI" end ;TI" end ;T: @format0o; ; [I")The result of calling +foo+ is this:;T@o; ; [I"label: foo ;TI"label: block in foo ;TI"#label: block (2 levels) in foo;T; 0: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@+FI" Location;TcRDoc::NormalClass00Location/base_label-i.ri000064400000000643152352347730011165 0ustar00U:RDoc::AnyMethod[iI"base_label:ETI"+Thread::Backtrace::Location#base_label;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"*Returns the base label of this frame.;To:RDoc::Markup::BlankLineo; ; [I"0Usually same as #label, without decoration.;T: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Location;TcRDoc::NormalClass00Location/to_s-i.ri000064400000000532152352347730010055 0ustar00U:RDoc::AnyMethod[iI" to_s:ETI"%Thread::Backtrace::Location#to_s;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"BReturns a Kernel#caller style string representing this frame.;T: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Location;TcRDoc::NormalClass00Location/path-i.ri000064400000001310152352347730010040 0ustar00U:RDoc::AnyMethod[iI" path:ETI"%Thread::Backtrace::Location#path;TF: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"MReturns the file name of this frame. This will generally be an absolute ;TI"Ppath, unless the frame is in the main script, in which case it will be the ;TI"0script location passed on the command line.;To:RDoc::Markup::BlankLineo; ; [I"NFor example, using +caller_locations.rb+ from Thread::Backtrace::Location;T@o:RDoc::Markup::Verbatim; [I"loc = c(0..1).first ;TI"%loc.path #=> caller_locations.rb;T: @format0: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Location;TcRDoc::NormalClass00Location/lineno-i.ri000064400000001026152352347730010374 0ustar00U:RDoc::AnyMethod[iI" lineno:ETI"'Thread::Backtrace::Location#lineno;TF: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"+Returns the line number of this frame.;To:RDoc::Markup::BlankLineo; ; [I"NFor example, using +caller_locations.rb+ from Thread::Backtrace::Location;T@o:RDoc::Markup::Verbatim; [I"loc = c(0..1).first ;TI"loc.lineno #=> 2;T: @format0: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Location;TcRDoc::NormalClass00Location/absolute_path-i.ri000064400000000751152352347730011746 0ustar00U:RDoc::AnyMethod[iI"absolute_path:ETI".Thread::Backtrace::Location#absolute_path;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I".Returns the full file path of this frame.;To:RDoc::Markup::BlankLineo; ; [I"=Same as #path, except that it will return absolute path ;TI"-even if the frame is in the main script.;T: @fileI"vm_backtrace.c;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Location;TcRDoc::NormalClass00