るりまサーチ

最速Rubyリファレンスマニュアル検索!
121件ヒット [1-100件を表示] (0.015秒)

別のキーワード

  1. stringio read
  2. stringio sysread
  3. stringio readpartial
  4. stringio set_encoding
  5. stringio each

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

StringIO#puts(*obj) -> nil (35135.0)

obj と改行を順番に自身に出力します。引数がなければ改行のみを出力します。 詳しい仕様は Kernel.#puts を参照して下さい。

...は Kernel.#puts を参照して下さい。

@param obj 書き込みたいオブジェクトを指定します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.puts("hoge", "bar...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO (141.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...る文字列 name のリソースを取得して StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返します。...
...require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts
sio.read

OpenURI.open_uri('http://www.example.com'){|sio| sio.read }

options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progress_p...
...。Kernel.#open と同じです。

@param perm 無視されます。

@param options ハッシュを与えます。

@return 返り値である StringIO オブジェクトは OpenURI::Meta モジュールで extend されています。

@raise OpenURI::HTTPError 対象となる URI のスキーム...

Kernel.#open(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO | Tempfile | IO (129.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name...
...えた場合は上の場合と同様、name が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile オブジェクトを引数としてブロックを評価します。後は同様です。
引数のオブ...
...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts
sio.read
}

@see OpenURI.open_uri, URI.open...

NEWS for Ruby 2.0.0 (60.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...対パ スで返します。
* 追加: Kernel.#caller_locations フレーム情報の配列を返します
* 拡張: Kernel.#warn Kernel.#puts のように複数の引数を受け付けるようになりました
* 拡張: Kernel.#caller 第2引数で取得するスタックのサイズ...
...h_line に置き換える
//}

* IO#lines, IO#chars, IO#codepoints, IO#bytes, ARGF#lines, ARGF#chars,
ARGF#bytes, StringIO#lines, StringIO#chars, StringIO#codepoints, StringIO#bytes,
Zlib::GzipReader#lines, Zlib::GzipReader#bytes
* これらのメソッドは非推奨になりました...
...含まれる文字列でないオブジェクトは to_s で文字列化するようになりました

* stringio
* 非推奨: StringIO#lines, StringIO#bytes, StringIO#chars, StringIO#codepoints

* syslog
* 追加: Syslog::Logger Syslog上に Logger API を提供します
* 追加:...

ruby 1.8.3 feature (42.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...
禁止されるようになりました。

$ cat mthd_taint.rb
th = Thread.new{
$SAFE = 3
class Hoge
def foo
puts
"safe level: #{$SAFE}"
end
end
}
th.join
p $SAFE
Hoge.new.foo

$ ruby-1.8.2 mthd_taint.rb
0
"sa...
...((<ruby-talk:146776>)) ((<ruby-talk:146894>))
$ cat test_dlg.rb
foo = Object.new
foo2 = SimpleDelegator.new(foo)
def foo.bar
puts
"bar"
end
foo2.bar

$ ruby-1.8.2 -r delegate test_dlg.rb
test_dlg.rb:6: undefined method `bar' for #<Object:0x4021b0a0> (N...
...ーディングは要素の内部エンコーディングからoutput_encoding=で設定したエンコーディングへ変換されます。

: StringIO [lib] [compat]
close, close_read, close_write が ((<IO>)) と同じように、
nil を返すようになりました。((<ruby-dev:25623>))...

絞り込み条件を変える

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) {|sio| ... } -> nil (41.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...る文字列 name のリソースを取得して StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返します。...
...require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts
sio.read

OpenURI.open_uri('http://www.example.com'){|sio| sio.read }

options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progress_p...
...。Kernel.#open と同じです。

@param perm 無視されます。

@param options ハッシュを与えます。

@return 返り値である StringIO オブジェクトは OpenURI::Meta モジュールで extend されています。

@raise OpenURI::HTTPError 対象となる URI のスキーム...

ruby 1.8.2 feature (36.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...))
$ ruby1.8.1 -e "puts '# #{}'.inspect"
"# #{}"

$ ruby1.8.2 -e "puts '# #{}'.inspect"
"# \#{}"

: String#dump [ruby] [bug]
式展開にならない '#'がエスケープされないようになりました。
((<ruby-core:03922>))
$ ruby1.8.1 -e "puts '# #{}'.dump"
"\#...
...\#{}"

$ ruby1.8.2 -e "puts '# #{}'.dump"
"# \#{}"

=== 2004-12-08
: rss/rss [lib] [obsolete]
#item=/#set_item and so on are obsolete.

=== 2004-12-06
: Hash#hash [ruby] [new]

追加

((<ruby-talk:122482>))

Hash#hash は 2004-12-16 に削除されました。
((<ruby-dev:25206>...
...outf8(str)
: Kconv.toutf16(str)
: String#toutf8,
: String#toutf16
: String#iseuc
: String#issjis
: String#isutf8

=== 2004-11-18
: StringIO.new [lib] [compat]
StringIO
.newの第二引数にIO.newと同様、Fixnum も指定できるようになりました。
((<ruby-dev:24896>))

=== 2004-11-...

Kernel.#open(name, mode = &#39;r&#39;, perm = nil, options = {}) {|ouri| ...} -> object (29.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name...
...えた場合は上の場合と同様、name が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile オブジェクトを引数としてブロックを評価します。後は同様です。
引数のオブ...
...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts
sio.read
}

@see OpenURI.open_uri, URI.open...

NEWS for Ruby 3.0.0 (18.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone wh...
....3.0
* This version is Ractor compatible.
* Reline
* Update to Reline 0.1.5
* RubyGems
* Update to RubyGems 3.2.3
* StringIO
* Update to StringIO 3.0.0
* This version is Ractor compatible.
* StringScanner
* Update to StringScanner 3.0.0
* This version is Ractor co...

NEWS for Ruby 3.1.0 (18.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...92

* 1行のメソッド定義が括弧なしで書けるようになりました。例として def foo = puts "Hello" と記述できるようになりました。 private def foo = puts "Hello" はパースされないことに注意してください。 17398

== コマンドラインオプ...
...adline-ext 0.1.4
* reline 0.3.0
* resolv 0.2.1
* rinda 0.1.1
* ruby2_keywords 0.0.5
* securerandom 0.1.1
* set 1.0.2
* stringio 3.0.1
* strscan 3.0.1
* tempfile 0.1.2
* time 0.2.0
* timeout 0.2.0
* tmpdir 0.1.2
* un 0.2.0
* uri 0.11.0
* yam...

絞り込み条件を変える

Psych::Emitter (18.0)

Psych::Parser でパースし、生じたイベントから YAML ドキュメントを再構築するようなハンドラです。

...もできます。
各メソッドの意味については Psych::Handler を参照してください。
require 'psych'
require 'stringio'

output = StringIO.new
emitter = Psych::Emitter.new(output)

emitter.start_stream(Psych::Parser::UTF8)
emitter.start_document([1, 1], [], false)...
..."xyz", nil, nil, true, false, Psych::Nodes::Scalar::PLAIN)
emitter.scalar("23", nil, nil, false, true, Psych::Nodes::Scalar::SINGLE_QUOTED)
emitter.end_mapping
emitter.end_document(false)
emitter.end_stream

puts
output.string
# =>
# %YAML 1.1
# ---
# a: 12
# xyz: '23'
# ......
<< 1 2 > >>