るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. matrix p
  5. kernel p

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Zlib::GzipWriter#print(*str) -> nil (27220.0)

引数を自身に順に出力します。引数を省略した場合は、$_ を出力します。

...す。

@param str 出力するオブジェクトを指定します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.print "ugo"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
p
uts gz.read...
...}
#=> ugo

@see IO#print, Kernel.#print...

Net::Telnet#print(string) -> () (24208.0)

ホストに文字列を送ります。

...プされます。
これらの変換はNet::Telnet#telnetmode, Net::Telnet#binmode,
およびホストから設定された telnet オプションによって(変換するしないなどが)
制御されます。

@param string ホストに送る文字列
@see Net::Telnet#write, Net::Telnet#puts...

Zlib::GzipWriter#printf(format, *args) -> nil (15207.0)

C 言語の printf と同じように、format に従い引数 を文字列に変換して、自身に出力します。

...C 言語の printf と同じように、format に従い引数
を文字列に変換して、自身に出力します。

@param format フォーマット文字列を指定します。print_format を参照してください。

@param args フォーマットされるオブジェクトを指定し...
...

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.printf("\n%9s", "bar")
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
p
uts gz.read
}
#=> bar

@see IO#printf, Kernel.#printf...

Zlib::GzipWriter#pos -> Integer (9107.0)

現在までに圧縮したデータの長さの合計を返します。 ファイルポインタの位置ではないことに注意して下さい。

...イルポインタの位置ではないことに注意して下さい。

require 'zlib'

filename='hoge1.gz'
f = File.open(filename, "w")
Zlib::GzipWriter.wrap(f, Zlib::BEST_COMPRESSION){|gz|
(1..10).each {|i|
gz.print i
p
uts gz.pos
}
}
#=> 1
#=> 2
#=> 3
......

Net::Telnet#puts(string) -> () (6119.0)

改行を付加した文字列をホストに送ります。

...改行を付加した文字列をホストに送ります。

改行の付加以外は Net::Telnet#print と同じです。

@param string ホストに送る文字列
@see Net::Telnet#write, Net::Telnet#print...

絞り込み条件を変える

IO#reopen(path) -> self (6113.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
p
ath で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パ...
...

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<...
...File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

IO#reopen(path, mode) -> self (6113.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
p
ath で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パ...
...

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<...
...File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

Net::SMTP#open_message_stream(from_addr, *to_addrs) {|f| .... } -> () (6113.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

...ームオブジェクトは以下のメソッドを持っています。
* puts(str = '') strを出力して CR LFを出力
* print(str) strを出力
* printf(fmt, *args) sprintf(fmt,*args) を出力
* write(str):: str を出力して書き込んだバイト数を返す
* <<(...
...

require 'net/smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail....
...'
}
}

ready は obsolete です。

@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複数可、少なくとも1個)

@raise IOError すでにセッションが終了している場合に発生します
@raise TimeoutError 接続がタイ...

IO#reopen(io) -> self (6103.0)

自身を指定された io に繋ぎ換えます。

...された io に繋ぎ換えます。

クラスも io に等しくなることに注意してください。
IO#pos, IO#lineno などは指定された io と等しくなります。

@param io 自身を繋ぎ換えたい IO オブジェクトを指定します。

@raise IOError 指定された io...

Zlib::GzipWriter#tell -> Integer (6007.0)

現在までに圧縮したデータの長さの合計を返します。 ファイルポインタの位置ではないことに注意して下さい。

...イルポインタの位置ではないことに注意して下さい。

require 'zlib'

filename='hoge1.gz'
f = File.open(filename, "w")
Zlib::GzipWriter.wrap(f, Zlib::BEST_COMPRESSION){|gz|
(1..10).each {|i|
gz.print i
p
uts gz.pos
}
}
#=> 1
#=> 2
#=> 3
......

絞り込み条件を変える

<< 1 2 > >>