るりまサーチ

最速Rubyリファレンスマニュアル検索!
578件ヒット [101-200件を表示] (0.023秒)

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Net::IMAP#append(mailbox, message, flags = nil, date_time = nil) -> Net::IMAP::TaggedResponse (6112.0)

APPEND コマンドを送ってメッセージをメールボックスの末尾に追加します。

...APPEND コマンドを送ってメッセージをメールボックスの末尾に追加します。


例:
imap.append("inbox", <<EOF.gsub(/\n/, "\r\n"), [:Seen], Time.now)
Subject: hello
From: someone@example.com
To: somebody@example.com

hello world
EOF


@param mailbox メッセー...

Fiddle::Importer#sizeof(t) -> Integer (6106.0)

C における sizeof(t) の値を返します。

...C における sizeof(t) の値を返します。

t が文字列の場合、その文字列が表す C の型の size が返されます。
例えば、sizeof("char") は 1 を返します。
sizeof("char*") は環境によって 4 や 8 といった値を返します。

Fiddle::Importer#struct...
...ている型を Fiddle が知らなかった
場合に発生します

例:

require 'fiddle/import'

module M
extend Fiddle::Importer
Timeval = struct(["long tv_sec", "long tv_usec"])
p sizeof("char") # => 1
p sizeof("void*") # => 8
p sizeof(Timeval) # => 16
end
...

EOFError (6032.0)

EOF(End Of File)に達したときに発生します。

...EOF(End Of File)に達したときに発生します。...

制御構造 (448.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

Rubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を返すものが
あります(返さないものもありま...
...\n"
else
print "child fee\n"
end

gender = if foo.gender == "male" then "male" else "female" end
//}

文法:

if 式 [then]
式 ...
[elsif 式 [then]
式 ... ]
...
[else
式 ... ]
end


条件式を評価した結...
...response()
end
while res == 'Continue'
//}

while 修飾した式は nil を返します。
また、引数を伴った break により while 修飾した式の戻り値を
その値にすることもできます。

====[a:until] until

//emlist[例][ruby]{
until f.eof?
print f.gets
end

//}

...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (112.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定...
...x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end

break
end
while nil
//}

不正なバイトや変換先で未定義なバイトをエスケープしつつ変換する例です。以上のように...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (112.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定...
...x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end

break
end
while nil
//}

不正なバイトや変換先で未定義なバイトをエスケープしつつ変換する例です。以上のように...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (112.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定...
...x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end

break
end
while nil
//}

不正なバイトや変換先で未定義なバイトをエスケープしつつ変換する例です。以上のように...

ruby 1.8.4 feature (66.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...適合する文字列を厳密にした。((<ruby-core:03573>)),((<ruby-dev:27478>))

1) alias :"foo" :"bar"

def bar; p "bar"; end
alias :"foo" :"bar"
foo

# => ruby 1.8.4 (2005-12-22) [i686-linux]
-:2: syntax error, unexpecte...
..."$- "
2631438

# => ruby 1.8.4 (2005-12-22) [i686-linux]
-:2: syntax error, unexpected '(', expecting $end

#Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
#...
...05 Guy Decoux <ts@moulon.inra.fr>
#
# * re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
# [ruby-core:06721]

sizeof(long) > sizeof(int) な環境で、ハッシュ関数のオーバー
フローのためにStringをキーとしたHashの検索が失敗していたバ...

Readline.#readline(prompt = "", add_hist = false) -> String | nil (58.0)

prompt を出力し、ユーザからのキー入力を待ちます。 エンターキーの押下などでユーザが文字列を入力し終えると、 入力した文字列を返します。 このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。 何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、 ユーザからの入力がない場合は nil を返します。

...
このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。
何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、
ユーザからの入力がない場合は nil を返します。

本メソッドはスレッドに対...
...buf
end

rescue Interrupt
system("stty", stty_save)
exit
end


例: INTシグナルを捕捉して、端末状態を復帰する。

require 'readline'

stty_save = `stty -g`.chomp
trap("INT") { system "stty", stty_save; exit }

while buf = Readline.readline
p buf
end
...
...た、単に ^C を無視する方法もあります。

require 'readline'

trap("INT", "SIG_IGN")

while buf = Readline.readline
p buf
end


入力履歴 Readline::HISTORY を使用して、次のようなこともできます。

例: 空行や直前の入力と同じ内容は入力履...

TCPServer (48.0)

TCP/IP ストリーム型接続のサーバ側のソケットのクラスです。

...t)
print(s, " is accepted\n")
else
if s.eof?
print(s, " is gone\n")
s.close
socks.delete(s)
else
str = s.gets
s.write(str)
end

end

end

end


Thread を使えばもっと短くなります。

require...
...addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))

while true
Thread.start(gs.accept) do |s| # save to dynamic variable
print(s, " is accepted\n")
while s.gets
s.write($_)
end

print(s, " is gone\n")
s.close
end

end
...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>