るりまサーチ

最速Rubyリファレンスマニュアル検索!
143件ヒット [1-100件を表示] (0.012秒)
トップページ > クエリ:==[x] > 種類:モジュール関数[x]

別のキーワード

  1. _builtin ==
  2. openssl ==
  3. rexml/document ==
  4. matrix ==
  5. == _builtin

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

WEBrick::HTTPAuth.#basic_auth(req, res, realm) {|user, pass| ... } -> nil (13.0)

Basic 認証を行うためのメソッドです。

...ck::HTTPStatus::Unauthorized 認証に失敗した場合に発生します。

require 'webrick'
srv.mount_proc('/basic_auth') {|req, res|
HTTPAuth.basic_auth(req, res, "WEBrick's realm") {|user, pass|
user == 'webrick' && pass == 'supersecretpassword'
}
res.body = "hoge"
}...

Base64.#encode64(bin) -> String (7.0)

与えられたデータを Base64 エンコードした文字列を返します。

...字ごとに改行を追加します。

@param bin Base64 エンコードするデータを指定します。


require 'base64'
Base64.encode64("Now is the time for all good coders\nto learn Ruby")

# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...

Find.#find(*dirs) -> Enumerator (7.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...@param dirs 探索するディレクトリを一つ以上指定します。


例:

require 'find'

Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}

あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune を使用します。...

Find.#find(*dirs) {|file| ... } -> nil (7.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...@param dirs 探索するディレクトリを一つ以上指定します。


例:

require 'find'

Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}

あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune を使用します。...

Find.#find(*dirs, ignore_error: true) -> Enumerator (7.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...索中に発生した例外を無視するかどうかを指定します。

例:

require 'find'

Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}

あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune を使用します。こ...

絞り込み条件を変える

Find.#find(*dirs, ignore_error: true) {|file| ... } -> nil (7.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...索中に発生した例外を無視するかどうかを指定します。

例:

require 'find'

Find.find('/tmp') {|f|
Find.prune if f == "/tmp/bar"
...
}

あるディレクトリ配下の探索を省略したい場合は上記のように、
Find.#prune を使用します。こ...

Math.#acos(x) -> Float (7.0)

x の逆余弦関数(arccosine)の値をラジアンで返します。

...定した場合に発生します。

@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
Math.acos(0) == Math::PI/2 # => true
//}

@see Math.#cos...

Math.#asin(x) -> Float (7.0)

x の逆正弦関数(arcsine)の値をラジアンで返します。

...定した場合に発生します。

@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
Math.asin(1) == Math::PI/2 # => true
//}

@see Math.#sin...

ObjectSpace.#memsize_of_all(klass = nil) -> Integer (7.0)

すべての生存しているオブジェクトが消費しているメモリ使用量をバイト単位 で返します。

...

//emlist[例][ruby]{
def memsize_of_all klass = false
total = 0
ObjectSpace.each_object{|e|
total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass)
}
total
end
//}

戻り値の内容は完全ではない事に注意してください。この内容はあくまで...

Process.#getrlimit(resource) -> [Integer] (7.0)

カレントプロセスでのリソースの制限値を、整数の配列として返します。 返り値は、現在の制限値 cur_limit と、制限値として設定可能な最大値 max_limit の 配列 [cur_limit, max_limit] です。

...(バイト) (NetBSD, FreeBSD)

例:

include Process
p lim = getrlimit(RLIMIT_STACK) #=> [8388608, 18446744073709551615]
p lim.map{|i| i == RLIM_INFINITY ? "unlimited" : "#{i/(1024**2)}MB" } #=> ["8MB", "unlimited"]

@see Process.#setrlimit, getrlimit(2)...

絞り込み条件を変える

Process::GID.#switch -> Integer (7.0)

実効グループ ID を一時的に変更するために使います。

...mplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。

include Process
# (r, e, s) == (500, 505, 505)
p [gid, egid] #=> [500, 505]
Process::GID.switch do
p [gid, egid] #=> [500, 500]
end
p [gid, egid]...

Process::GID.#switch {...} -> object (7.0)

実効グループ ID を一時的に変更するために使います。

...mplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。

include Process
# (r, e, s) == (500, 505, 505)
p [gid, egid] #=> [500, 505]
Process::GID.switch do
p [gid, egid] #=> [500, 500]
end
p [gid, egid]...
<< 1 2 > >>