るりまサーチ

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

別のキーワード

  1. _builtin last
  2. regexp last_match
  3. fiddle last_error=
  4. range last
  5. fiddle last_error

ライブラリ

クラス

モジュール

キーワード

検索結果

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

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

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

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

open-uri (6102.0)

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

...#open を再定義します。

=== 使用例

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

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

開いたファイルオブジェクトは StringIO もしくは Tempfile で
...
...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/>
p f.content_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_encoding # []
p f.last_modified...
...加のヘッダフィールドを指定できます。

require 'open-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 などの環境変...
...ためのクラスです。

=== 使用例

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

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

開いたファイルオブジェクトは StringIO もしくは Tempfile で...
...en-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 # []
p f.last_modified...
...のヘッダフィールドを指定できます。

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 などの環境...

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

@param uri URI を指定します。

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

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

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

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

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

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

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

...てリクエストを実行し、Net::HTTPResponse を返します。

@param uri URI を指定します。

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

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

@see Net::HTTP, Net::HTTP::Head, Net::HTTP::Get...

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

URI である文字列 name のリソースを取得して 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 を与え...
...す。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定しています。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com',
{ :proxy => 'http://proxy.example.com:8000/',...
...ロックは対象となる URI の
Content-Length ヘッダの値を引数として、実際の転送が始まる前に評価されます。Redirect された場合は、
実際に転送されるリソースの HTTP ヘッダを利用します。Content-Length ヘッダがない場合は、nil...

絞り込み条件を変える

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

URI である文字列 name のリソースを取得して 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 を与え...
...す。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定しています。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com',
{ :proxy => 'http://proxy.example.com:8000/',...
...ロックは対象となる URI の
Content-Length ヘッダの値を引数として、実際の転送が始まる前に評価されます。Redirect された場合は、
実際に転送されるリソースの HTTP ヘッダを利用します。Content-Length ヘッダがない場合は、nil...