59件ヒット
[1-59件を表示]
(0.020秒)
別のキーワード
種類
- ライブラリ (24)
- 文書 (16)
- インスタンスメソッド (12)
- 特異メソッド (7)
ライブラリ
- coverage (7)
クラス
- Coverage (7)
-
RDoc
:: Options (12)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
coverage
_ report (12) -
line
_ stub (7) - rdoc (12)
検索結果
先頭5件
-
coverage (38162.0)
-
カバレッジを測定するためのライブラリです。
...(1) require "coverage" で、ライブラリを読み込む。
(2) Coverage.start を実行し、測定を開始する。
(3) require や load で測定対象のファイルを実行する。
(4) Coverage.result や Coverage.peek_result で結果を確認する。
Coverage.result は、......0
10.times do |x|
s += x
end
if s == 45
p :ok
else
p :ng
end
//}
以下のようにして測定を行います。
//emlist[][ruby]{
require "coverage"
Coverage.start
load "foo.rb"
p Coverage.result # => {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
//}
この Coverage.result["foo.r......b"] から得られる配列は各行の実行回数になっています。
=== カバレッジモードの指定
Ruby 2.5 以降では、Coverage.start の引数で、計測対象の種類を変更するモード機能があります。
==== linesカバレッジモード
linesカバレッジ... -
Coverage
. line _ stub(file) -> Array (17024.0) -
行カバレッジの配列のスタブを返します。
...す。
//emlist[foo.rb][ruby]{
s = 0
10.times do |x|
s += x
end
if s == 45
p :ok
else
p :ng
end
//}
このファイルに対して line_stub を実行すると、次のようになります。
//emlist[][ruby]{
require "coverage"
p Coverage.line_stub("foo.rb") #=> [0, 0, 0, nil, nil, 0, 0... -
RDoc
:: Options # coverage _ report -> Integer | false (6218.0) -
コマンドライン引数の --coverage-report オプションを指定していた場合、指 定した数値を返します。
...コマンドライン引数の --coverage-report オプションを指定していた場合、指
定した数値を返します。
指定しなかった場合は false を返します。... -
NEWS for Ruby 2
. 6 . 0 (42.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...:
//emlist{
ary[1..] # ary[1..-1] と同じ
(1...).each {|index| block } # index が 1 から始まる無限ループ
ary.zip(1..) {|elem, index| block } # ary.each.with_index(1) { }
//}
* キーワード引数のハッシュに Symbol 以......削除されました。 12490
以下のようなコードを警告なしに書くことができます:
//emlist{
user = users.find {|user| cond(user) }
//}
* 例外が捕捉されず、バックトレースとエラーメッセージが表示されるときに、
例外の Excepti......* Bundler
* Bundler が標準添付ライブラリに追加されました。 12733
* 最新安定版の 1.17.2 が使われます。
* Coverage
* oneshot_lines モードが追加されました。 15022
* このモードは「各行が何回実行されたか」の代わりに... -
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
実行時に......) { |line, address| ... }
メソッド名の直後に ':yields: …' を含むコメントを書くと、この出力を上書
きできます。
def fred # :yields: index, position
...
yield line, address
上のようにすると、以下の出力になります。
fred() { |in... -
NEWS for Ruby 3
. 1 . 0 (24.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...イブラリから削除されました。
* dbm
* gdbm
* tracer
* Coverageの計測が一時停止をサポートされるようになりました。 Coverage.suspendで計測を一時停止し、Coverage.resumeで再開することができます。詳細は 18176 を参照してく......るようになりました。 https://github.com/ruby/rbs/pull/823
//emlist{
# Defines a generic type `list`.
type list[T] = [ T, list[T] ]
| nil
type str_list = list[String]
type int_list = list[Integer]
//}
* gemsのRBSを管理するためのrbs collectionコマンド(https://g... -
NEWS for Ruby 3
. 0 . 0 (12.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......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...