種類
- 文書 (78)
- インスタンスメソッド (33)
- ライブラリ (22)
ライブラリ
- ビルトイン (33)
クラス
-
RubyVM
:: InstructionSequence (11) -
Thread
:: Backtrace :: Location (11) - TracePoint (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) - cgi (11)
- irb (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11)
検索結果
先頭5件
-
Thread
:: Backtrace :: Location # inspect -> String (18125.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"
//}... -
RubyVM
:: InstructionSequence # inspect -> String (18113.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path... -
TracePoint
# inspect -> String (18113.0) -
self の状態を人間に読みやすい文字列にして返します。
...self の状態を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace.enable
foo 1
//}... -
irb (156.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...示する (デフォルト)
--noecho 実行結果を表示しない
--inspect 結果出力にinspectを用いる (bc モード以外ではデフォルト)
--noinspect 結果出力にinspectを用いない
--readline readlineライブラリを利用する
--nor......= nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME] = "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:MATH_MODE] = false
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMP......各インタプリタの self (「irb(obj)」で起動した時の obj)
//}
: source(path)
: irb_source(path)
現在の irb インタプリタ上で、
Ruby スクリプト path を評価します。
path の内容を irb で一行ずつタイプしたかのように、irb 上で一行ず......実行結果を表示する (デフォルト)
--noecho 実行結果を表示しない
--inspect 結果出力にinspectを用いる
--noinspect 結果出力にinspectを用いない
--readline readlineライブラリを利用する
--noreadline readline......= nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME] = "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:... -
ruby 1
. 8 . 4 feature (126.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...-:1: empty symbol literal
: Symbol [bug]
#Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
# if valid as a symbol name more strictly. [ruby-dev:27478]
#
# * test/ruby/test_sym......2) Symbol#inspect sometimes returns invalid symbol representations:
puts :"!".inspect
puts :"=".inspect
puts :"0".inspect
puts :"$1".inspect
puts :"@1".inspect
puts :"@@1".inspect
puts :"@".inspect
p......5 NAKAMURA Usaku <usa@ruby-lang.org>
#
# * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
#
# * test/ruby/test_path.rb (test_dirname, test_basename): follow new
# spec. and add new tests.
UNCパスに対するFile.dirname・File.basename・File.split... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (72.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...tderr に変更されました。($deferr はすぐに obsolete に
なりました。$stderr を使ってください)
=== ARGF
: ((<ARGF/ARGF.path>)) [new]
追加 (ARGF.filename の別名) ((<ruby-dev:20197>))
=== Array
: ((<Array#transpose|Array/transpose>)) [new]
追加
: ((<Array#z......ブジェクトを
生成するようになりました。((<ruby-dev:14847>))
rb_define_alloc_func() も参照。
=== Dir
: ((<Dir#path|Dir/path>)) [new]
追加
=== ENV
: ((<ENV/ENV.clear>)) [new]
: ((<ENV/ENV.shift>)) [new]
: ((<ENV/ENV.invert>)) [new]
: ((<ENV/ENV.replace>))......ス/メソッド(互換性のある変更)
=== 組み込み関数
: ((<組み込み関数/sprintf>)) [new]
"%p" が追加されました。inspect の結果が利用されます。((<RCR#69>))
: ((<組み込み関数/trap>)) [compat]
あるシグナルに対して、SIG_DFL や SIG_IGN... -
NEWS for Ruby 2
. 7 . 0 (60.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...生させます。 10344
* File
* 新規メソッド
* パスが絶対パスかどうかをポータブルに判定するFile.absolute_path?メソッドが追加されました。 15868
* 変更されたメソッド
* Windows以外のプラットフォームでFile.extnameが......4] #=> 0b0011
0b01001100[2..5] #=> 0b0011
0b01001100[2...6] #=> 0b0011
# ^^^^
//}
* Method
* 変更されたメソッド
* Method#inspectで出てくる情報が増えました。 14145
* Module
* 新規メソッド
* 定数が定義された場所を取得するModule#......e?から変更されていました。)
15449
* RubyVM
* 削除されたメソッド
* RubyVM.resolve_feature_pathが$LOAD_PATH.resolve_feature_pathに移動しました。
15903 15230
* String
* Unicode
* Unicodeのバージョンと絵文字のバージョ... -
ruby 1
. 6 feature (54.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...リロードの実行速度が低下するのだそ
うです) ((<ruby-dev:18145>))
: 2002-08-20 File.expand_path
Cygwin 1.3.x ((<ruby-bugs-ja:PR#299>))
p File.expand_path('file', 'c:/')
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/tmp/c:/file
=> ruby 1.6.7 (20......; make sure
ruby 1.6.7 (2002-05-04) [i586-linux]
"\\t"
nil
: 2002-04-20: Regexp#inspect
/x フラグ付きの正規表現オブジェクトの inspect が改行を \n に変換して
いました。((<ruby-bugs-ja:PR#225>))
p /a
b/x......uby-bugs-ja:PR#223>))
trap(:TERM, "EXIT")
END{
puts "exit"
}
Thread.start { Thread.stop }
sleep
: 2002-04-17: Regexp#inspect
((<ruby-bugs-ja:PR#222>))
p %r{\/}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/\\//
=> ruby 1.6.7 (2002-05-04) [i586-linux]... -
NEWS for Ruby 2
. 5 . 0 (30.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...になりました 11286
* File
* File.open :newline オプションを指定するとテキストモードになります 13350
* File#path はFile::Constants::TMPFILE付きで開いたファイルに対して IOError を発生させます
13568
* File.stat, File.exist? など......つか読み込んでから、Coverage.result を使って結果を取得することができます。
//emlist[][ruby]{
Coverage.result
#=> { "/path/to/file.rb"=>
# { :lines => [1, 2, 0, nil, ...],
# :branches =>
# { [:if, 0, 2, 1, 6, 4] =>
# { [:then, 1, 3, 2, 3, 8]......ps://blog.rubygems.org/2017/08/27/2.6.13-released.html
* securerandom
* SecureRandom.alphanumeric を追加
* set
* Set#to_s を Set#inspect の別名として追加 13676
* Set#=== を Set#include? の別名として追加 13801
* Set#reset 6589
* stringio
* StringIO#wr... -
cgi (30.0)
-
CGI プログラムの支援ライブラリです。
...の場合は StringIOオブジェクト)
value.read # 本文(送られてきたファイルの中身)
value.local_path # ローカルファイルのパス
value.original_filename # 元の名前
value.content_type......のような環境変数には以下のものがあります。
* AUTH_TYPE
* CONTENT_LENGTH
* CONTENT_TYPE
* GATEWAY_INTERFACE
* PATH_INFO
* PATH_TRANSLATED
* QUERY_STRING
* REMOTE_ADDR
* REMOTE_HOST
* REMOTE_IDENT
* REMOTE_USER
* REQUEST_METHOD
* SCRIPT_NAME
* SERVER_N......cgi.br +
cgi.submit
end +
cgi.pre() do
CGI.escapeHTML(
"params: " + cgi.params.inspect + "\n" +
"cookies: " + cgi.cookies.inspect + "\n" +
ENV.collect() do |key, value|
key + " --> " + value + "\n"
end.join("")...