種類
- インスタンスメソッド (17)
- 文書 (2)
- 特異メソッド (1)
- ライブラリ (1)
- クラス (1)
クラス
-
CSV
:: Table (2) - IO (2)
- Pathname (7)
- Thread (2)
-
Thread
:: Backtrace :: Location (2) -
Zlib
:: GzipWriter (2)
オブジェクト
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (1) - << (1)
- Location (1)
-
add
_ trace _ func (1) - binread (1)
- inspect (1)
- readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- rss (1)
-
ruby 1
. 6 feature (1) -
set
_ trace _ func (1) - syswrite (1)
-
to
_ csv (1) -
world
_ readable? (1) - write (2)
検索結果
先頭5件
-
Readline
:: HISTORY . to _ s -> "HISTORY" (63322.0) -
文字列"HISTORY"を返します。
文字列"HISTORY"を返します。
例:
require 'readline'
Readline::HISTORY.to_s #=> "HISTORY" -
Thread
:: Backtrace :: Location # to _ s -> String (63322.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][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.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo... -
Pathname
# read(*args) -> String | nil (54418.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
CSV
:: Table # to _ s(options = Hash . new) -> String (45322.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head... -
Pathname
# binread(*args) -> String | nil (18349.0) -
IO.binread(self.to_s, *args)と同じです。
IO.binread(self.to_s, *args)と同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(20, 10) # => ... -
Pathname
# readable? -> bool (18349.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (18349.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (18349.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# readlink -> Pathname (18349.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink -
Pathname
# world _ readable? -> bool (18349.0) -
FileTest.world_readable?(self.to_s) と同じです。
FileTest.world_readable?(self.to_s) と同じです。
@see FileTest.#world_readable? -
Thread
# set _ trace _ func(pr) -> Proc | nil (9073.0) -
スレッドにトレース用ハンドラを設定します。
スレッドにトレース用ハンドラを設定します。
nil を渡すとトレースを解除します。
設定したハンドラを返します。
//emlist[例][ruby]{
th = Thread.new do
class Trace
end
2.to_s
Thread.current.set_trace_func nil
3.to_s
end
th.set_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 2, nil, #<Binding:0x00007fc8de87cb08>, nil]
#... -
Thread
# add _ trace _ func(pr) -> Proc (9055.0) -
スレッドにトレース用ハンドラを追加します。
スレッドにトレース用ハンドラを追加します。
追加したハンドラを返します。
@param pr トレースハンドラ(Proc オブジェクト)
//emlist[例][ruby]{
th = Thread.new do
class Trace
end
43.to_s
end
th.add_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# => ["c-call", "example.rb", 4, ... -
Thread
:: Backtrace :: Location # inspect -> String (9049.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][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 ... -
Thread
:: Backtrace :: Location (9037.0) -
Ruby のフレームを表すクラスです。
Ruby のフレームを表すクラスです。
Kernel.#caller_locations から生成されます。
//emlist[例1][ruby]{
# caller_locations.rb
def a(skip)
caller_locations(skip)
end
def b(skip)
a(skip)
end
def c(skip)
b(skip)
end
c(0..2).map do |call|
puts call.to_s
end
//}
例1の実行結果:
caller_locations.rb:2:in `a'
caller_locations... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (289.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への変更点(まとめ)/サポートプラットフォームの追加>))
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への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>))... -
rss (127.0)
-
RSS を扱うためのライブラリです。
RSS を扱うためのライブラリです。
=== 参考
* RSS 0.91 http://backend.userland.com/rss091
* RSS 1.0 http://purl.org/rss/1.0/spec
* RSS 2.0 http://www.rssboard.org/rss-specification
* Atom 1.0 https://www.ietf.org/rfc/rfc4287.txt
=== 注意
RSS ParserはRSS 0.9x/1.0/2.0, Atom 1.0 をサポートしていますが,RSS 0.90
はサポートしてませ... -
ruby 1
. 6 feature (91.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-snapshot
: 2003-01-22: errno
EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていま... -
Zlib
:: GzipWriter # write(str) -> Integer (85.0) -
自身に str を出力します。str が文字列でなけ れば to_s による文字列化を試みます。
自身に str を出力します。str が文字列でなけ
れば to_s による文字列化を試みます。
@param str 出力する文字列を指定します。文字列でない場合は to_s で文字列に変換します。
@return 実際に出力できたバイト数を返します。
require 'zlib'
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.write "foo"
}
fr = File.open... -
IO
# syswrite(string) -> Integer (67.0) -
write(2) を用いて string を出力します。 string が文字列でなければ to_s による文字列化を試みます。 実際に出力できたバイト数を返します。
write(2) を用いて string を出力します。
string が文字列でなければ to_s による文字列化を試みます。
実際に出力できたバイト数を返します。
stdio を経由しないので他の出力メソッドと混用すると思わぬ動作
をすることがあります。
@param string 自身に書き込みたい文字列を指定します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]{
File.open("testfile", "w+") do |... -
IO
# write(str) -> Integer (67.0) -
IOポートに対して str を出力します。str が文字列でなけ れば to_s による文字列化を試みます。 実際に出力できたバイト数を返します。
IOポートに対して str を出力します。str が文字列でなけ
れば to_s による文字列化を試みます。
実際に出力できたバイト数を返します。
IO#syswrite を除く全ての出力メソッドは、最終的に
"write" という名のメソッドを呼び出すので、このメソッドを置き換える
ことで出力関数の挙動を変更することができます。
@param str 自身に書き込みたい文字列を指定します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]... -
Zlib
:: GzipWriter # <<(str) -> self (67.0) -
str を出力します。str が文字列でない場合は to_s を用いて 文字列に変換します。
str を出力します。str が文字列でない場合は to_s を用いて
文字列に変換します。
@param str 出力したいオブジェクトを与えます。
require 'zlib'
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz << "hoge" << "fuga"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
... -
CSV
:: Table # to _ csv(options = Hash . new) -> String (22.0) -
CSV の文字列に変換して返します。
CSV の文字列に変換して返します。
ヘッダを一行目に出力します。その後に残りのデータを出力します。
デフォルトでは、ヘッダを出力します。オプションに :write_headers =>
false を指定するとヘッダを出力しません。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.to_csv # => "a,b,c\n1,2,3\n"
p table.to_csv(write_head...