ライブラリ
- ビルトイン (11)
-
irb
/ context (11)
クラス
キーワード
- Context (11)
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - of (11)
-
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
irb (39670.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......る Binding
オブジェクトの作成方法を 0 から 3 で設定する。
(IRB::Context 参照)
--single-irb irb 中で self を実行して得られるオブジェクトをサブ irb と共
有する
--irb_debug n irb の......ブ irb を起動するたびに設定を入力するのは面倒です。
そこで、IRB.conf[:IRB_RC] を使う方法を紹介します。
IRB.conf[:IRB_RC] に Proc オブジェクトを設定しておくと、
サブ irb が起動されるたびに、その Proc オブジェクトに
IRB::Cont... -
IRB
:: Context (3274.0) -
irb の設定を扱うためのクラスです。
...irb の設定を扱うためのクラスです。
irb 中で conf コマンドの戻り値や .irbrc で IRB.conf を操作する事で設定
を変更します。irb の起動後は IRB.conf の内容を更新しても変更の内容は反
映されない事に注意してください。
なお......、.irbrc 中に記述できる以下の設定値については、IRB::Context
オブジェクトのメソッドとして操作できません。
: IRB.conf[:AT_EXIT]
irb の終了時(サブ irb を含みません)に本項目に設定された Proc オ
ブジェクトを実行します。ブ......: IRB.conf[:CONTEXT_MODE]
新しいワークスペースを作成した時(サブ irb の起動や pushws した時)に、
ワークスペースに関連する Binding オブジェクトの作成方法を
Integer で設定します。
0 を指定した場合、Object::TOPLEVEL_BINDING... -
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (94.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...引数 body で指定した Proc、Method オブジェクトを元に
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param body Proc、Method オブジェクトを指定します。
例1:irb で実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::In......structionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::InstructionSequence.compile_file を使用した場......$a_global_proc = proc { str = 'a' + 'b' }
# irb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # =>... -
NEWS for Ruby 2
. 7 . 0 (90.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...==== ブロックなしの proc/lambda が deprecated
* ブロック付きで呼び出されたメソッドの中で、ブロックなしでProc.newやKernel#procを
呼び出すと警告が表示されるようになりました。
//emlist[][ruby]{
def foo
proc
end
foo { puts "Hello" }......るようになりました。
* ERB
* ERBのインスタンスをMarshalできないようになりました。
* IRB
* Pry gem に着想を得て、Binding#irbのソース表示、REPLの入力、
いくつかのコアクラスオブジェクトのinspect出力に
シン......* Scanf (scanf gem)
* Shell (shell gem)
* Synchronizer (sync gem)
* ThreadsWait (thwait gem)
* E2MM (e2mmap gem)
* Proc
* Proc#to_sの形式が変更されました。 16101
* Range
* Range#minmaxが最大値を決めるためにRangeをイテレートしてい... -
NEWS for Ruby 2
. 6 . 0 (78.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...した。 13784
* Binding
* 新規メソッド
* Binding#source_location 追加 14230
* bindingのソースコード上の位置を __FILE__ と __LINE__ の二要素配列として返します。
従来でも eval("[__FILE__, __LINE__]", binding) とすることでこ......しいキーと値に変換できるようになりました。 15143
* Proc
* 新規メソッド
* 関数合成用に Proc#<< と Proc#>> が追加されました。 6284
* 非互換な変更
* Proc#call が $SAFE を変更しなくなりました。 14250
* Random
*......とバグ修正を除く)
* 以下の標準添付ライブラリがデフォルト gem になりました。
* e2mmap
* forwardable
* irb
* logger
* matrix
* mutex_m
* ostruct
* prime
* rexml
* rss
* shell
* sync
* thwait
* tracer
* BigDe... -
NEWS for Ruby 3
. 0 . 0 (66.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])......'--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352 17419
* Conditi......Ractor compatible.
* Etc
* Update to Etc 1.2.0
* This version is Ractor compatible.
* Fiddle
* Update to Fiddle 1.0.5
* IRB
* Update to IRB 1.2.6
* JSON
* Update to JSON 2.5.0
* This version is Ractor compatible.
* Set
* Update to set 1.0.0
* SortedSet has... -
NEWS for Ruby 2
. 5 . 0 (60.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......ink_local? を追加 10912
* irb
* バックトレースとエラーメッセージを逆順で表示するようにしました 8661 [実験的]
* binding.irb を実行したときに自動的に irb を読み込みます 13099 [実験的]
* binding.irb を実行したときに周囲......#state.
* Ripper#state を追加。スキャナーの状態を伝えるためです。13686
* rdoc
* RDoc 6.0.1 に更新
* Replace IRB based lexer with Ripper.
* https://github.com/ruby/rdoc/pull/512
* This much improves the speed of generating documents.
*... -
ruby 1
. 6 feature (60.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...d>))
サイズが 0 で中身のあるファイル(Linux の /proc ファイルシステムでこ
のような場合があります)が File#read などで読めないバグが修正されまし
た。
p File.open("/proc/#$$/cmdline").read
=> ruby 1.6.7 (2002-03-01) [i586-li......001-10-15) [i586-linux]
MatchData
NotImplementedError
FloatDomainError
LoadError
Float
Binding
SignalException
Module
-:6:in `method_missing': stack level too deep (SystemStackError)
: %q(...)
%......準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります)
: ((<irb>)) & irb-tools
irb と irb-tools がそれぞれ 0.7.4 と 0.7.1 にバージョンアップしました。
: 夏時間
夏時間の考慮に不備があ... -
NEWS for Ruby 2
. 4 . 0 (42.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...。
== 2.3.0 以降の変更
=== 言語仕様の変更
* 条件式での多重代入ができるようになりました 10617
* Symbol#to_proc でメソッド呼び出し元での Refinements が有効になりました 9451
* Object#send や BasicObject#__send__ でメソッドを呼び......引数のオブジェクトを IPAddr に変換する処理に失敗しても例外が発生しなくなりました
12799
* irb
* Binding#irb binding.pryと同じようにREPLのセッションを開始します。r56624.
* logger
* Logger.new のキーワード引数に level,......ド引数 into を追加 11191
* pathname
* Pathname#empty? を追加 12596
* readline
* Readline.quoting_detection_proc, Readline.quoting_detection_proc= を追加
12659
* rexml
* REXML::Element#[] : If String or Symbol is specified, attribute
value is returned. Oth...