3388件ヒット
[3301-3388件を表示]
(0.124秒)
ライブラリ
モジュール
- Abbrev (12)
- Base64 (24)
- Benchmark (60)
- BigMath (96)
- CMath (78)
- Digest (12)
-
ERB
:: Util (48) - Etc (84)
- Fiddle (36)
- FileTest (174)
- FileUtils (391)
- Gem (24)
- JSON (156)
- Kconv (12)
- Kernel (996)
- Marshal (48)
- Math (252)
- ObjectSpace (228)
- Open3 (12)
-
OpenSSL
:: ASN1 (504) - Process (84)
- Readline (12)
- Signal (24)
- Timeout (21)
キーワード
- BMPString (24)
- BigDecimal (14)
- BitString (24)
- Boolean (12)
- Complex (14)
- E (12)
- Enumerated (24)
- Float (12)
- GeneralString (24)
- GeneralizedTime (24)
- GraphicString (24)
- IA5String (24)
- ISO64String (24)
- Integer (36)
- Null (12)
- NumericString (24)
- ObjectId (24)
- OctetString (24)
- PI (12)
- PrintableString (24)
- Rational (12)
- Sequence (12)
- Set (24)
- String (12)
- T61String (24)
- UTCTime (24)
- UTF8String (24)
- UniversalString (24)
- VideotexString (24)
-
_ _ method _ _ (12) -
_ id2ref (12) - ` (12)
- abbrev (12)
- abort (24)
- acos (12)
-
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) - argv0 (12)
- asin (12)
-
at
_ exit (12) - atan (24)
- atan2 (12)
- autoload (12)
- autoload? (12)
- benchmark (12)
-
block
_ given? (12) - bm (12)
- bmbm (12)
- caller (36)
-
caller
_ locations (24) - catch (24)
- cbrt (18)
- cbrt! (6)
- cd (24)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chomp (12)
- chop (12)
- chown (12)
-
chown
_ R (12) - cmp (12)
-
compare
_ file (12) - confstr (12)
- copy (12)
- cos (24)
- cos! (6)
-
count
_ nodes (12) -
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - cp (12)
-
cp
_ lr (7) -
cp
_ r (12) - decode (12)
-
define
_ finalizer (24) - dlunwrap (12)
- dlwrap (12)
- dump (36)
-
each
_ object (48) - empty? (9)
- encode64 (12)
- erf (12)
- erfc (12)
- eval (24)
- exec (48)
-
executable
_ real? (12) - exists? (9)
- exit (12)
- exit! (12)
- exp (30)
- exp! (6)
- fail (12)
-
fast
_ generate (12) -
fast
_ unparse (12) - fork (24)
- format (12)
- frexp (12)
- gamma (12)
-
garbage
_ collect (12) - generate (12)
- getlogin (12)
- gets (12)
- groups (12)
- grpowned? (12)
- gsub (36)
- h (12)
- hexencode (12)
-
html
_ escape (12) - hypot (12)
- identical? (24)
- install (12)
- isjis (12)
- iterator? (12)
- ldexp (12)
- lgamma (12)
- link (12)
- ln (12)
-
ln
_ s (12) - load (36)
-
load
_ file (12) -
load
_ file! (12) - log (48)
- log! (12)
- log10 (12)
- log2 (12)
- loop (24)
- makedirs (12)
- malloc (12)
- measure (12)
-
memsize
_ of (12) -
memsize
_ of _ all (12) - mkdir (12)
-
mkdir
_ p (12) - mkpath (12)
- move (12)
- mv (12)
- nprocessors (12)
- open (16)
- owned? (12)
- p (12)
- parse (12)
- parse! (12)
- pipeline (12)
- pp (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - print (12)
- printf (24)
- putc (12)
- puts (12)
- raise (12)
- rand (24)
-
reachable
_ objects _ from (12) - readable? (12)
- readline (24)
- readlines (12)
- realtime (12)
- remove (12)
-
remove
_ entry (12) - require (12)
-
require
_ relative (12) - restore (24)
- rm (12)
-
rm
_ r (12) - rmdir (12)
- ruby (12)
-
set
_ trace _ func (12) - setgid? (12)
- setproctitle (12)
- setuid? (12)
- sin (24)
- sin! (6)
- size? (12)
- sleep (24)
- socket? (12)
- spawn (48)
- sprintf (12)
- sqrt (30)
- sqrt! (6)
- srand (24)
- sticky? (12)
- sub (24)
- symlink (12)
- symlink? (12)
- syscall (12)
- sysconf (12)
- sysconfdir (12)
- system (48)
- systmpdir (12)
- tan (12)
- tan! (6)
- test (24)
- throw (12)
- timeout (21)
- touch (12)
-
trace
_ object _ allocations (12) -
trace
_ var (36) - trap (24)
- u (12)
- uname (12)
-
undefine
_ finalizer (12) - unparse (12)
-
untrace
_ var (12) - uptodate? (12)
-
url
_ encode (12) -
urlsafe
_ encode64 (12) - wait (12)
- wait2 (12)
- waitpid (12)
- waitpid2 (12)
- warn (4)
-
win
_ platform? (12) - writable? (12)
- zero? (12)
検索結果
先頭5件
-
Kernel
. # srand(seed) -> Integer (107.0) -
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
...します。
seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱います。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。
seed......を元に種を作ります。
@param seed 乱数の種となる整数を指定します。
Bignum も指定可能です。
//emlist[例][ruby]{
num = 455675
seeds = []
srand(num)
p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701
seeds <......) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251
seeds << srand(num)
p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701
seeds << srand
p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}
@see Kernel.#rand, Random::DEFAULT... -
Kernel
. # syscall(num , *arg) -> Integer (107.0) -
numで指定された番号のシステムコールを実行します。 第2引数以降をシステムコールの引数として渡します。
...syscall(2) が -1 を返した場合に発生します。
@raise NotImplementedError 実行環境がこのメソッドに対応していないとき発生します。
//emlist[例][ruby]{
syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box
# => hello
//}
@see fiddle, syscall(2freebsd), sysc... -
Marshal
. # dump(obj , limit = -1) -> String (107.0) -
obj を指定された出力先に再帰的に出力します。
...イルに書き出そうとすると
例外 TypeError が発生します。
ファイルに書き出せないオブジェクトは以下の通りです。
* 名前のついてない Class/Module オブジェクト。(この場
合は、例外 ArgumentError が発生します。無名クラス......持するもの。具体的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェ......。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定します。
@param port IO かその... -
Marshal
. # dump(obj , port , limit = -1) -> IO (107.0) -
obj を指定された出力先に再帰的に出力します。
...イルに書き出そうとすると
例外 TypeError が発生します。
ファイルに書き出せないオブジェクトは以下の通りです。
* 名前のついてない Class/Module オブジェクト。(この場
合は、例外 ArgumentError が発生します。無名クラス......持するもの。具体的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェ......。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定します。
@param port IO かその... -
Marshal
. # load(port , proc = nil) -> object (107.0) -
port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。
...port からマーシャルデータを読み込んで、元のオブジェクトと同
じ状態をもつオブジェクトを生成します。
proc として手続きオブジェクトが与えられた場合には読み込んだ
オブジェクトを引数にその手続きを呼び出します......。
//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})
# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000, 1.0, :foo]
# ["a", 1, 10000000000, 1.0, :foo]
//}
@param port String か IO (またはそのサブ......クラス)の
インスタンスを指定します。
@param proc 手続きオブジェクト。Proc
@raise TypeError メジャーバージョンが異なるか、バージョンの大きな
マーシャルデータを読み込んだ場合に発生します。... -
Open3
. # pipeline(*cmds) -> [Process :: Status] (107.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。
...それぞれのコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環......名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]
@return 実行した......require "open3"
fname = "/usr/share/man/man1/ruby.1.gz"
p Open3.pipeline(["zcat", fname], "nroff -man", "less")
#=> [#<Process::Status: pid 11817 exit 0>,
# #<Process::Status: pid 11820 exit 0>,
# #<Process::Status: pid 11828 exit 0>]
例2:
require "open3"
Open3.pipeline([... -
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (107.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...1Data のサブクラスのインスタンスとして返します。
複数の ASN.1 の値が含まれている場合、先頭の値だけを返します。
ASN.1 オブジェクトが Constructive である場合は、
それを構成する要素も再帰的に解析します。
例:
ruby -......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=nil,
@value=
[#<OpenSSL::ASN1::Sequence:0x814ead8
@tag=16,
@tag_class=:UNIVERSAL,
@taggi......nil,
@value=
[#<OpenSSL::ASN1::ASN1Data:0x814f690
@tag=0,
@tag_class=:CONTEXT_SPECIFIC,
@value=
[#<OpenSSL::ASN1::Integer:0x814f6a4
@tag=2,
@tag_class=:UNIVERSAL,
@tagging=nil,
@value=2>]>,... -
Kernel
. # block _ given? -> bool (19.0) -
メソッドにブロックが与えられていれば真を返します。
...返します。
iterator? は (ブロックが必ずイテレートするとはいえないので)推奨されていないの
で block_given? を使ってください。
//emlist[例][ruby]{
def check
if block_given?
puts "Block is given."
else
puts "Block isn't given."
end
end......check{} #=> Block is given.
check #=> Block isn't given.
//}...