種類
- 文書 (42)
- インスタンスメソッド (22)
- ライブラリ (12)
- 関数 (11)
ライブラリ
-
rdoc
/ markdown (22)
クラス
-
RDoc
:: Markdown (22)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - debug (11)
- github= (11)
-
rb
_ scan _ args (11) -
test
/ unit (1) - 正規表現 (11)
検索結果
先頭5件
-
RDoc
:: Markdown # github -> bool (30317.0) -
Github Flavored Markdown 拡張の一部を有効にして出力を行うかどうかを返し ます。
...
Github Flavored Markdown 拡張の一部を有効にして出力を行うかどうかを返し
ます。
デフォルトでは true を返します。... -
RDoc
:: Markdown # github=(val) (18317.0) -
Github Flavored Markdown 拡張の一部を有効にして出力を行うかどうかを設定 します。
...
Github Flavored Markdown 拡張の一部を有効にして出力を行うかどうかを設定
します。... -
test
/ unit (6012.0) -
ユニットテストを行うためのライブラリです。
...してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳で......ティングフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように使います。
まずテスト対......ドが必ず
呼ばれます。実行されたあとには、teardown メソッドが必ず呼ばれます。
require 'test/unit'
require 'foo'
class TC_Foo < Test::Unit::TestCase
def setup
@obj = Foo.new
end
# def teardown
# end
def test_foo... -
int rb
_ scan _ args(int argc , const VALUE *argv , const char *fmt , . . . ) (306.0) -
長さ argc の配列 argv を fmt に従って 解析し、第四引数以降で渡されたアドレスに書き込みます。
...def some_method(a, b, opt = nil)
使用例 (2)
VALUE a, rest, block;
rb_scan_args(argc, argv, "1*&", &a, &rest, &block);
対応する Ruby プログラムでの宣言
def some_method(a, *rest, &block)
@see https://github.com/ruby/ruby/blob/master/doc/extension.ja.rdoc... -
NEWS for Ruby 2
. 7 . 0 (198.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a,......nd
//}
//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}
//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}
//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "n......16420
* $LOAD_PATH
* 新規メソッド
* $LOAD_PATH.resolve_feature_pathが追加されました。 15903 15230
=== 標準添付ライブラリの更新 (注目すべきもののみ)
* Bundler
* Bundler 2.1.2 に更新されました。
https://github.com/bundler/bundler... -
正規表現 (150.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は......どの場所であるかを知ることができます。
//emlist[][ruby]{
/pat/
%r{pat}
//}
などの正規表現リテラルや Regexp.new などで正規表現
オブジェクトを得ることができます。
===[a:metachar] メタ文字列とリテラル、メタ文字とエスケープ......Unicodeのプロパティ(属性情報)による文字クラス指定も可能です。
以下の記法が使えます。
* \p{property-name}
* \p{^property-name} (否定)
* \P{property-name} (否定)
サポートされているプロパティのリストは
https://github.com/k-takata/Onigmo/... -
NEWS for Ruby 2
. 0 . 0 (66.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加し......コーディングを US-ASCII から UTF-8 に変更しました
* '_' で始まる使用されていない変数は警告しなくなりました
=== 組み込みクラスの更新
* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソ......。
* Fixnum, Bignum, Float
* フリーズされました。
* Signal.trap
* 上を参照
* Onigmo をマージしました。
https://github.com/k-takata/Onigmo
* The :close_others option is true by default for system() and exec().
Also, the close-on-exec flag is set by... -
NEWS for Ruby 2
. 1 . 0 (54.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.0.0 以降の変更
=== 言語仕様の変更
* キーワード引数のデフ......尾に'r','i','ri'という接尾辞を付けられるようになりました
//emlist{
# r を付けると有理数になる
42r # => Rational(42, 1)
3.14 # => 3.14.rationalize
6.022e+23r # 指数形式と一緒には使えない
# i を付けると虚数単位 i を掛けた......c.html
* rbconfig
* 追加: RbConfig::SIZEOF C の型のサイズを提供するために追加しました。
* rdoc
* 4.1.0 に更新。主にデフォルトのテンプレートとアクセシビリティを改善しました。
https://github.com/ruby/rdoc/blob/v4.1.0.preview... -
NEWS for Ruby 3
. 0 . 0 (48.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......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 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leadin......stdlib.
* digest
* io-nonblock
* io-wait
* nkf
* pathname
* syslog
* win32ole
* Bundled gems
* net-telnet and xmlrpc have been removed from the bundled gems. If you are interested in maintaining them, please comment on your plan to https://github.com/... -
debug (24.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
=== デバッグコマンド
以下......。
ここに挙げたもの以外を入力した場合、その入力を ruby の式として評価します。
: break
: break [<file>:]<position>|<class>:<method>
ブレークポイントを設定します。引数を省略した場合設定したブレークポ
イントを表示しま......は b です。
: catch <an Exception>
例外が発生した時にデバッガを停止させるキャッチポイントを設定します。
引数を省略した場合設定したキャッチポイントを表示します。
発生した例外が <an Exception> のサブクラスで...