ライブラリ
- ビルトイン (44)
-
cgi
/ core (44) -
net
/ http (396) -
net
/ imap (132) - open-uri (104)
-
rdoc
/ markup (11) -
rdoc
/ markup / formatter (11) -
rexml
/ document (55) -
rexml
/ sax2listener (44) -
rexml
/ streamlistener (66) -
rubygems
/ package / tar _ output (11) -
webrick
/ httprequest (33) -
webrick
/ httpresponse (77) -
webrick
/ httpservlet / filehandler (11) -
webrick
/ httputils (22)
クラス
- CGI (22)
-
Encoding
:: Converter (33) -
Gem
:: Package :: TarOutput (11) - IO (11)
-
Net
:: HTTP (165) -
Net
:: HTTPGenericRequest (22) -
Net
:: IMAP :: BodyTypeBasic (33) -
Net
:: IMAP :: BodyTypeMessage (33) -
Net
:: IMAP :: BodyTypeMultipart (11) -
Net
:: IMAP :: BodyTypeText (33) -
Net
:: IMAP :: ContentDisposition (22) -
RDoc
:: Markup (11) -
RDoc
:: Markup :: Formatter (11) -
REXML
:: Instruction (44) -
WEBrick
:: HTTPRequest (33) -
WEBrick
:: HTTPResponse (77) -
WEBrick
:: HTTPServlet :: DefaultFileHandler (11) -
WEBrick
:: HTTPUtils :: FormData (11)
モジュール
-
CGI
:: QueryExtension (22) - Kernel (16)
-
Net
:: HTTPHeader (209) - OpenURI (22)
-
OpenURI
:: Meta (55) -
OpenURI
:: OpenRead (11) -
REXML
:: SAX2Listener (44) -
REXML
:: StreamListener (66)
キーワード
- == (11)
- FormData (11)
- Instruction (11)
-
MAX
_ MULTIPART _ LENGTH (11) - [] (22)
- []= (11)
-
add
_ gem _ contents (11) - attlistdecl (22)
- body= (11)
-
body
_ stream (11) -
body
_ stream= (11) - cdata (22)
- cgi (11)
- charset (22)
-
content
_ encoding (11) -
content
_ id (33) -
content
_ length (44) -
content
_ length= (22) -
content
_ range (11) -
content
_ type (55) -
content
_ type= (22) - convert (11)
- delete (11)
- description (33)
- disposition (11)
-
dsp
_ type (11) - elementdecl (22)
- encoding (33)
- entity (11)
- entitydecl (22)
- fetch (33)
-
form
_ data= (11) - get2 (22)
-
get
_ fields (11) - head (11)
- head2 (22)
- header (11)
- key? (11)
-
main
_ type (11) - new (44)
- notationdecl (11)
- open (16)
- open-uri (11)
-
open
_ uri (22) - param (11)
- post (22)
- post2 (22)
-
prepare
_ range (11) - query (11)
-
range
_ length (11) - read (11)
- readpartial (11)
-
request
_ get (22) -
request
_ head (22) -
request
_ post (22) - rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
rubygems
/ commands / contents _ command (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
sub
_ type (11) - target (11)
-
to
_ s (11) -
type
_ params (11) -
webrick
/ cgi (11) - 正規表現 (11)
検索結果
先頭5件
-
REXML
:: Instruction # content -> String | nil (21343.0) -
XML 処理命令の内容を返します。
...][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" hre......f=\"style.css\""
doc[4].target # => "foobar"
doc[4].content # => nil
//}... -
RDoc
:: Markup # content -> String (21301.0) -
変換する文字列を返します。
...
rdoc ライブラリのデバッグ用途に使用します。
SM::SimpleMarkup#convert の後に実行します。
変換のために加工したオブジェクトを改行で連結したものを返すため、変換前
の文字列と結果が異なる事があります。
@see SM::SimpleMark......up#convert... -
Net
:: HTTPHeader # content _ range -> Range|nil (12463.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...
Content-Range: ヘッダフィールドの値を Range で返します。
Range の表わす長さは Net::HTTPHeader#range_length で得られます。
ヘッダが設定されていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
open-uri (12108.0)
-
http/ftp に簡単にアクセスするためのクラスです。 Kernel.#open を再定義します。
...スです。
Kernel.#open を再定義します。
=== 使用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしく......が OpenURI::Meta モジュールで拡張されていて、メタ情報を獲得する
メソッドが使えます。
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>......arset # "iso-8859-1"
p f.content_encoding # []
p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
}
ハッシュ引数で、追加のヘッダフィールドを指定できます。
require 'open-uri'
open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VER......用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::Meta モジュール......ます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
p f.content_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_encoding # [......ールドを指定できます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www.ruby-lang.org/") {|f|
...
}
http_proxy, ftp_proxy, no_proxy などの環境変数は、... -
rubygems
/ commands / contents _ command (12066.0) -
インストールされている Gem パッケージに含まれているファイルリストを表示するためのライブラリです。
...em contents GEMNAME [options]
Options:
-v, --version VERSION 指定されたバージョンの Gem パッケージの内容を表示します
-s, --spec-dir a,b,c 指定されたパス以下にある Gem パッケージを検索します
-l, --[no-]lib-on......します
Common Options:
-h, --help このコマンドのヘルプを表示します
-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定され......用します
--backtrace バックトレースを表示します
--debug Ruby 自体のデバッグオプションを有効にします
Arguments:
GEMNAME Gem パッケージの名前を指定します
Summary:
イ... -
OpenURI
:: Meta # content _ type -> String (9431.0) -
対象となるリソースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。 Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
...ースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "......ースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.content_type #... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (9430.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実......IO オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から content_length バイトだけ読み込み...... Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content_length の値は無視され Content-Length ヘッダはレスポンスに含まれません。
@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。
req... -
OpenURI
:: Meta # content _ encoding -> [String] (9383.0) -
対象となるリソースの Content-Encoding を文字列の配列として返します。 Content-Encoding ヘッダがない場合は、空の配列を返します。
...となるリソースの Content-Encoding を文字列の配列として返します。
Content-Encoding ヘッダがない場合は、空の配列を返します。
例:
//emlist[例][ruby]{
require 'open-uri'
open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]
}
//}......るリソースの Content-Encoding を文字列の配列として返します。
Content-Encoding ヘッダがない場合は、空の配列を返します。
例:
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]
}
//}... -
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO (9380.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...URI である文字列 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
* :progres......s_proc
* :content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定... -
Net
:: HTTPHeader # content _ type -> String|nil (9375.0) -
"text/html" のような Content-Type を表す 文字列を返します。
... Content-Type を表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
re......q.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...