種類
- 文書 (92)
- インスタンスメソッド (11)
- ライブラリ (11)
ライブラリ
- ビルトイン (11)
クラス
- String (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - irb (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11)
検索結果
-
String
# dump -> String (18139.0) -
文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。
...に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}......字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}
@see String#undump... -
Marshal フォーマット (558.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...なります。
//emlist[][ruby]{
p Marshal.dump(nil).unpack1("x2 a*") # => "0"
p Marshal.dump(true).unpack1("x2 a*") # => "T"
p Marshal.dump(false).unpack1("x2 a*") # => "F"
//}
Ruby 2.1 以前では、インスタンス変数を設定しても dump されません。
Ruby 2.2 以降は freeze......形式 2 との区別のためです。
//emlist[例][ruby]{
p Marshal.dump(-1).unpack1("x2 a*") # => "i\xFA"
p Marshal.dump(0).unpack1("x2 a*") # => "i\x00"
p Marshal.dump(1).unpack1("x2 a*") # => "i\x06"
p Marshal.dump(2).unpack1("x2 a*") # => "i\a" ("i\x07")
//}
形式 1 の範囲を超......Foo
end
p Marshal.dump(Foo).unpack("x2 a c a*") # => ["c", 8, "Foo"]
//}
//emlist[例 2: クラス/モジュールのインスタンス変数は dump されない][ruby]{
module Bar
@bar = 1
end
p Bar.instance_eval { @bar } # => 1
File.open('testfile', 'wb') do |f|
Marshal.dump(Bar, f)
end
#... -
ruby 1
. 6 feature (114.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...が定義されていない場合例外 NameError を起こ
すようになりました。((<ruby-bugs-ja:PR#216>))
Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
=> -:2:in `remove_ins......ule_eval>))
((<Module/module_eval>)) のブロック内で定数やクラス変数のスコープが
変わることはなくなりました。((<ruby-dev:17876>))
class Foo
FOO = 1
@@foo = 1
end
FOO = 2
@@foo = 2
Foo.module_eval {......hal/Marshal.load>))
Marshal.load が 1.7 のメソッド Proc#yield を呼んでいました。
((<ruby-dev:16178>))
Marshal.load(Marshal.dump('foo'), proc {|o| p o})
=> -:1:in `load': undefined method `yield' for #<Proc:0x401b1b30> (NameError)
from -:1
ruby 1.6.7 (2... -
ruby 1
. 8 . 4 feature (96.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...1.8.4 (2005-12-22) [i686-linux]
:foo!
:bar?
4) :$- always treats next character literally:
p eval(":$-\n") # => :"$-\n"
p :$-( # => :"$-("
p :$- # => :"$- "
p :$-#.object_id # => 3950350
# => ru......Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.
: super [bug]
Kerne......da::Tuple#initialize): check remote hash
# tuple. fixed: [ruby-list:41227]
#
# * test/rinda/test_rinda.rb: test it.
Hash全体がdumpできないオブジェクトとして扱われていました。
((<ruby-list:41227>))
: Iconv [compat]
#Sat Oct 8 20:04:40 2005 Nobuyoshi... -
irb (54.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...れます。
IRB.conf[:AUTO_INDENT] = false
IRB.conf[:BACK_TRACE_LIMIT] = 16
IRB.conf[:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = 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
IR......ん。
この変数を使用するには、あらかじめ .irbrc などで
conf.eval_history の値を指定しておかなければいけません。
例:
//emlist{
$ irb
irb(main):001:0> conf.eval_history = 100
=> 100
irb(main):002:0> 1 + 2
=> 3
irb(main):003:0> 'hoge' + 'fo......yaml, :YAML
出力結果を YAML 形式にしたものを表示します。
: :marshal, :Marshal, :MARSHAL, Marshal
出力結果を Marshal.#dump したものを表示します。
例:
$ irb
irb(main):001:0> conf.inspect_mode = :yaml
irb(main):002:0> :foo # => --- :foo
また、irb... -
ruby 1
. 8 . 2 feature (48.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...無限ループに陥る可能性のあるバグが修正されました。
((<URL:http://www.debian.org/security/2004/dsa-586>))
* 一連の core dumps バグが修正されました。
((<URL:https://magazine.rubyist.net/articles/0002/0002-RubyCore.html>))
* tk の変更点は
((<URL:https:......てきた場合
例外を投げずに新しいセッションを作成するようになりました。
((<ruby-list:40368>))
=== 2004-12-09
: eval('Foo #@ bar'.inspect) [ruby] [bug]
シンタックスエラーにならないように修正しました。
((<ruby-core:03922>))
: String#ins......# #{}'.inspect"
"# \#{}"
: String#dump [ruby] [bug]
式展開にならない '#'がエスケープされないようになりました。
((<ruby-core:03922>))
$ ruby1.8.1 -e "puts '# #{}'.dump"
"\# \#{}"
$ ruby1.8.2 -e "puts '# #{}'.dump"
"# \#{}"
=== 2004-12-08
: rss/rs... -
NEWS for Ruby 2
. 1 . 0 (42.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...無視します。
* Kernel.#eval, Kernel.#instance_eval, Module#module_eval
元の環境のスコープ情報をコピーするようになりました。これは、引数なしの
private, protected, public, module_function を文字列として eval しても
その外側には影......響を与えないという意味です。
以下のコードは Foo#foo をプライベートにしません。
//emlist{
class Foo
eval "private"
def foo
end
end
//}
* Object#untrusted?,Object#untrust,Object#trust
* これらのメソッドは非推奨になり......* 追加: ObjectSpace.#allocation_generation
* 追加: ObjectSpace.#reachable_objects_from_root
* 追加: ObjectSpace.#dump
* 追加: ObjectSpace.#dump_all
* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や Bignum を引数として取れるようになりました。
* op... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (30.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への変更点(まとめ)/サポートプラットフォームの追加>))
...LocalJumpError#reason|LocalJumpError/reason>)) [new]
追加
=== Marshal
: ((<Marshal/Object#marshal_load>)) [new]
: ((<Marshal/Object#marshal_dump>)) [new]
追加 ((<ruby-dev:21016>))
=== MatchData
: ((<MatchData#captures|MatchData/captures>)) [new]
追加。((<RCR#139>))
: ((<MatchD......END__ は、スクリプトの終りとみなさなくな
りました。((<ruby-dev:17513>))
# p "
#__END__
#"
p eval(%Q(p "\n__END__\n"))
: ((<?<whitespace>|リテラル/数値リテラル>)) [parser] [change]
?スペース、?改行、?TAB 等はリテラル......- をエスケープなしで使用すると warning が出
るようになりました。((<ruby-dev:19868>))
== Marshal
: ((<Marshal/Marshal.dump>)) [marshal] [change]
4.7->4.8
: ((<Marshal>)) [marshal] [change]
無名モジュールを include したオブジェクトがダンプ... -
NEWS for Ruby 3
. 0 . 0 (30.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...sent and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates......ep(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
* ConditionVariable
* ConditionVariable#wait may now invoke the `bloc......ng#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each_char
* String#each_grapheme_cluster
* String#each_line
* String#gsub
* String#ljust
* String#lstr... -
ruby 1
. 9 feature (24.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...Mixin に分離し、RUNIT::TestCase では RUNIT::Assert でなく RUNIT::AssertMixin を使うようになりました
: constification
: core dump bug fix ((<ruby-dev:28327>)), ((<ruby-dev:28632>)), ((<ruby-core:07833>)), ((<ruby-dev:28614>)), ((<ruby-dev:28585>)), ((<ruby-dev:28582>)), ((<ru......=== 2006-03-03
: FileUtils.cp_r [lib] [compat]
remove_destination オプションの追加
((<ruby-dev:28417>))
=== 2006-02-15
: instance_eval
((<ruby-core:7365>))
=== 2006-02-03
: Integer#upto [compat]
: Integer#downto [compat]
: Integer#doitems [compat]
ブロックがなけ......ruby-dev:24255>))
=== 2004-08-27
: StringIO#readpartial(maxlen[, outbuf]) [lib][new]
追加。((<ruby-dev:24061>))
=== 2004-08-19
: Binding#eval(expr[, fname[, lineno=1]]) [new]
追加。((<RCR#251>))
: String#clear [new]
追加。((<ruby-dev:24104>))
=== 2004-08-17
: Process...