るりまサーチ

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

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. class new
  5. argf.class to_a

検索結果

coverage (38156.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...
...測します。

//emlist[foo_method.rb][ruby]{
class
Greeter
def greet
"welcome!"
end
end

def hello
"Hi"
end

hello()
Greeter.new.greet()
//}

//emlist[][ruby]{
require "coverage"
Coverage
.start(methods: true)
load "foo_method.rb"
pp Coverage.result
# {"foo_method.rb"=>
# {:methods=>
#...

NEWS for Ruby 3.0.0 (96.0)

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

...d in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a Run...
...timeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class
variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Command line options

==...
...guage yet, we will continuously improve the coverage of language features, analysis performance, and usability.

//emlist[][ruby]{
# test.rb
def foo(x)
if x > 10
x.to_s
else
nil
end
end

foo(42)
//}

//emlist{
$ typeprof test.rb
# Classes
class
Object
def foo : (Integer) -> String?
e...

NEWS for Ruby 3.1.0 (66.0)

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

...* Class
* 新規メソッド
* Class#subclassesはレシーバを継承した子クラスを要素に持つ配列(シングルトンクラスを含まない)を返します。

//emlist[Class#subclasses][ruby]{
class
A; end
class
B < A; end
class
C < B; end
class
D < A; end
A.subclasses...
...#=> [D, B]
B.subclasses #=> [C]
C.subclasses #=> []
//}

* Enumerable
* 新規メソッド
* Enumerable#compactが追加されました。 17312
* Enumerable#tallyがカウント集計用のハッシュオブジェクトを任意で渡せるようになりました。 1774...
...イブラリから削除されました。
* dbm
* gdbm
* tracer

* Coverageの計測が一時停止をサポートされるようになりました。 Coverage.suspendで計測を一時停止し、Coverage.resumeで再開することができます。詳細は 18176 を参照してく...

NEWS for Ruby 2.5.0 (54.0)

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

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

* coverage
* ブランチカバレッジとメソッドカバレッジの計測をサポートしました 13901
この新機能と一緒にテ...
...す。
Coverage
.start に与えるオプションによって計測する対象を指定することができます。
//emlist[][ruby]{
Coverage
.start(lines: true, branches: true, methods: true)
//}
* Rubyで書かれたファイルをいくつか読み込んでから、Coverage.result...
...の場合:
//emlist{
{ (method key) => (counter) }
//}
* メソッドキーにはフォーマットがあります:
//emlist{
[class, method-name, start lineno, start column, end lineno, end column]
//}
* 例えば [Object, :foo, 1, 0, 7, 3] は Object#foo は1行目の0桁...

rdoc (42.0)

RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。

...: --charset charset

生成する HTML の charset を指定します。

可能であれば --encoding を使用してください。

: --coverage-report level, --dcov level

ドキュメントが記述されていない要素に関するレポートを出力します。0 以
下を指...
...ッドの引数に関するレポー
トを出力します。level を省略した場合は 0 を指定したと見なされます。

: --no-coverage-report, --no-dcov

ドキュメントが記述されていない要素に関するレポートを出力しません。

: --debug

実行時に...
...source directory. Default is
the current directory.

: --page-dir dir

Directory where guides, your FAQ or other pages not associated with
a class live. Set this when you don't store such files at your
project root. NOTE: Do not use the same file name in the page dir
and the root of your...

絞り込み条件を変える

NEWS for Ruby 2.3.0 (30.0)

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

...bjectSpace (objspace)
* ObjectSpace.#count_symbols を追加。
* ObjectSpace.#count_imemo_objects を追加。
* ObjectSpace.#internal_class_of を追加。
* ObjectSpace.#internal_super_of を追加。

* OpenSSL
* OpenSSL::SSL::SSLSocket#accept_nonblock と
OpenSSL::SS...
...告されるようになりました。

=== 標準添付ライブラリの互換性 (機能追加とバグ修正を除く)

* ext/coverage/coverage.c
* Coverage.peek_result を追加。カバレッジツールを停止することなくカバレッジに関する情報を取得することが...
...$SAFE=3 が廃止されました。$SAFE を2以上にすると ArgumentError が発生します。
5455

=== C API の更新

* rb_define_class_id_under() は既にクラスが定義済みなのに、
そのスーパークラスが与えられたスーパークラスと一致しない...

NEWS for Ruby 2.6.0 (30.0)

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

...ションが追加されて
Ruby コードからも設定できるようになりました。 14313

* NilClass
* 新規メソッド
* 互換性のため、NilClass#=~ が追加されました。 15231

* NoMethodError
* 新規オプション
* NoMethodError.new に :r...
...* Bundler
* Bundler が標準添付ライブラリに追加されました。 12733
* 最新安定版の 1.17.2 が使われます。

* Coverage
* oneshot_lines モードが追加されました。 15022
* このモードは「各行が何回実行されたか」の代わりに...
...なくなります。
* 新規オプション
* :oneshot_lines キーワード引数が Coverage.start に追加されました。
* :stop と :clear キーワード引数が Coverage.result に追加されました。
clear が真の時、カウンターが0クリアされ...