ライブラリ
- ビルトイン (861)
-
bigdecimal
/ newton (12) - csv (108)
- date (12)
- dbm (12)
- digest (48)
- drb (12)
-
drb
/ acl (24) - fiddle (132)
- gdbm (12)
- ipaddr (12)
- json (24)
- logger (36)
-
net
/ http (48) - objspace (12)
- openssl (168)
- optparse (12)
- prime (60)
- psych (228)
-
rexml
/ document (36) -
rinda
/ rinda (24) -
rubygems
/ package / tar _ reader (12) - shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - socket (84)
- stringio (48)
- strscan (120)
- syslog (12)
- tempfile (24)
- thread (8)
-
webrick
/ httpresponse (24) - win32ole (240)
- zlib (108)
クラス
- ACL (24)
- Array (36)
- BasicObject (12)
- BasicSocket (12)
- CSV (48)
-
CSV
:: FieldInfo (24) -
CSV
:: Row (12) -
CSV
:: Table (24) - DBM (12)
-
DRb
:: DRbObject (12) - Data (3)
- Date (12)
-
Digest
:: Base (48) -
Encoding
:: Converter (48) - Enumerator (31)
-
Fiddle
:: Function (60) -
Fiddle
:: Handle (60) -
Fiddle
:: Pointer (12) - File (12)
-
File
:: Stat (180) - GDBM (12)
-
Gem
:: Package :: TarReader (12) - IO (24)
- IPAddr (12)
- Integer (24)
-
JSON
:: State (12) - Logger (36)
- Method (24)
- Module (12)
- Mutex (2)
-
Net
:: HTTP (24) - Numeric (12)
- Object (24)
-
OpenSSL
:: ASN1 :: Integer (24) -
OpenSSL
:: BN (48) -
OpenSSL
:: SSL :: SSLContext (12) -
OpenSSL
:: X509 :: Name (24) - OptionParser (12)
- Prime (24)
-
Prime
:: EratosthenesGenerator (24) -
Psych
:: Nodes :: Document (12) -
Psych
:: Nodes :: Mapping (48) -
Psych
:: Nodes :: Scalar (84) -
Psych
:: Nodes :: Sequence (48) -
Psych
:: Nodes :: Stream (36) -
REXML
:: Attributes (24) -
REXML
:: Elements (12) - Random (60)
- Regexp (36)
-
Rinda
:: SimpleRenewer (12) - Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) -
Socket
:: AncillaryData (60) - StringIO (48)
- StringScanner (120)
- Struct (72)
- SystemExit (12)
- TCPServer (12)
- Tempfile (24)
- Thread (55)
-
Thread
:: Mutex (10) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (12) - Time (12)
- TracePoint (12)
-
WEBrick
:: HTTPResponse (24) -
WIN32OLE
_ METHOD (84) -
WIN32OLE
_ TYPE (48) -
WIN32OLE
_ TYPELIB (36) -
WIN32OLE
_ VARIABLE (24) -
WIN32OLE
_ VARIANT (48)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Integer (12) - Kernel (48)
- Marshal (24)
-
Net
:: HTTPHeader (24) - Newton (12)
- ObjectSpace (60)
-
OpenSSL
:: ASN1 (36) -
Syslog
:: Facility (12) - Zlib (108)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (12)
- <=> (24)
-
ALLOW
_ DENY (12) - ANY (36)
- ASN1 (12)
-
BEST
_ COMPRESSION (12) -
BEST
_ SPEED (12) - BLOCK (24)
- Converters (12)
- DEFAULT (12)
-
DEFAULT
_ COMPRESSION (12) -
DEFAULT
_ OBJECT _ TYPE (12) -
DEFAULT
_ STRATEGY (12) -
DEF
_ MEM _ LEVEL (12) -
DENY
_ ALLOW (12) -
DOUBLE
_ QUOTED (12) - FILTERED (12)
- FLOW (24)
- FOLDED (12)
-
HUFFMAN
_ ONLY (12) - LITERAL (12)
-
LOG
_ NEWS (12) -
MAJOR
_ VERSION (12) -
MAX
_ MEM _ LEVEL (12) -
MINOR
_ VERSION (12) - Marshal フォーマット (12)
- NEWDB (24)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
NO
_ COMPRESSION (12) -
OBJECT
_ TYPE _ TEMPLATE (12) - PLAIN (12)
-
RTLD
_ GLOBAL (12) -
RTLD
_ LAZY (12) -
RTLD
_ NOW (12) - Rational (24)
- Ruby用語集 (12)
-
SINGLE
_ QUOTED (12) - STDCALL (12)
- Template (12)
- UTF16BE (12)
- UTF16LE (12)
- UTF8 (12)
- [] (54)
- []= (24)
-
_ _ drbref (12) -
_ _ id _ _ (12) - abi (12)
-
add
_ trace _ func (12) -
allocation
_ sourceline (12) - arity (12)
- blksize (12)
-
block
_ length (12) - blocks (12)
- call (12)
- charpos (12)
- ciphers (12)
- coerce (12)
- compile (12)
-
content
_ length (24) -
content
_ length= (12) - converters (12)
- decode (12)
-
dev
_ major (12) -
dev
_ minor (12) -
digest
_ length (12) - dispid (12)
-
each
_ object (48) - exist? (12)
- family (12)
-
field
_ size _ limit (12) - getbyte (24)
- gid (12)
- hash (15)
- helpcontext (24)
- index (24)
- ino (12)
- int (24)
- invkind (12)
- length (72)
- level (24)
- line (12)
- lineno (36)
-
major
_ version (24) - match? (12)
-
matched
_ size (12) - max (12)
-
max
_ nesting (12) -
minor
_ version (24) - mode (12)
-
new
_ seed (12) - next (12)
- nlink (12)
- nlsolve (12)
-
num
_ bits (12) -
num
_ waiting (12) -
offset
_ vtbl (12) -
ole
_ type _ detail (12) - pack (18)
- pointer (12)
- pos (12)
-
prime
_ division (36) -
primitive
_ convert (48) - priority (12)
- priority= (12)
-
proxy
_ port (12) - proxyport (12)
- ptr (12)
- rand (36)
-
range
_ length (12) - rdev (12)
-
rdev
_ major (12) -
rdev
_ minor (12) - readbyte (12)
- renew (12)
-
rest
_ size (12) - restsize (12)
-
return
_ vtype (12) - rewind (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
safe
_ level (7) - seed (12)
- send (12)
-
set
_ trace _ func (12) -
sev
_ threshold (12) -
singleton
_ class (12) - size (120)
- size? (12)
-
size
_ opt _ params (12) -
size
_ params (12) - skip (12)
-
skip
_ until (12) - sleep (36)
-
source
_ location (12) - start (12)
- status (12)
- style (36)
- succ (12)
- sum (18)
-
summary
_ width (12) - sym (12)
- sysaccept (12)
- test (18)
-
to
_ bn (12) -
to
_ i (12) -
to
_ int (12) -
to
_ json (12) - truncate (12)
- type (12)
- typekind (12)
- uid (12)
- utime (12)
-
values
_ at (12) - varkind (12)
- vartype (12)
- version (12)
- wday (12)
- write (12)
- セキュリティモデル (9)
- パターンマッチ (12)
- 制御構造 (12)
検索結果
先頭5件
- Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol - Kernel
. # Rational(x , y = 1) -> Rational - Kernel
. # Rational(x , y = 1 , exception: true) -> Rational | nil - Object
# singleton _ class -> Class
-
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (12.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ut => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byt......defined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_er... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (12.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ut => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byt......defined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_er... -
Kernel
. # Rational(x , y = 1) -> Rational (12.0) -
引数を有理数(Rational)に変換した結果を返します。
...で繋いだ形式
"1.2/3" のように、分子を実数にする事も可能ですが、分母には指定できませ
ん。また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。
//emlist[例][ruby]{
Rational("1/3") # =>......引数に変換できないオブジェクトを指定した場合には ArgumentError が
発生します。
//emlist[例][ruby]{
Rational(Object.new) # => ArgumentError
Rational("") # => ArgumentError
Rational(nil) # => ArgumentError
//}
また、Rational('0.3') と Rationa... -
Kernel
. # Rational(x , y = 1 , exception: true) -> Rational | nil (12.0) -
引数を有理数(Rational)に変換した結果を返します。
...で繋いだ形式
"1.2/3" のように、分子を実数にする事も可能ですが、分母には指定できませ
ん。また、Kernel.#Integer とは違い "0x10" のような進数を表す接頭
辞を含めた指定は行えません。
//emlist[例][ruby]{
Rational("1/3") # =>......引数に変換できないオブジェクトを指定した場合には ArgumentError が
発生します。
//emlist[例][ruby]{
Rational(Object.new) # => ArgumentError
Rational("") # => ArgumentError
Rational(nil) # => ArgumentError
//}
また、Rational('0.3') と Rationa... -
Object
# singleton _ class -> Class (12.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...なら、それぞれ NilClass, TrueClass,
FalseClass を返します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:String>
nil.sin... -
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (12.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...再帰的に解析します。
例:
ruby -e '
require "openssl"
require "pp"
pem = File.read(ARGV[0])
cert = OpenSSL::X509::Certificate.new(pem)
pp OpenSSL::ASN1.decode(cert.to_der)
' mycert.pem
#<OpenSSL::ASN1::Sequence:0x814e9fc
@tag=16,
@tag_class=:UNIVERSAL,
@tagging=n......=
[#<OpenSSL::ASN1::ASN1Data:0x814f690
@tag=0,
@tag_class=:CONTEXT_SPECIFIC,
@value=
[#<OpenSSL::ASN1::Integer:0x814f6a4
@tag=2,
@tag_class=:UNIVERSAL,
@tagging=nil,
@value=2>]>,
...
@param der D... -
セキュリティモデル (12.0)
-
セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。
...$SAFEの値は0
* 各スレッドは作られた時点での親スレッドの$SAFEの値を引き継ぐ
//emlist[][ruby]{
$SAFE = 0
th = Thread.new{
p $SAFE # => 0
$SAFE = 1
}
th.join
p $SAFE # => 0
//}
* $SAFE の値を現在の値より小さく変更する事はできない
//emlist{......指定して Kernel.#trap/Kernel.#trace_var を
実行するとその時点で例外 SecurityError が発生する。
* 実装の都合上 Integer, Float, Symbol, true,
false, nil は汚染されない。
=== 使用例
一旦高くした$SAFEレベルを低く変更する事はでき......$SAFEの値は0
* 各スレッド固有ではなくなったので必要に応じて ensure で戻す
//emlist{
$SAFE = 0
th = Thread.new do
p $SAFE # => 0
$SAFE = 1
ensure
$SAFE = 0
end
th.join
p $SAFE # => 0
//}
* $SAFE の値を現......指定して Kernel.#trap/Kernel.#trace_var を
実行するとその時点で例外 SecurityError が発生する。
* 実装の都合上 Integer, Float, Symbol, true,
false, nil は汚染されない。
=== 使用例
$SAFE はスレッドローカルからグローバルになり、... -
制御構造 (12.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...キーワードを通じてより強力なパターンマッチ構文を提供しています。
//emlist[][ruby]{
case {a: 1, b: 2, c: 3}
in a: Integer => m
"matched: #{m}"
else
"not matched"
end
# => "matched: 1"
//}
パターンマッチ構文についてはspec/pattern_matchingで説明......# 例外 RuntimeError を発生させる
# 以下の二つは SyntaxError を発生させる
raise SyntaxError, "invalid syntax"
raise SyntaxError.new("invalid syntax")
raise # 最後の例外の再発生
//}
文法:
raise
raise messageまたはexception... -
Regexp
. compile(string , option = nil) -> Regexp (7.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...す。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORE... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (7.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...す。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORE...