26件ヒット
[1-26件を表示]
(0.120秒)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - 制御構造 (11)
検索結果
先頭3件
-
debug (38024.0)
-
Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。
...た、Emacs を使用したインタフェース rubydb3x.el が
https://github.com/ruby/elisp にあるので、活用してください。
=== 使い方
$ ruby -rdebug foo.rb
または、Emacs から
M-x load-library rubydb3x.el
M-x rubydb
=== デバッグコマンド
以下は、......指定した行数分、処理を
続行します。メソッドの中に入ります。
このコマンドの省略形は s です。
: next [nnn]
一行ずつ処理を実行します。引数を指定した場合、指定した行数分、処理を
続行します。step [nnn]と......フレームのスタックと、現在のフレーム位置を表示します。
このコマンドの省略形は w または f です。
: list [(-|nn-mm)]
スクリプトを表示します。引数が `-' ならば前の行を表示します。
nn-mm の形式では指定した範... -
制御構造 (284.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END
Rubyでは(Cなどとは異なり)制御構造は式であ......elif(sh のように)でもないことに注意してください。
また if の条件式が正規表現のリテラルである時には特別に
//emlist[][ruby]{
$_ =~ リテラル
//}
であるかのように評価されます。
==== if 修飾子
//emlist[例][ruby]{
print "debug\n" if......nil
を返します。
ただし、引数を指定した場合はループの戻り値はその引数になります。
====[a:next] next
//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}
文法:
next
next... -
NEWS for Ruby 3
. 0 . 0 (24.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting......ring#partition
* String#reverse
* String#rjust
* String#rpartition
* String#rstrip
* String#scrub
* String#slice!
* String#slice / String#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ / String#next......`use URI#open` instead. 15893
* SortedSet has been removed for dependency and performance reasons.
== Stdlib compatibility issues
* Default gems
* The following libraries are promoted to default gems from stdlib.
* English
* abbrev
* base64
* drb
* debug...