ライブラリ
- ビルトイン (44)
- json (22)
-
shell
/ command-processor (6)
クラス
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
- dump (22)
- irb (11)
- restore (22)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) -
run
_ config (6) - セキュリティモデル (11)
検索結果
-
NEWS for Ruby 2
. 3 . 0 (60.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...#fetch_values を追加
10017
* Hash#dig を追加
11643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653
* IO
* 新しいフラグ File::SHARE_DELETE(File::Constants::SHARE_DELETE) が使用できます。
Windows で......NameError#receiver を追加
10881
* Numeric
* Numeric#positive?, Numeric#negative? を追加
11151
* Proc
* Proc#call ( Proc#[] , Proc#===, Proc#yield) は最適化されました。
Backtrace doesn't show each method (show block lines directly).
TracePoint al......* 実験的な機能としてiseqローダー用の低レベルな操作をするメソッドをいくつか追加
使用例は sample/iseq_loader.rb を見てください。
ローダーには検証機能がないので、編集したバイナリや壊れたバイナリをロードす... -
NEWS for Ruby 2
. 0 . 0 (48.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...す
* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。Array#to_a に似ています
* 拡張: Hash#default_proc= default proc をクリアするために nil を渡せるようになりました
* IO
* 非推奨: IO#lines, #bytes, #chars, #codepoints
* Kern......非互換: Object#inspect は #to_s を呼び出さなくなりました。再定義された #to_s を呼び出すためです。
* LoadError
* 追加: LoadError#path ロードできなかったファイルのパスを返します
* Module
* 追加: Module#prepend 指定したモジ......* ObjectSpace::WeakMap
* 弱い参照を保持するための低レベルのクラスです。
* Proc
* 非互換: Proc#== と #eql? を削除。
* Process
* 追加: Process#getsid session id を取得します(unix のみ)。
* Range
* 追加: Range#size サイズの... -
NEWS for Ruby 3
. 0 . 0 (48.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ror 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 a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])......be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQueue
* Queue#pop, SizedQueue#pu......of classes and modules with advanced types including union types, overloading, generics, and _interface types_ for duck typing.
* Ruby ships with type definitions for core/stdlib classes.
* `rbs` gem is bundled to load and process RBS files.
=== TypeProf
* TypeProf is a type analysis tool fo... -
Ruby用語集 (48.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...オブジェクトの仮引数の数、および
ブロックやそれをオブジェクト化した Proc オブジェクトの
ブロックパラメーターの数。
Method#arity や Proc#arity で得ることができる。
引数などの数が 1 個、2 個、3 個であることを......たメソッド呼び出しにおける
「.」「&.」も演算子である。
「[*0..9]」におけるいわゆる splat 展開の * や、
Proc オブジェクトをブロックとして渡す「strs.map(&:length)」に
おける & も演算子である。
defined? のように、見......Ruby 2.7 以降では case/in の As パターンでも使う。
参照:d:spec/literal#hash
: ロードパス
スクリプトを require、load などで読み込む(ロードする)とき、
ファイルの位置を絶対パスで与えなくても、ファイル名(拡張子は略... -
irb (36.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...se
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true
それぞれの設定値の詳細について......す。
そこで、IRB.conf[:IRB_RC] を使う方法を紹介します。
IRB.conf[:IRB_RC] に Proc オブジェクトを設定しておくと、
サブ irb が起動されるたびに、その Proc オブジェクトに
IRB::Context オブジェクトを渡して実行します。
これによっ......とができます。
以下に例を示します。
$ irb
irb(main):001:0> IRB.conf[:IRB_RC] = lambda {|conf| conf.prompt_i = "> " }
=> #<Proc:0x00002a95fa3fd8@(irb):2>
irb(main):002:0> irb
>
=== irb の使用例
irb のいろいろな使用例を以下に示します。
$ irb
ir......il
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true
それぞれの設定値の詳細について......l
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true
それぞれの設定値の詳細について... -
NEWS for Ruby 2
. 5 . 0 (30.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882
* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142
* Module
* Module#attr, Module#attr_accessor, Module#attr_reader, Module#attr_w......くなりました。
coerceがnilを返す場合、変換は不可能です。7688
* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しました 11952
* Process.last_status を追加。$? と同じです 14043
* Range
* Range.new no longer hide......* Convert fallback option to a keyword argument
https://github.com/ruby/psych/pull/342
* Add :symbolize_names option to Psych.load, Psych.safe_load like JSON.parse
https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337
* Add Psych::Handler#event_lo... -
セキュリティモデル (30.0)
-
セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。
...部コマンド実行 (Kernel.#system, Kernel.#exec, Kernel.#`, Kernel.#spawn など)
* Kernel.#eval
* トップレベルへの Kernel.#load (第二引数を指定してラップすれば実行可能)
* Kernel.#require
* Kernel.#trap
==== レベル 2
===== 汚染される......のメソッド
* IO#ioctl, IO#fcntl
* Process.fork Process.#setpgid Process.#setsid
Process.#setpriority Process.#egid= Process.#kill
* 危険なパスからの Kernel.#load
* 汚染された文字列を引数にしての Kernel.#load (ラップされていても)
* Kernel.#sysc......-e -r -i -I -x
//}
* setuid, setgid されたスクリプトは $SAFE = 1 以上で実行される。
* Proc はその時点でのセーフレベルを記憶する。
その Proc オブジェクトが call されると、記憶していたセーフレベルで実行される。
* 汚... -
Marshal
. # dump(obj , limit = -1) -> String (24.0) -
obj を指定された出力先に再帰的に出力します。
...下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これらのオブ......、デフォルト値を求めるブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義するこ......オブジェクトをダンプしようとした場合に発生します。
@raise ArgumentError limit 段以上深くリンクしたオブジェクトをダンプしようと
した場合に発生します。
@see Object#marshal_dump, Object#marshal_load... -
Marshal
. # dump(obj , port , limit = -1) -> IO (24.0) -
obj を指定された出力先に再帰的に出力します。
...下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これらのオブ......、デフォルト値を求めるブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義するこ......オブジェクトをダンプしようとした場合に発生します。
@raise ArgumentError limit 段以上深くリンクしたオブジェクトをダンプしようと
した場合に発生します。
@see Object#marshal_dump, Object#marshal_load... -
セキュリティモデル (18.0)
-
セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。
...部コマンド実行 (Kernel.#system, Kernel.#exec, Kernel.#`, Kernel.#spawn など)
* Kernel.#eval
* トップレベルへの Kernel.#load (第二引数を指定してラップすれば実行可能)
* Kernel.#require
* Kernel.#trap
==== レベル 2
廃止されました......-e -r -i -I -x
//}
* setuid, setgid されたスクリプトは $SAFE = 1 以上で実行される。
* Proc はその時点でのセーフレベルを記憶する。
その Proc オブジェクトが call されると、記憶していたセーフレベルで実行される。
* 汚...