種類
- インスタンスメソッド (18)
- ライブラリ (3)
- 文書 (2)
- 特異メソッド (1)
ライブラリ
クラス
- Array (4)
-
Gem
:: GemPathSearcher (1) -
Net
:: HTTP (2) -
Net
:: IMAP (2) - Range (2)
-
Resolv
:: DNS (1) - String (1)
- StringScanner (1)
-
URI
:: HTTP (1)
モジュール
- Kernel (4)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (1) - bsearch (4)
-
bsearch
_ index (2) -
check
_ signedness (2) -
convertible
_ int (2) - find (1)
-
net
/ http (1) - new (1)
- post (2)
-
request
_ uri (1) - rss (1)
-
ruby 1
. 6 feature (1) -
search
_ full (1) -
tr
_ s! (1) - tsort (1)
-
uid
_ search (1)
検索結果
先頭5件
-
Net
:: IMAP # search(keys , charset = nil) -> [Integer] (54727.0) -
SEARCH コマンドを送り、条件に合うメッセージの message sequence number を配列で返します。
SEARCH コマンドを送り、条件に合うメッセージの message sequence number
を配列で返します。
Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを検索対象とします。
検索の条件は key に文字列の1次元配列もしくは文字列で渡します。
検索条件は "SUBJECT", "FROM" などを用いることができます。
詳しくは 2060 の 6.4.4 を見てください。
例:
p imap.search(["SUBJECT", "hello"])
#=> [1, 6, 7, 8]
p imap.s... -
Range
# bsearch {|obj| . . . } -> object | nil (18760.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二
分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を
返します。
本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結果を以下のようにする必要があります。
* 求める値がブロックパラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要... -
Array
# bsearch { |x| . . . } -> object | nil (18742.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探
索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し
ます。self はあらかじめソートしておく必要があります。
本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結果を以下のようにする必要があります。
* 求める値がブロックパラメータの値か前の要素の場合: true を返... -
Net
:: IMAP # uid _ search(keys , charset = nil) -> [Integer] (18727.0) -
UID SEARCH コマンドを送り、条件に合うメッセージの UID を配列で返します。
UID SEARCH コマンドを送り、条件に合うメッセージの UID
を配列で返します。
Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを検索対象とします。
検索の条件は key に文字列の1次元配列もしくは文字列で渡します。
検索条件は "SUBJECT", "FROM" などを用いることができます。
詳しくは 2060 の 6.4.4 を見てください。
例:
p imap.uid_search(["SUBJECT", "hello"])
#=> [1, 6, 7, 8]
p imap.uid_search([... -
Array
# bsearch _ index { |x| . . . } -> Integer | nil (18688.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を
二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil
を返します。self はあらかじめソートしておく必要があります。
本メソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要素自
身を返すか位置を返すかのみです。各モードのより詳細な違いについては
Array#bsearch を参照してください。
//emlist[例: find-minimum モード][ruby]{
ary = [0,... -
Range
# bsearch -> Enumerator (18460.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二
分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を
返します。
本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結果を以下のようにする必要があります。
* 求める値がブロックパラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要... -
StringScanner
# search _ full(regexp , s , f) -> object (18448.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
マッチに成功すると、s と f の値によって以下のように動作します。
* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポインタを進めません。
* f が true ならばスキャン開始位置からマッチした部分の末尾までの部分文字列を返します。
* f が false ならばスキャン開始位置からマッチした部分の末尾までの部分文字列の長さを返します。
マッチに失敗すると s や f に関係なく nil を返します。
このメソッドは s と ... -
Array
# bsearch -> Enumerator (18442.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探
索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し
ます。self はあらかじめソートしておく必要があります。
本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結果を以下のようにする必要があります。
* 求める値がブロックパラメータの値か前の要素の場合: true を返... -
Array
# bsearch _ index -> Enumerator (18388.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を
二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil
を返します。self はあらかじめソートしておく必要があります。
本メソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要素自
身を返すか位置を返すかのみです。各モードのより詳細な違いについては
Array#bsearch を参照してください。
//emlist[例: find-minimum モード][ruby]{
ary = [0,... -
Gem
:: GemPathSearcher # find(path) -> Gem :: Specification | nil (9304.0) -
与えられたパスにマッチする Gem::Specification を一つだけ返します。
与えられたパスにマッチする Gem::Specification を一つだけ返します。
@see Array#find -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (967.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (967.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
ruby 1
. 6 feature (811.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-snapshot
: 2003-01-22: errno
EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていま... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (667.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (667.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (661.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (661.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
rss (487.0)
-
RSS を扱うためのライブラリです。
RSS を扱うためのライブラリです。
=== 参考
* RSS 0.91 http://backend.userland.com/rss091
* RSS 1.0 http://purl.org/rss/1.0/spec
* RSS 2.0 http://www.rssboard.org/rss-specification
* Atom 1.0 https://www.ietf.org/rfc/rfc4287.txt
=== 注意
RSS ParserはRSS 0.9x/1.0/2.0, Atom 1.0 をサポートしていますが,RSS 0.90
はサポートしてませ... -
Resolv
:: DNS . new(resolv _ conf = nil) -> Resolv :: DNS (376.0) -
新しい DNS リゾルバを生成します。
新しい DNS リゾルバを生成します。
resolv_conf が nil の場合は
/etc/resolv.conf もしくはプラットフォーム固有の
DNS設定を利用します。
resolv_conf が文字列の場合は /etc/resolv.conf と
同じフォーマットのファイルを設定に利用します。
resolv_conf がハッシュの場合は、:nameserver, :search, :ndots
というキーが利用可能です。
それぞれの意味は resolv.conf(5) を参照してください。
また、:nameserver_portでアドレスとポートを指定できます。
//emlis... -
String
# tr _ s!(pattern , replace) -> self | nil (340.0) -
文字列の中に pattern 文字列に含まれる文字が存在したら、 replace 文字列の対応する文字に置き換えます。さらに、 置換した部分内に同一の文字の並びがあったらそれを 1 文字に圧縮します。
文字列の中に pattern 文字列に含まれる文字が存在したら、
replace 文字列の対応する文字に置き換えます。さらに、
置換した部分内に同一の文字の並びがあったらそれを 1 文字に圧縮します。
pattern の形式は tr(1) と同じです。
つまり「a-c」は a から c を意味し、
"^0-9" のように文字列の先頭が「^」の場合は指定した文字以外が置換の対象になります。
replace でも「-」を使って範囲を指定できます。
//emlist[][ruby]{
p "gooooogle".tr_s("a-z", "A-Z") # => "GOGLE"
//}
「... -
NEWS for Ruby 2
. 0 . 0 (91.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に似ています)
* デフォルトのソースエンコーディングを US-ASCI... -
tsort (91.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
=== Example
//emlist[][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]
{1=>[2], 2=>[3, 4... -
URI
:: HTTP # request _ uri -> String (85.0) -
自身の「path + '?' + query」を文字列で返します。 query が nil である場合は、自身の path を返します。
自身の「path + '?' + query」を文字列で返します。
query が nil である場合は、自身の path を返します。
path が空である場合には、path は「'/'」であるとします。
例:
require 'uri'
u = URI.parse("http://example.com/search?q=xxx")
p u.request_uri #=> "/search?q=xxx" -
net
/ http (55.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
汎用データ転送プロトコル HTTP を扱うライブラリです。
実装は 2616 に基きます。
=== 使用例
==== ウェブサーバからドキュメントを得る (GET)
//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://w...