45件ヒット
[1-45件を表示]
(0.014秒)
別のキーワード
ライブラリ
- coverage (8)
クラス
- Coverage (8)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - rdoc (12)
- start (8)
検索結果
先頭5件
-
coverage (38186.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...... methodsカバレッジモード
methodsカバレッジモードでは、各メソッドの実行回数を計測します。
//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(option = {}) -> nil (17054.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 3
. 0 . 0 (96.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* `$SAFE` and `$KCODE` are now normal global variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a meth......trace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates
Outstanding ones only.
* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop
* Array#drop_while......e, 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 > 10
x.to_s
else
nil
end
e... -
NEWS for Ruby 2
. 5 . 0 (60.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......list[][ruby]{
Coverage.result
#=> { "/path/to/file.rb"=>
# { :lines => [1, 2, 0, nil, ...],
# :branches =>
# { [:if, 0, 2, 1, 6, 4] =>
# { [:then, 1, 3, 2, 3, 8] => 0,
# [:else, 2, 5, 2, 5, 8] => 2
# }
# },
# :methods => {
#... -
NEWS for Ruby 3
. 1 . 0 (24.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ment
* Module#refineで作成されたモジュールを表す新しいクラス。includeとprependは非推奨になり、代わりにimport_methodsが追加されました。
== 標準添付ライブラリの更新(機能追加とバグ修正を除く)
* 以下のdefault gemsが更新さ......イブラリから削除されました。
* dbm
* gdbm
* tracer
* Coverageの計測が一時停止をサポートされるようになりました。 Coverage.suspendで計測を一時停止し、Coverage.resumeで再開することができます。詳細は 18176 を参照してく... -
rdoc (24.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...: --charset charset
生成する HTML の charset を指定します。
可能であれば --encoding を使用してください。
: --coverage-report level, --dcov level
ドキュメントが記述されていない要素に関するレポートを出力します。0 以
下を指......ッドの引数に関するレポー
トを出力します。level を省略した場合は 0 を指定したと見なされます。
: --no-coverage-report, --no-dcov
ドキュメントが記述されていない要素に関するレポートを出力しません。
: --debug
実行時に......: :category: title
記述した要素の :section: を title で指定したものに上書きします。
//emlist{
# :category: Utility Methods
#
# CGI escapes +text+
def convert_string text
CGI.escapeHTML text
end
//}
title を省略した場合は、:section:...