別のキーワード
ライブラリ
- ビルトイン (1863)
- abbrev (12)
- base64 (24)
- benchmark (60)
- bigdecimal (48)
-
bigdecimal
/ ludcmp (12) -
bigdecimal
/ math (72) - cmath (78)
- digest (12)
- erb (48)
- etc (84)
- fiddle (48)
- fileutils (391)
- json (156)
- kconv (12)
- objspace (108)
- open-uri (4)
- open3 (12)
- openssl (540)
- pp (4)
- readline (12)
- rubygems (24)
- timeout (21)
モジュール
- Abbrev (12)
- Base64 (24)
- Benchmark (60)
- BigMath (96)
- CMath (78)
- Digest (12)
-
ERB
:: Util (48) - Etc (84)
- Fiddle (48)
- FileTest (174)
- FileUtils (391)
- Gem (24)
- JSON (156)
- Kconv (12)
- Kernel (1193)
- LUSolve (12)
- Marshal (48)
- Math (252)
- ObjectSpace (228)
- Open3 (12)
-
OpenSSL
:: ASN1 (540) - Process (84)
- Readline (12)
- Signal (24)
- Timeout (21)
キーワード
- Array (12)
- BMPString (24)
- BigDecimal (24)
- BitString (24)
- Boolean (24)
- Complex (24)
- E (12)
- Enumerated (24)
- Float (12)
- GeneralString (24)
- GeneralizedTime (24)
- GraphicString (24)
- Hash (12)
- IA5String (24)
- ISO64String (24)
- Integer (36)
- Null (24)
- NumericString (24)
- ObjectId (24)
- OctetString (24)
- PI (12)
- PrintableString (24)
- Rational (12)
- Sequence (24)
- Set (24)
- String (12)
- T61String (24)
- UTCTime (24)
- UTF8String (24)
- UniversalString (24)
- VideotexString (24)
-
_ _ callee _ _ (12) -
_ _ 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)
- binding (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 (36)
-
fast
_ generate (12) -
fast
_ unparse (12) - fork (24)
- format (12)
- free (12)
- frexp (12)
- gamma (12)
-
garbage
_ collect (12) - generate (12)
- getlogin (12)
- gets (12)
-
global
_ variables (12) - groups (12)
- grpowned? (12)
- gsub (36)
- h (12)
- hexencode (12)
-
html
_ escape (12) - hypot (12)
- identical? (24)
- install (12)
- isjis (12)
- iterator? (12)
- lambda (18)
- ldexp (12)
- lgamma (12)
- link (12)
- ln (12)
-
ln
_ s (12) - load (36)
-
load
_ file (12) -
load
_ file! (12) -
local
_ variables (12) - log (48)
- log! (12)
- log10 (12)
- log2 (12)
- loop (24)
- lusolve (12)
- 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 (28)
- owned? (12)
- p (12)
- parse (12)
- parse! (12)
- pipeline (12)
- pp (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - print (12)
- printf (24)
- proc (19)
- putc (12)
- puts (12)
- raise (36)
- 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)
-
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 (12)
-
win
_ platform? (12) - writable? (12)
- zero? (12)
検索結果
先頭5件
-
Gem
. # ruby -> String (18118.0) -
実行中のRubyインタプリタのパスを返します。
...実行中のRubyインタプリタのパスを返します。... -
Kernel
. # format(format , *arg) -> String (199.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......B", "0", "0x", "0X" を付加します。
C 言語と同様引数が 0 の場合にはプレフィックスが付加されません。
//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x",... -
Kernel
. # sprintf(format , *arg) -> String (199.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。ただし、short や long などの C 特有の型......, %B)が存在すること、sprintf のすべての方言をサ
ポートしていないこと(%': 3桁区切り)などの違いがあります。
Ruby には整数の大きさに上限がないので、%b, %B, %o, %x, %X
に負の数を与えると (左側に無限に1が続くとみなせるの......B", "0", "0x", "0X" を付加します。
C 言語と同様引数が 0 の場合にはプレフィックスが付加されません。
//emlist[][ruby]{
p sprintf("%#b", 10) #=> "0b1010"
p sprintf("%#B", 10) #=> "0B1010"
p sprintf("%#b", 0) #=> "0"
p sprintf("%#o", 10) #=> "012"
p sprintf("%#x",... -
Kernel
. # spawn(env , program , *args , options={}) -> Integer (104.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...名文字列、Hash の値に設定する値とします。
nil とすることで環境変数が削除(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}
親プロセスは Process.#waitpid で子プロ......します。
//emlist[][ruby]{
# すべての環境変数をクリア
pid = spawn(command, :unsetenv_others=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}
「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しい......2つの配列、を渡すことができます。
それぞれ Process.#setrlimit の引数が2個、3個の場合に対応します。
//emlist[][ruby]{
# 現プロセスの core の resource limit を取得
cur, max = Process.getrlimit(:CORE)
# 一時的に子プロセスの core dump を止める... -
Kernel
. # spawn(program , *args) -> Integer (104.0) -
引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。
...名文字列、Hash の値に設定する値とします。
nil とすることで環境変数が削除(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}
親プロセスは Process.#waitpid で子プロ......します。
//emlist[][ruby]{
# すべての環境変数をクリア
pid = spawn(command, :unsetenv_others=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}
「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しい......2つの配列、を渡すことができます。
それぞれ Process.#setrlimit の引数が2個、3個の場合に対応します。
//emlist[][ruby]{
# 現プロセスの core の resource limit を取得
cur, max = Process.getrlimit(:CORE)
# 一時的に子プロセスの core dump を止める... -
Kernel
. # lambda -> Proc (73.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...ない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE......が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc... -
Kernel
. # lambda { . . . } -> Proc (73.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...ない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE......が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc... -
Kernel
. # proc -> Proc (73.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...ない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE......が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc... -
Kernel
. # proc { . . . } -> Proc (73.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...ない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE......が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc... -
FileUtils
. # cp _ lr(src , dest , noop: nil , verbose: nil , dereference _ root: true , remove _ destination: false) (49.0) -
src へのハードリンク dest を作成します。 src がディレクトリの場合、再帰的にリンクします。 dest がディレクトリの場合、src へのハードリンク dest/src を作成します。
...b" ライブラリを site_ruby にインストールする例][ruby]{
require 'fileutils'
FileUtils.rm_r site_ruby + '/mylib', force: true
FileUtils.cp_lr 'lib/', site_ruby + '/mylib'
//}
//emlist[様々なファイルを対象ディレクトリにリンクする例][ruby]{
require 'fileutils'
Fil......eUtils.cp_lr %w(mail.rb field.rb debug/), site_ruby + '/tmail'
FileUtils.cp_lr Dir.glob('*.rb'), '/home/aamine/lib/ruby', noop: true, verbose: true
//}
//emlist[内容をリンクする例][ruby]{
require 'fileutils'
# ディレクトリそのものではなく、ディレクトリの内容をリ... -
Kernel
. # lambda { . . . } -> Proc (49.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...nstead」
を出力します。
@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block
lambda(&block)
end
it = foo{p 12}
it.call #=> 12
//}
@see Proc,Proc.new
===[a:should_use_next] 手続きを中断して値を......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc......ブジェクトが呼び出しブロックとして振舞う際の制限です。
//emlist[問題なし][ruby]{
(1..5).each { break }
//}
//emlist[LocalJumpError が発生します。][ruby]{
pr = Proc.new { break }
(1..5).each(&pr)
//}
===[a:lambda_proc] lambda と proc と Proc.new とイテレ......nstead」
を出力します。
@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block
proc(&block)
end
it = foo{p 12}
it.call #=> 12
//}
@see Proc,Proc.new
===[a:should_use_next] 手続きを中断して値を... -
Kernel
. # proc { . . . } -> Proc (49.0) -
与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。
...nstead」
を出力します。
@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo &block
proc(&block)
end
it = foo{p 12}
it.call #=> 12
//}
@see Proc,Proc.new
===[a:should_use_next] 手続きを中断して値を......それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。
//emlist[例][ruby]{
def foo
f = Proc.new{
next 1
2 # この行に到達することはない
}
end
p foo().call #=> 1
//}
===[a:bloc......ブジェクトが呼び出しブロックとして振舞う際の制限です。
//emlist[問題なし][ruby]{
(1..5).each { break }
//}
//emlist[LocalJumpError が発生します。][ruby]{
pr = Proc.new { break }
(1..5).each(&pr)
//}
===[a:lambda_proc] lambda と proc と Proc.new とイテレ...