ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- state-c.ri000064400000000572152351342420006445 0ustar00U:RDoc::AnyMethod[iI" state:ETI"Coverage::state;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"3Returns the state of the coverage measurement.;T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I"4Coverage.state => :idle, :suspended, :running ;T0[I"();T@FI" Coverage;TcRDoc::NormalModule00setup-c.ri000064400000001511152351342420006457 0ustar00U:RDoc::AnyMethod[iI" setup:ETI"Coverage::setup;TT: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"%Set up the coverage measurement.;To:RDoc::Markup::BlankLineo; ; [I"BNote that this method does not start the measurement itself. ;TI"2Use Coverage.resume to start the measurement.;T@o; ; [I"PYou may want to use Coverage.start to setup and then start the measurement.;T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I" Coverage.setup => nil Coverage.setup(:all) => nil Coverage.setup(lines: bool, branches: bool, methods: bool) => nil Coverage.setup(oneshot_lines: true) => nil ;T0[I"(p1 = v1);T@FI" Coverage;TcRDoc::NormalModule00suspend-c.ri000064400000000632152351342420007003 0ustar00U:RDoc::AnyMethod[iI" suspend:ETI"Coverage::suspend;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Suspend the coverage measurement. ;TI" nil ;T0[I"();T@FI" Coverage;TcRDoc::NormalModule00start-c.ri000064400000001314152351342420006455 0ustar00U:RDoc::AnyMethod[iI" start:ETI"Coverage::start;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"'Enables the coverage measurement. ;TI"8See the documentation of Coverage class in detail. ;TI">This is equivalent to Coverage.setup and Coverage.resume.;T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I" Coverage.start => nil Coverage.start(:all) => nil Coverage.start(lines: bool, branches: bool, methods: bool) => nil Coverage.start(oneshot_lines: true) => nil ;T0[I" (*args);T@FI" Coverage;TcRDoc::NormalModule00resume-c.ri000064400000001260152351342420006620 0ustar00U:RDoc::AnyMethod[iI" resume:ETI"Coverage::resume;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"+Start/resume the coverage measurement.;To:RDoc::Markup::BlankLineo; ; [ I"OCaveat: Currently, only process-global coverage measurement is supported. ;TI"RYou cannot measure per-thread covearge. If your process has multiple thread, ;TI"Ousing Coverage.resume/suspend to capture code coverage executed from only ;TI"8a limited code block, may yield misleading results.;T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I"Coverage.resume => nil ;T0[I"();T@FI" Coverage;TcRDoc::NormalModule00cdesc-Coverage.ri000064400000015113152351342420007714 0ustar00U:RDoc::NormalModule[iI" Coverage:ET@0o:RDoc::Markup::Document: @parts[o;;[8o:RDoc::Markup::Paragraph;[I">Coverage provides coverage measurement feature for Ruby. ;TI"JThis feature is experimental, so these APIs may be changed in future.;To:RDoc::Markup::BlankLineo; ;[I"OCaveat: Currently, only process-global coverage measurement is supported. ;TI",You cannot measure per-thread covearge.;T@S:RDoc::Markup::Heading: leveli: textI" Usage;T@o:RDoc::Markup::List: @type: NUMBER: @items[ o:RDoc::Markup::ListItem: @label0;[o; ;[I"require "coverage";To;;0;[o; ;[I"do Coverage.start;To;;0;[o; ;[I"%require or load Ruby source file;To;;0;[o; ;[ I"JCoverage.result will return a hash that contains filename as key and ;TI"Icoverage array as value. A coverage array gives, for each line, the ;TI"Fnumber of line execution by the interpreter. A +nil+ value means ;TI"Fcoverage is disabled for this line (lines like +else+ and +end+).;T@S; ; i; I" Examples;T@o:RDoc::Markup::Verbatim;[I"[foo.rb] ;TI" s = 0 ;TI"10.times do |x| ;TI" s += x ;TI" end ;TI" ;TI"if s == 45 ;TI" p :ok ;TI" else ;TI" p :ng ;TI" end ;TI" [EOF] ;TI" ;TI"require "coverage" ;TI"Coverage.start ;TI"require "foo.rb" ;TI"Pp Coverage.result #=> {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]} ;T: @format0S; ; i; I"Lines Coverage;T@o; ;[I"RIf a coverage mode is not explicitly specified when starting coverage, lines ;TI"Rcoverage is what will run. It reports the number of line executions for each ;TI" line.;T@o;;[ I"require "coverage" ;TI"!Coverage.start(lines: true) ;TI"require "foo.rb" ;TI"Yp Coverage.result #=> {"foo.rb"=>{:lines=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}} ;T;0o; ;[ I"RThe value of the lines coverage result is an array containing how many times ;TI"Peach line was executed. Order in this array is important. For example, the ;TI"Qfirst item in this array, at index 0, reports how many times line 1 of this ;TI"Nfile was executed while coverage was run (which, in this example, is one ;TI" time).;T@o; ;[I"OA +nil+ value means coverage is disabled for this line (lines like +else+ ;TI"and +end+).;T@S; ; i; I"Oneshot Lines Coverage;T@o; ;[I"KOneshot lines coverage tracks and reports on the executed lines while ;TI"Qcoverage is running. It will not report how many times a line was executed, ;TI"only that it was executed.;T@o;;[ I"require "coverage" ;TI")Coverage.start(oneshot_lines: true) ;TI"require "foo.rb" ;TI"Ip Coverage.result #=> {"foo.rb"=>{:oneshot_lines=>[1, 2, 3, 6, 7]}} ;T;0o; ;[I"OThe value of the oneshot lines coverage result is an array containing the ;TI"%line numbers that were executed.;T@S; ; i; I"Branches Coverage;T@o; ;[I"RBranches coverage reports how many times each branch within each conditional ;TI"was executed.;T@o;;[ I"require "coverage" ;TI"$Coverage.start(branches: true) ;TI"require "foo.rb" ;TI"p Coverage.result #=> {"foo.rb"=>{:branches=>{[:if, 0, 6, 0, 10, 3]=>{[:then, 1, 7, 2, 7, 7]=>1, [:else, 2, 9, 2, 9, 7]=>0}}}} ;T;0o; ;[ I"QEach entry within the branches hash is a conditional, the value of which is ;TI"Oanother hash where each entry is a branch in that conditional. The values ;TI"Sare the number of times the method was executed, and the keys are identifying ;TI""information about the branch.;T@o; ;[I"QThe information that makes up each key identifying branches or conditionals ;TI"*is the following, from left to right:;T@o;;;;[ o;;0;[o; ;[I"3A label for the type of branch or conditional.;To;;0;[o; ;[I"A unique identifier.;To;;0;[o; ;[I"8The starting line number it appears on in the file.;To;;0;[o; ;[I":The starting column number it appears on in the file.;To;;0;[o; ;[I"6The ending line number it appears on in the file.;To;;0;[o; ;[I"8The ending column number it appears on in the file.;T@S; ; i; I"Methods Coverage;T@o; ;[I"FMethods coverage reports how many times each method was executed.;T@o;;[I"[foo_method.rb] ;TI"class Greeter ;TI" def greet ;TI" "welcome!" ;TI" end ;TI" end ;TI" ;TI"def hello ;TI" "Hi" ;TI" end ;TI" ;TI" hello() ;TI"Greeter.new.greet() ;TI" [EOF] ;TI" ;TI"require "coverage" ;TI"#Coverage.start(methods: true) ;TI"require "foo_method.rb" ;TI"~p Coverage.result #=> {"foo_method.rb"=>{:methods=>{[Object, :hello, 7, 0, 9, 3]=>1, [Greeter, :greet, 2, 2, 4, 5]=>1}}} ;T;0o; ;[I"PEach entry within the methods hash represents a method. The values in this ;TI"Lhash are the number of times the method was executed, and the keys are ;TI".identifying information about the method.;T@o; ;[I"SThe information that makes up each key identifying a method is the following, ;TI"from left to right:;T@o;;;;[ o;;0;[o; ;[I"The class.;To;;0;[o; ;[I"The method name.;To;;0;[o; ;[I"@The starting line number the method appears on in the file.;To;;0;[o; ;[I"BThe starting column number the method appears on in the file.;To;;0;[o; ;[I">The ending line number the method appears on in the file.;To;;0;[o; ;[I"@The ending column number the method appears on in the file.;T@S; ; i; I"All Coverage Modes;T@o; ;[ I"OYou can also run all modes of coverage simultaneously with this shortcut. ;TI"NNote that running all coverage modes does not run both lines and oneshot ;TI"Olines. Those modes cannot be run simultaneously. Lines coverage is run in ;TI"Pthis case, because you can still use it to determine whether or not a line ;TI"was executed.;T@o;;[ I"require "coverage" ;TI"Coverage.start(:all) ;TI"require "foo.rb" ;TI"½p Coverage.result #=> {"foo.rb"=>{:lines=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil], :branches=>{[:if, 0, 6, 0, 10, 3]=>{[:then, 1, 7, 2, 7, 7]=>1, [:else, 2, 9, 2, 9, 7]=>0}}, :methods=>{}}};T;0: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0o;;[;I"!ext/coverage/lib/coverage.rb;T;0;0;0[[[[[I" class;T[[: public[[:protected[[: private[[I"line_stub;TI"!ext/coverage/lib/coverage.rb;T[I"peek_result;TI"ext/coverage/coverage.c;T[I" result;T@[I" resume;T@[I" running?;T@[I" setup;T@[I" start;T@[I" state;T@[I" suspend;T@[I" instance;T[[;[[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[I"ext/coverage/coverage.c;TI"!ext/coverage/lib/coverage.rb;T@ôcRDoc::TopLevelresult-c.ri000064400000001030152351342420006631 0ustar00U:RDoc::AnyMethod[iI" result:ETI"Coverage::result;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"OReturns a hash that contains filename as key and coverage array as value. ;TI"9If +clear+ is true, it clears the counters to zero. ;TI"9If +stop+ is true, it disables coverage measurement.;T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I"7Coverage.result(stop: true, clear: true) => hash ;T0[I"(p1 = v1);T@FI" Coverage;TcRDoc::NormalModule00peek_result-c.ri000064400000001135152351342420007643 0ustar00U:RDoc::AnyMethod[iI"peek_result:ETI"Coverage::peek_result;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"OReturns a hash that contains filename as key and coverage array as value. ;TI"FThis is the same as `Coverage.result(stop: false, clear: false)`.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"{ ;TI"! "file.rb" => [1, 2, nil], ;TI" ... ;TI"};T: @format0: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I"#Coverage.peek_result => hash ;T0[I"();T@FI" Coverage;TcRDoc::NormalModule00running%3f-c.ri000064400000000676152351342420007310 0ustar00U:RDoc::AnyMethod[iI" running?:ETI"Coverage::running?;TT: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"IReturns true if coverage stats are currently being collected (after ;TI":Coverage.start call, but before Coverage.result call);T: @fileI"ext/coverage/coverage.c;T:0@omit_headings_from_table_of_contents_below0I" Coverage.running? => bool ;T0[I"();T@FI" Coverage;TcRDoc::NormalModule00line_stub-c.ri000064400000000402152351342420007301 0ustar00U:RDoc::AnyMethod[iI"line_stub:ETI"Coverage::line_stub;TT: privateo:RDoc::Markup::Document: @parts[: @fileI"!ext/coverage/lib/coverage.rb;T:0@omit_headings_from_table_of_contents_below000[I" (file);T@ FI" Coverage;TcRDoc::NormalModule00