クラス
- Exception (7)
-
Net
:: IMAP (33) -
Net
:: IMAP :: StatusData (11) - Thread (24)
モジュール
- Kernel (10)
キーワード
-
NEWS for Ruby 2
. 7 . 0 (5) - abort (10)
- attr (11)
-
net
/ imap (11) -
report
_ on _ exception (16) -
report
_ on _ exception= (8) -
rubygems
/ commands / lock _ command (11) - select (11)
- status (11)
検索結果
先頭5件
-
Net
:: IMAP :: RECENT -> Symbol (18217.0) -
「:Recent」というシンボルを返します。
...「:Recent」というシンボルを返します。
メッセージが「最近」メールボックスに到着したことを意味します。
フラグメッセージ属性として用いられます
(Net::IMAP::FetchData#attr)。
詳しくは 2060 を参照してください。... -
NEWS for Ruby 2
. 7 . 0 (348.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマ......=> [2, 3]
end
//}
//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}
//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}
//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"child......tionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz") {|v| }
end.parse!
//}
//emlist{
$ ruby test.rb --baa
Traceback (most recent call last):
test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)
D... -
Thread
. report _ on _ exception -> bool (118.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。... -
net
/ imap (114.0) -
このライブラリは Internet Message Access Protocol (IMAP) の クライアントライブラリです。2060 を元に 実装されています。
...xamine('INBOX')
imap.search(["RECENT"]).each do |message_id|
envelope = imap.fetch(message_id, "ENVELOPE")[0].attr["ENVELOPE"]
puts "#{envelope.from[0].name}: \t#{envelope.subject}"
end
2003年4月のメールをすべて Mail/sent-mail から "Mail/sent-apr03" へ移動させる
req......', 'joes_password')
imap.select('Mail/sent-mail')
if not imap.list('Mail/', 'sent-apr03')
imap.create('Mail/sent-apr03')
end
imap.search(["BEFORE", "30-Apr-2003", "SINCE", "1-Apr-2003"]).each do |message_id|
imap.copy(message_id, "Mail/sent-apr03")
imap.store(message_id, "+FLAGS"......、
require 'net/imap'
imap = Net::IMAP.new("imap.foo.net", "imap2")
imap.authenticate("cram-md5", "bar", "password")
imap.select("inbox")
fetch_thread = Thread.start { imap.fetch(1..-1, "UID") }
search_result = imap.search(["BODY", "hello"])
fetch_result = fetch_thread.value
imap.... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (112.0) -
例外の整形された文字列を返します。
...Traceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.... -
Net
:: IMAP # status(mailbox , attr) -> {String => Integer} (112.0) -
STATUS コマンドを送り、mailbox のステータスを得ます。
...するハッシュです。
詳しくは 2060 の 6.3.10 を参考にしてください。
例:
p imap.status("inbox", ["MESSAGES", "RECENT"])
#=> {"RECENT"=>0, "MESSAGES"=>44}
@param mailbox 問い合わせ対象のメールボックス(文字列)
@param attr 問合せたいアトリビュ... -
Kernel
. # abort -> () (106.0) -
Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
...#(標準出力)
#=> start
# start1...
# end1 with #<SystemExit: error1>
# start2...
# end2...
#終了ステータス:1
#(標準エラー出力)
#=> error1
# Traceback (most recent call last):
# sample.rb:11:in `<main>': RuntimeError (RuntimeError)
//}
@see Kernel.#exit,Kernel.#exit!... -
Kernel
. # abort(message) -> () (106.0) -
Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
...#(標準出力)
#=> start
# start1...
# end1 with #<SystemExit: error1>
# start2...
# end2...
#終了ステータス:1
#(標準エラー出力)
#=> error1
# Traceback (most recent call last):
# sample.rb:11:in `<main>': RuntimeError (RuntimeError)
//}
@see Kernel.#exit,Kernel.#exit!... -
Net
:: IMAP # select(mailbox) -> Net :: IMAP :: TaggedResponse (106.0) -
SELECT コマンドを送り、指定したメールボックスを処理対象の メールボックスにします。
...Net::IMAP#responses["EXISTS"].last
を調べると、メールボックス内のメールの数がわかります。
また、Net::IMAP#responses["RECENT"].lastで、
最新のメールの数がわかります。
これらの値はセッション中に変わりうることに注意してください... -
Net
:: IMAP :: StatusData # attr -> { String => Integer } (106.0) -
STATUS 応答の内容をハッシュで返します。
...STATUS 応答の内容をハッシュで返します。
ハッシュのキーは
"MESSAGES", "RECENT", "UIDNEXT", "UIDVALIDITY", "UNSEEN"
などが使われます。
詳しくは 2060 の 6.3.10、7.2.4 を見てください。... -
Thread
# report _ on _ exception -> bool (106.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...ption # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.sto... -
rubygems
/ commands / lock _ command (66.0) -
指定された特定のバージョンの Gem パッケージに依存する Gem を使用するために 必要な Kernel#gem メソッドの呼び出し方法を文字列で出力します。
...m lock GEMNAME-VERSION [GEMNAME-VERSION ...] [options]
Options:
-s, --[no-]strict 依存関係を満たせない場合に失敗します
Common Options:
-h, --help このコマンドのヘルプを表示します
-V, --[no-]verbose......表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バックトレースを表示します
--debug......rb is loaded *before* any
other require statements.
Notice that rails 1.0.0 only requires that rake 0.6.2 or better be used.
Rake-0.7.0.1 is the most recent version installed that satisfies that, so we
lock it down to the exact version.
Defaults:
--no-strict...