るりまサーチ

最速Rubyリファレンスマニュアル検索!
45件ヒット [1-45件を表示] (0.033秒)
トップページ > クエリ:pp[x] > クエリ:coverage[x]

別のキーワード

  1. pp pp
  2. pp seplist
  3. pp object_group
  4. pp singleline_pp
  5. pp comma_breakable

検索結果

coverage (38168.0)

カバレッジを測定するためのライブラリです。

...(1) require "coverage" で、ライブラリを読み込む。
(2) Coverage.start を実行し、測定を開始する。
(3) require や load で測定対象のファイルを実行する。
(4) Coverage.result や Coverage.peek_result で結果を確認する。

Coverage
.result は、...
..."coverage"
Coverage
.start
load "foo.rb"
p Coverage.result # => {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
//}

この Coverage.result["foo.rb"] から得られる配列は各行の実行回数になっています。


=== カバレッジモードの指定

Ruby 2.5 以降では、Coverage...
...件分岐のそれぞれの分岐(branch)の実行された回数を計測します。

//emlist[][ruby]{
require "coverage"
Coverage
.start(branches: true)
load "foo.rb"
pp
Coverage.result
# {"foo.rb"=>
# {:branches=>
# {[:if, 0, 6, 0, 10, 3]=>
# {[:then, 1, 7, 2, 7, 7]=>1, [:else, 2, 9,...

Coverage.start(option = {}) -> nil (17048.0)

カバレッジの測定を開始します。既に実行されていた場合には何も起こりません。 ただし、カバレッジ計測中に測定対象を変更しようとした場合は、RuntimeError となります。

...
詳細は、coverage ライブラリ を参照してください。

//emlist[bool.rb][ruby]{
def bool(obj)
if obj
true
else
false
end
end
//}

//emlist[][ruby]{
require "coverage"

Coverage
.start(:all)
load "bool.rb"
bool(0)
pp
Coverage.result
# {"bool.rb"=>
# {:li...
...:branches=>
# {[:if, 0, 2, 2, 6, 5]=>
# {[:then, 1, 3, 4, 3, 8]=>1, [:else, 2, 5, 4, 5, 9]=>0}},
# :methods=>{[Object, :bool, 1, 0, 7, 3]=>1}}}

Coverage
.start(methods: true)
load "bool.rb"
bool(0)
pp
Coverage.result #=> {"bool.rb"=>{:methods=>{[Object, :bool, 1, 0, 7, 3]=>1}}}
//}...

NEWS for Ruby 2.5.0 (54.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加 12746
* Array#prepend を追加 12746

* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Ruby...
...teger#anybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加 13219

* Kernel
* Object#yield_self を追加 6721
* Kernel.#pp をrequireなしで使えるようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882

*...
...igDecimal.ver
* BigDecimal#clone と BigDecimal#dup は新しいインスタンスを作らなくなりました。selfを返します。

* coverage
* ブランチカバレッジとメソッドカバレッジの計測をサポートしました 13901
この新機能と一緒にテ...

NEWS for Ruby 3.1.0 (36.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* net-protocol 0.1.2
* nkf 0.1.1
* open-uri 0.2.0
* openssl 3.0.0
* optparse 0.2.0
* ostruct 0.5.2
* pathname 0.2.0
* pp 0.3.0
* prettyprint 0.1.1
* psych 4.0.3
* racc 1.6.0
* rdoc 6.4.0
* readline 0.0.3
* readline-ext 0.1.4
* reline 0.3.0...
...イブラリから削除されました。
* dbm
* gdbm
* tracer

* Coverageの計測が一時停止をサポートされるようになりました。 Coverage.suspendで計測を一時停止し、Coverage.resumeで再開することができます。詳細は 18176 を参照してく...
...l以降の引数に警告されるようになりました。 14256
* lib/debug.rb が debug.gem に置き換えられました。
* lib/pp.rb の Kernel#pp がデフォルトで IO#winsize の幅を使用するようになりました。出力幅が端末サイズに応じて自動的に変更...

RubyVM::InstructionSequence.compile_option -> Hash (18.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返
します。

//emlist[例][ruby]{
require "pp"
pp
RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :s...
...>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (12.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...[[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is...
...ERIMENTAL]
16828

//emlist{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, String => y, *post]
p p
re #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p p
ost #=> [2, "d", "e", "f", 3]
end
//}

* Endless method definition is added. [EXPERIMENTAL]
16746

//emlist{
def...
...code, tries inferring its type signature, and prints the analysis result in RBS format.
* Though it supports only a subset of the Ruby language yet, we will continuously improve the coverage of language features, analysis performance, and usability.

//emlist[][ruby]{
# test.rb
def foo(x)
if x...