245件ヒット
[1-100件を表示]
(0.040秒)
別のキーワード
種類
- インスタンスメソッド (177)
- ライブラリ (36)
- モジュール (24)
- 文書 (8)
モジュール
-
Net
:: HTTPHeader (36) - TSort (93)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (8) - NKF (12)
- Observable (12)
-
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
net
/ http (12) -
net
/ imap (12) -
strongly
_ connected _ components (12) - tsort (24)
-
tsort
_ each (23)
検索結果
先頭5件
-
Net
:: HTTPHeader # fetch(key) -> String (18151.0) -
key ヘッダフィールドを返します。
...存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
resc......key , default を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http:/....../www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (18151.0) -
key ヘッダフィールドを返します。
...存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
resc......key , default を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http:/....../www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTPHeader # fetch(key , default) -> String (18151.0) -
key ヘッダフィールドを返します。
...存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
resc......key , default を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http:/....../www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
GDBM
# fetch(key , ifnone = nil) {|key| . . . } -> object (18143.0) -
データベースから対応するキーを探してその要素の値を返します。
...
require 'gdbm'
db1 = GDBM.open('aaa.gdbm', 0666, GDBM::NEWDB)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
p db1.fetch('a') #=> 'aaa'
p db1.fetch('z', 'zzz') #=> 'zzz'
p db1.fetch('z'){|key| [:key, key] } #=> [:key, 'z']
p db1.fetch(......'z', 'zzz'){|key| [:key, key] } #=> 'zzz'
p db1.fetch('z') #=> IndexError 発生
@see Hash#fetch... -
DBM
# fetch(key , ifnone = nil) -> String (18137.0) -
データベースからキーを探して対応する要素の値を返します。
...生します。
require 'dbm'
db1 = DBM.open('aaa.db', 0666, DBM::NEWDB)
db1[:a] = 'aaa'
db1[:b] = 'bbbbbb'
p db1.fetch('a') #=> 'aaa'
p db1.fetch('z', 'zzz') #=> 'zzz'
p db1.fetch('z'){|key| [:key, key] } #=> [:key, 'z']
p db1.fetch('z')......#=> IndexError 発生
@see Hash#fetch... -
SDBM
# fetch(key , ifnone = nil) {|key| . . . } -> object (18137.0) -
データベースから対応するキーを探してその要素の値を返します。
...場合に発生します。
require 'sdbm'
db1 = SDBM.open('aaa.gdbm', 0666)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
db1['c'] = 'ccc'
p db1.fetch('a') #=> "aaa"
p db1.fetch('z', 'zzz') #=> "zzz"
p db1.fetch('z'){|key| [:key, key] }......#=> [:key, "z"]
p db1.fetch('z', 'zzz'){|key| [:key, key] } #=> "zzz"
p db1.fetch('z') #=> IndexError 発生... -
PStore
# fetch(name , default = PStore :: Error) -> object (18131.0) -
ルートnameに対応する値を得ます。
...ます。
例:
require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots # => []
ary = db["root"] = [1,2,3,4]
ary[0] = [1,1.5]
end
db.transaction(true) do |pstore|
pstore.fetch("root") # => [[1, 1.5], 2, 3, 4]
pstore.fetch("root", 'aaa'......) # => [[1, 1.5], 2, 3, 4]
pstore.fetch("not_root") # => 例外発生
end
@see Hash#fetch, PStore#[]... -
net
/ http (96.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...by]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'u......]{
require 'net/http'
url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
puts res.body
//}
==== フォームの情報を送信する (POST)
//emlist[例][ruby]{
require 'net/http'
require......==== リダイレクトに対応する
以下の例の fetch はリダイレクトに対応しています。
limit 回数以上リダイレクトしたらエラーにします。
//emlist[例][ruby]{
require 'net/http'
require 'uri'
def fetch(uri_str, limit = 10)
# You should choose better exc... -
net
/ imap (54.0) -
このライブラリは Internet Message Access Protocol (IMAP) の クライアントライブラリです。2060 を元に 実装されています。
...とサブジェクトを表示する。
require 'net/imap'
imap = Net::IMAP.new('mail.example.com')
imap.authenticate('LOGIN', 'joe_user', 'joes_password')
imap.examine('INBOX')
imap.search(["RECENT"]).each do |message_id|
envelope = imap.fetch(message_id, "ENVELOPE")[0].attr["ENVELOP......elope.from[0].name}: \t#{envelope.subject}"
end
2003年4月のメールをすべて Mail/sent-mail から "Mail/sent-apr03" へ移動させる
require 'net/imap'
imap = Net::IMAP.new('mail.example.com')
imap.authenticate('LOGIN', 'joe_user', 'joes_password')
imap.select('Mail/sent-mail'......として、
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.valu...