るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.126秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:last_modified[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils cp_r
  5. fileutils rm_r

ライブラリ

クラス

モジュール

キーワード

検索結果

OpenURI::Meta#last_modified -> Time | nil (21229.0)

対象となる URI の最終更新時刻を Time オブジェクトで返します。 Last-Modified ヘッダがない場合は nil を返します。

...対象となる URI の最終更新時刻を Time オブジェクトで返します。
Last-Modified ヘッダがない場合は nil を返します。

例:
//emlist[例][ruby]{
r
equire 'open-uri'
open('http://www.rubyist.net/') {|f|
p f.last_modified
#=> Thu Feb 26 16:54:58 +0900 2004
}
//}...
...対象となる URI の最終更新時刻を Time オブジェクトで返します。
Last-Modified ヘッダがない場合は nil を返します。

例:
//emlist[例][ruby]{
r
equire 'open-uri'
URI.open('http://www.rubyist.net/') {|f|
p f.last_modified
#=> Thu Feb 26 16:54:58 +0900 2004
}
/...

open-uri (12102.0)

http/ftp に簡単にアクセスするためのクラスです。 Kernel.#open を再定義します。

...スです。
Kernel.#open を再定義します。

=== 使用例

http/ftp の URL を、普通のファイルのように開けます。

r
equire 'open-uri'
open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}

開いたファイルオブジェクトは StringIO もしく...
...が OpenURI::Meta モジュールで拡張されていて、メタ情報を獲得する
メソッドが使えます。

r
equire '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
}

ハッシュ引数で、追加のヘッダフィールドを指定できます。

r
equire 'open-uri'
open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VER...
...用例

http/ftp の URL を、普通のファイルのように開けます。

r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}

開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::Meta モジュール...
...が使えます。

r
equire '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_enc...
...p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
}

ハッシュ引数で、追加のヘッダフィールドを指定できます。

r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" =>...

Gem::RemoteFetcher#request(uri, request_class, last_modified = nil) -> Net::HTTPResponse (9507.0)

与えられた URI に対してリクエストを実行し、Net::HTTPResponse を返します。

...与えられた URI に対してリクエストを実行し、Net::HTTPResponse を返します。

@param uri URI を指定します。

@param request_class Net::HTTP::Head か Net::HTTP::Get を指定します。

@param last_modified 最終更新時刻を指定します。

@see Net::HTTP, Net:...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO (9356.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...URI である文字列 name のリソースを取得して StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返...
...

r
equire '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」はプログレスバーに
利用されることを想定...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) {|sio| ... } -> nil (9256.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...URI である文字列 name のリソースを取得して StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返...
...

r
equire '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」はプログレスバーに
利用されることを想定...

絞り込み条件を変える

Gem::RemoteFetcher#open_uri_or_path(uri, last_modified = nil, head = false, depth = 0) -> StringIO | File (6513.0)

@param uri URI を指定します。

...@param uri URI を指定します。

@param last_modified 最終更新時刻を指定します。

@param head 真を指定するとヘッダ情報のみ取得します。

@param depth 現在のリダイレクト回数を指定します。

@raise Gem::RemoteFetcher::FetchError デフォルトで...
...は 11 回リダイレクトした場合に発生します。
depth を指定すると 10 - depth 回より多くリダイレクトした場合にこの例外が発生するようになります。
また HTTP のレスポンスが想定外のものの場合にも発生します。...