るりまサーチ

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

別のキーワード

  1. _builtin each_line
  2. io each_line
  3. tracer set_get_line_procs
  4. pathname each_line
  5. stringio each_line

種類

検索結果

open-uri (38048.0)

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

...義します。

=== 使用例

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

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

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

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/>
p f.content_t...
...ast_modified # Thu Dec 05 02:45:02 UTC 2002
}

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

require 'open-uri'
open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www...
...スです。

=== 使用例

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

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

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

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...
...ast_modified # Thu Dec 05 02:45:02 UTC 2002
}

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

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

NEWS for Ruby 3.0.0 (18.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* String#delete_suffix
* String#downcase
* String#dump
* String#each_char
* String#each_grapheme_cluster
* String#each_line
* String#gsub
* String#ljust
* String#lstrip
* String#partition
* String#reverse
* String#rjust
* Stri...
...tion. 16961
* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify Regexp.last_match. 17030
* Requiring 'open-uri' no longer redefines `Kernel#open`. Call `URI.open` directly or `use URI#open` instead. 15893
* SortedSet has been removed for dependency and p...
...v
* base64
* drb
* debug
* erb
* find
* net-ftp
* net-http
* net-imap
* net-protocol
* open-uri
* optparse
* pp
* prettyprint
* resolv-replace
* resolv
* rinda
* set
* securerandom
* she...