るりまサーチ

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

別のキーワード

  1. _builtin open
  2. socket open
  3. csv open
  4. tempfile open
  5. zlib open

検索結果

open-uri (38042.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 もしくは Te...
...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_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_encoding # []
p f.las...
...t_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.r...
...アクセスするためのクラスです。

=== 使用例

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

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

開いたファイルオブジェクトは StringIO もしく...
...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 # []
p f...
...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:/...

OpenURI::Meta#content_encoding -> [String] (14145.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::Meta#meta -> Hash (8012.0)

ヘッダを収録したハッシュを返します。

...][ruby]{
require 'open-uri'
open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=>"chunked"}
}
//}...
...][ruby]{
require 'open-uri'
URL.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=>"chunked"}
}
//...

NEWS for Ruby 3.0.0 (30.0)

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

...en keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.default_external to UTF-8 on Windows 16604
* Fiber
* Fiber.new(blocking: true/false) allows you to cr...
...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...

NEWS for Ruby 2.7.0 (24.0)

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

...NUL文字区切りのグロブパターンを受け付けなくなりました。
代わりにArrayを使ってください。 14643

* Encoding
* 新規エンコーディング
* CESU-8が追加されました。 15931

* Enumerable
* 新規メソッド
* Enumerable#...
...てください。

* IO
* 新規メソッド
* BOMをチェックして外部エンコーディングを設定する
IO#set_encoding_by_bomメソッドが追加されました。 15210

* Integer
* 変更されたメソッド
* Integer#[] がRangeを受け付ける...
...れました。 5180

* Net::IMAP
* Server Name Indication (SNI) のサポートが追加されました。 15594

* open-uri
* Kernelモジュールでopen-uriのopenメソッドを使うと警告されるようになりました。
代わりにURI.openを使ってください。...

絞り込み条件を変える

ruby 1.8.3 feature (24.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...ctx, session_id=nil)
session_id を受け付けるようになりました。((<ruby-core:4663>))

=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::Encoding#encode_sjis [lib] [bug]
decode_sjis と encode_sjis が
逆に定義されていたバグを修正しました。((<ruby...
...RB::Util.url_encode [lib] [compat]

モジュール関数としても使えるようになりました。((<ruby-dev:25687>))

=== 2005-02-12

: open-uri [lib] [new]
https をサポートするようになりました。

=== 2005-02-11

: URI::HTTP#proxy_open [lib][new]

(({:http_basic_authen...
...ディングを変換するメソッドを公開。

valueのエンコーディングは要素の内部エンコーディングからoutput_encoding=で設定したエンコーディングへ変換されます。

: StringIO [lib] [compat]
close, close_read, close_write が ((<IO>)) と同...

1.6.8から1.8.0への変更点(まとめ) (12.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...p Regexp.new(//is, Regexp::EXTENDED, "e")

=> ruby 1.6.8 (2003-08-03) [i586-linux]
//xe
=> -:1: warning: flags and encoding ignored
ruby 1.8.0 (2003-02-16) [i586-linux]
//is

=== String

: ((<String#chomp|String/chomp>)) [change]
: ((<Strin...
...イブラリが追加されました。

: ((<profiler>)) [lib] [new]

追加。((<profile>)) の実体として分離されました。

: ((<open-uri>)) [lib] [new]

追加

: ((<set>)) [lib] [new]

追加

: ((<"net/ftp">)) [new]

メソッド set_socket 追加

: ((<dl>)) [lib] [new]...