ライブラリ
- ビルトイン (117)
- date (11)
- delegate (11)
-
drb
/ timeridconv (11) - fiddle (22)
- ipaddr (11)
- logger (1)
- monitor (22)
- openssl (33)
- optparse (11)
- prettyprint (11)
- psych (33)
- rexml (11)
-
rexml
/ document (55) -
rinda
/ rinda (22) -
rinda
/ tuplespace (11) -
ripper
/ filter (11) - rss (44)
-
rubygems
/ version (11) - stringio (11)
- strscan (11)
- thread (4)
- timeout (11)
-
webrick
/ httpauth / basicauth (11) -
webrick
/ httpauth / digestauth (11) -
webrick
/ httpauth / htdigest (11) -
webrick
/ httpauth / htpasswd (11) -
webrick
/ httpproxy (11) -
webrick
/ httpserver (11) -
webrick
/ httpservlet / abstract (11) -
webrick
/ server (22) - win32ole (88)
- zlib (22)
キーワード
- AbstractServlet (11)
- Application (1)
- BasicAuth (11)
- BasicObject (11)
- BlockCaller (11)
- CategoryBase (11)
- Cipher (11)
- Closure (11)
- ConditionVariable (22)
- Cookie (11)
- Daemon (11)
- DateTime (11)
- DayBase (11)
- Digest (11)
- DigestAuth (11)
- Emitter (11)
- Entity (11)
- Error (11)
- ExtensionFactory (11)
- ExternalEntity (11)
- Fiber (11)
- Filter (11)
- GzipReader (11)
- GzipWriter (11)
- HTTPProxyServer (11)
- HTTPServer (11)
- HourBase (11)
- Htdigest (11)
- Htpasswd (11)
- IPAddr (11)
- Instruction (11)
- ItemBase (11)
- Location (11)
- Monitor (11)
- NotationDecl (11)
- OptionParser (11)
- ParseException (11)
- PrettyPrint (11)
- Range (11)
- Rational (11)
- SimpleDelegator (11)
- SimpleRenewer (11)
- SimpleServer (11)
- SizedQueue (11)
- Stat (11)
- StringIO (11)
- StringScanner (11)
- Template (11)
- TimerIdConv (11)
- TracePoint (11)
- Transitive (11)
- TreeBuilder (11)
- TupleSpace (11)
- UndefinedConversionError (11)
- Version (11)
- WIN32OLE (11)
-
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ METHOD (11) -
WIN32OLE
_ PARAM (11) -
WIN32OLE
_ TYPE (11) -
WIN32OLE
_ TYPELIB (11) -
WIN32OLE
_ VARIABLE (11) -
WIN32OLE
_ VARIANT (11) - YAMLTree (11)
- Yielder (11)
検索結果
先頭5件
-
IPAddr (32013.0)
-
IP アドレスを扱うのためのクラスです。
...IP アドレスを扱うのためのクラスです。
例:
require 'ipaddr'
ipaddr1 = IPAddr.new("3ffe:505:2::1")
p ipaddr1 # => #<IPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0001/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>
ipaddr3 = IPAddr.new("192.168.2.0/24")
p ipaddr3 # =......> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
=== 参照
* 3513... -
MonitorMixin
:: ConditionVariable (18033.0) -
MonitorMixin と Monitor のための 条件変数クラスです。 MonitorMixin#new_cond が返します。ユーザが MonitorMixin::ConditionVariable.new を直接呼ぶことはありません。
...MonitorMixin と Monitor のための
条件変数クラスです。
MonitorMixin#new_cond が返します。ユーザが
MonitorMixin::ConditionVariable.new を直接呼ぶことはありません。... -
WEBrick
:: HTTPAuth :: BasicAuth (18019.0) -
HTTP の Basic 認証のためのクラスです。
...HTTP の Basic 認証のためのクラスです。
例
require 'webrick'
realm = "WEBrick's realm"
srv = WEBrick::HTTPServer.new({ :BindAddress => '127.0.0.1', :Port => 10080})
htpd = WEBrick::HTTPAuth::Htpasswd.new('dot.htpasswd')
htpd.set_passwd(nil, 'username', 'supersecre......tpass')
authenticator = WEBrick::HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
srv.mount_proc('/basic_auth') {|req, res|
authenticator.authenticate(req, res)
res.body = "hoge"
}
srv.start # http://127.0.0.1:10080/basic_auth... -
RSS
:: Maker :: ItemsBase :: ItemBase (18017.0) -
itemはmaker.items.new_itemで作成されたオブジェク トとします.
...itemはmaker.items.new_itemで作成されたオブジェク
トとします.
RSS 1.0/0.91の場合はtitle,linkを設定する必要があ
ります.
RSS 2.0の場合はtitleまたはdescriptionを設定する
必要があります.... -
Encoding
:: UndefinedConversionError (18007.0) -
エンコーディング変換後の文字が存在しない場合に発生する例外。
...。
UTF-8 にしかない文字を EUC-JP に変換しようとした場合などに発生します。
//emlist[例][ruby]{
"\u2603".encode(Encoding::EUC_JP)
#=> Encoding::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}
変換が多段階でなされ、その途中で例外が生じた......//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
# ISO-8859-1 -> UTF-8 -> EUC-JP
begin
ec.convert("\xa0")
# NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP.
rescue Encoding::UndefinedConversionError
p $!.source_encoding #=> #<Encoding:UTF-8......>
p $!.destination_encoding #=> #<Encoding:EUC-JP>
p $!.source_encoding_name #=> "UTF-8"
p $!.destination_encoding_name #=> "EUC-JP"
puts $!.error_char.dump #=> "\u{a0}"
p $!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}... -
Rinda
:: SimpleRenewer (18001.0) -
シンプルな renewer で renewer のサンプル実装です。
...ルな renewer で renewer のサンプル実装です。
Rinda::TupleSpace が保持するタプルの有効期限を更新するクラスです。
このクラスはタプルの寿命をプロセスの寿命と一致させることができます。
詳しくは Rinda::TupleSpace#renewer を見... -
Fiber (12061.0)
-
ノンプリエンプティブな軽量スレッド(以下ファイバーと呼ぶ)を提供します。 他の言語では coroutine あるいは semicoroutine と呼ばれることもあります。 Thread と違いユーザレベルスレッドとして実装されています。
...ノンプリエンプティブな軽量スレッド(以下ファイバーと呼ぶ)を提供します。
他の言語では coroutine あるいは semicoroutine と呼ばれることもあります。
Thread と違いユーザレベルスレッドとして実装されています。
Thread クラ......係を持ちます。Fiber#resume を呼んだファイバーが親になり
呼ばれたファイバーが子になります。親子関係を壊すような遷移(例えば
自分の親の親のファイバーへ切り替えるような処理)はできません。
例外 FiberError が発生しま......す。
できることは
* Fiber#resume により子へコンテキストを切り替える
* Fiber.yield により親へコンテキストを切り替える
の二通りです。この親子関係は一時的なものであり
親ファイバーへコンテキストを切り替えた時点で解... -
Thread
:: ConditionVariable (12049.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...一つである状態変数を実現するクラスです。
以下も ConditionVariable を理解するのに参考になります。
https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF
=== Condition Variable とは
あるスレッド A が排他領域で動いていたとしま......状況を解決するのが Condition Variable です。
スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止めます。他のスレッド b において条件が満たされたなら signal
メソッドでスレッド a......mutex = Mutex.new
cv = ConditionVariable.new
a = Thread.start {
mutex.synchronize {
...
while (条件が満たされない)
cv.wait(mutex)
end
...
}
}
b = Thread.start {
mutex.synchronize {
#... -
OpenSSL
:: Cipher (12031.0) -
共通鍵暗号のために抽象化されたインターフェースを提供するクラスです。
...暗号アルゴリズムを指定するため
OpenSSL::Cipher.new で暗号オブジェクトを生成することだけでしょう。
もし、このクラスを直接利用して暗号化する場合は、暗号の鍵や
IV(Initialization Vector)の取り扱いについて正しく理解して......* OpenSSL::Cipher.new や OpenSSL::Cipher::AES256.new
などで暗号オブジェクトを生成する
* OpenSSL::Cipher#encrypt, OpenSSL::Cipher#decrypt で
暗号、復号のいずれをするかを設定する
* OpenSSL::Cipher#key=, OpenSSL::Cipher#iv=,
OpenSSL::Cipher#random_......key, OpenSSL::Cipher#random_iv などで
鍵と IV(initialization vector) を設定する
* OpenSSL::Cipher#update, OpenSSL::Cipher#final で
暗号化/復号化をする
ruby 1.8.3 から Cast5 と Idea が CAST5 と IDEA に改名されました。
=== ブロック暗号モード
AES... -
StringScanner (12031.0)
-
StringScanner は文字列スキャナクラスです。 簡単に高速なスキャナを記述できます。
...StringScanner は文字列スキャナクラスです。
簡単に高速なスキャナを記述できます。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('This is an example string')
s.eos? #=> false
p s.scan(/\w+/) #=> "This"
p s.scan(/\w+/) #=> nil
p s.scan(/\s......+/) #=> nil
p s.scan(/\w+/) #=> "is"
s.eos? #=> false
p s.scan(/\s+/) #=> " "
p s.scan(/\w+/) #=> "an"
p s.scan(/\s+/) #=> " "
p s.scan(/\w+/) #=> "example"
p s.scan(/\s+/) #=> " "
p s.scan(/\w+/) #=> "string"
s.eos? #=> true
p s.scan(/\s+/) #=> nil
p s.scan......(/\w+/) #=> nil
//}
StringScanner オブジェクトはスキャンする文字列と「スキャンポインタ」のセットです。
スキャンポインタとはスキャンしおわったところを示すインデックスのことです。
オブジェクト作成直後にはスキャン...