85件ヒット
[1-85件を表示]
(0.011秒)
別のキーワード
ライブラリ
- ビルトイン (46)
- logger (1)
- openssl (24)
- thread (2)
-
webrick
/ httpauth / digestauth (12)
キーワード
- Application (1)
- BasicObject (12)
- Cipher (12)
- ConditionVariable (12)
- DigestAuth (12)
- Location (12)
- RSA (12)
- RegexpError (12)
検索結果
-
Thread
:: Backtrace :: Location (13.0) -
Ruby のフレームを表すクラスです。
...in `c'
//emlist[例2][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}
例2の実行結果:
init.rb:4:in `initialize'
init.rb:8:in `new'
init.rb:8:in... -
BasicObject (7.0)
-
特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。
...生すべきです。
真に必要な場合にだけ BasicObject から派生してください。
=== 例
//emlist[例][ruby]{
class Proxy < BasicObject
def initialize(target)
@target = target
end
def method_missing(message, *args)
@target.__send__(message, *args)
end
end
proxy... -
Logger
:: Application (7.0) -
ユーザ定義のアプリケーションにログ機能を簡単に追加することができます。
...ドを定義します。
(3) そのクラスをインスタンス化して start メソッドを呼び出します。
例:
class FooApp < Application
def initialize(foo_app, application_specific, arguments)
super('FooApp') # Name of the application.
end
def run
...... -
OpenSSL
:: Cipher (7.0) -
共通鍵暗号のために抽象化されたインターフェースを提供するクラスです。
...salt = OpenSSL::Random.random_bytes(8)
# 暗号化器を作成する
enc = OpenSSL::Cipher.new("AES-256-CBC")
enc.encrypt
# 鍵とIV(Initialize Vector)を PKCS#5 に従ってパスワードと salt から生成する
key_iv = OpenSSL::PKCS5.pbkdf2_hmac_sha1(pass, salt, 2000, enc.key_le... -
OpenSSL
:: PKey :: RSA (7.0) -
RSA 暗号鍵のクラスです。
...メソッドを利用するときは
RSA についてよく理解し、必要な場合のみにすべきです。
例:
require 'openssl'
# initialize random seed
OpenSSL::Random.seed(File.read("/dev/random", 16))
# 鍵対を生成
rsa = OpenSSL::PKey::RSA.generate(2048)
# 秘密鍵を... -
RegexpError (7.0)
-
正規表現のコンパイルに失敗したときに発生します。
...正規表現のコンパイルに失敗したときに発生します。
例:
$ ruby -e 'Regexp.compile("*")'
-e:1:in `initialize': target of repeat operator is not specified: /*/ (RegexpError)
from -e:1:in `Regexp#compile'
from -e:1... -
Thread
:: ConditionVariable (7.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...た場合、
あるいは満タンになった場合に Condition Variable を使って wait しています。
require 'thread'
class TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mutex.new
@q... -
WEBrick
:: HTTPAuth :: DigestAuth (7.0) -
HTTP の Digest 認証のためのクラスです。
...name', 'password'
htdigest.flush
config[:UserDB] = htdigest
digest_auth = WEBrick::HTTPAuth::DigestAuth.new config
サーブレットの initialize メソッドの中でこのクラスのインスタンスを作成
しないようにしてください。デフォルトでは WEBrick はリ...