1122件ヒット
[201-300件を表示]
(0.161秒)
別のキーワード
ライブラリ
モジュール
キーワード
- E (12)
- GraphicString (24)
- Hash (12)
- PI (12)
-
_ _ method _ _ (12) - abbrev (12)
- acos (12)
- asin (12)
- atan (24)
- atan2 (12)
- benchmark (12)
- bm (12)
- bmbm (12)
- caller (12)
-
caller
_ locations (24) - catch (24)
- cbrt (18)
- cbrt! (6)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chomp (12)
- chop (12)
- chown (12)
-
chown
_ R (12) - cos (24)
- cos! (6)
-
count
_ nodes (12) -
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - dump (24)
-
each
_ object (48) - erf (12)
- erfc (12)
- exp (30)
- exp! (6)
- format (12)
- frexp (12)
- gamma (12)
- generate (12)
- gsub (12)
- hexencode (12)
-
html
_ escape (12) - hypot (12)
- ldexp (12)
- lgamma (12)
- load (12)
- log (48)
- log! (12)
- log10 (12)
- log2 (12)
- measure (12)
- mkpath (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - putc (12)
-
reachable
_ objects _ from (12) - readline (12)
- realtime (12)
-
remove
_ entry (12) - restore (12)
- sin (24)
- sin! (6)
- sprintf (12)
- sqrt (30)
- sqrt! (6)
- sub (12)
- syscall (12)
- tan (12)
- tan! (6)
- throw (12)
- touch (12)
-
trace
_ var (24) - unparse (12)
-
untrace
_ var (12) - uptodate? (12)
検索結果
先頭5件
-
FileUtils
. # chmod _ R(mode , list , options = {}) -> Array (6107.0) -
ファイル list のパーミッションを再帰的に mode へ変更します。
...変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します(FileUtils.#chmod 参照)。
@param list ファイルのリストを指定します。対象のファイルが一つの場合は文字列でも指定可能です。......二つ以上指定する場合は配列で指定します。
@param options :noop と :verbose が指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chmod_R(0700, '/tmp/removing')
//}... -
FileUtils
. # touch(list , options = {}) -> () (6107.0) -
list で指定されたファイルの最終変更時刻 (mtime) と アクセス時刻 (atime) を変更します。
...場合は配列で指定します。
@param options :mtime, :nocreate, :noop, :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.touch('timestamp')
FileUtils.touch('timestamp', mtime: Time.now)
FileUtils.touch(Dir.glob('*.c'))
//}... -
Kernel
. # _ _ method _ _ -> Symbol | nil (6107.0) -
現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。
...ソッド名を返します。
メソッドの外で呼ばれると nil を返します。
//emlist[例][ruby]{
def foo
p __method__
end
alias :bar :foo
foo #=> :foo
bar #=> :foo
p __method__ #=> nil
//}
現在のメソッド名が alias されたメソッドの場合でも alias 元のメソッ... -
Kernel
. # catch {|tag| . . . . } -> object (6107.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Kernel
. # catch(tag) {|tag| . . . . } -> object (6107.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Kernel
. # chop -> String (6107.0) -
$_.chop とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...$_.chop とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。
コマンドラインオプションで -p または -n を指定した時のみ定義されます。
暗号的になりすぎるきらいがあるため、このメソッド......な $_.chop を使ってください。
$_.chopとこのメソッド chop は以下の点で違いがあります。
* chop は $_ の値をコピーして、コピーの方を更新し、
$_ に再代入します。
//emlist[例][ruby]{
$_ = "test\r\n"
$_ # => "test\r\n"
chop......# => "test"
$_ = "test\n"
$_ # => "test\n"
chop # => "test"
$_ = "test"
$_ # => "test"
chop # => "tes"
//}
@see String#chop,$_... -
Kernel
. # throw(tag , value = nil) -> () (6107.0) -
Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。
...Kernel.#catchとの組み合わせで大域脱出を行います。 throw
は同じ tag を指定した catch のブロックの終わりまでジャンプします。
throw は探索時に呼び出しスタックをさかのぼるので、
ジャンプ先は同じメソッド内にあるとは限......待っている catch が存在しない場合は、例外で
スレッドが終了します。
同じ tag であるとは Object#object_id が同じであるという意味です。
@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch の戻り値にな......いる catch が存在しない場合に発生します。
//emlist[例][ruby]{
def foo
throw :exit, 25
end
ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"
end
end
puts ret
#=> ensure
# 25
//}
@see Kernel.#catch......ります。
@raise UncaughtThrowError 同じ tag で待っている catch が存在しない場合に発生します。
//emlist[例][ruby]{
def foo
throw :exit, 25
end
ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"... -
Math
. # hypot(x , y) -> Float (6107.0) -
sqrt(x*x + y*y) を返します。
...hypotenuse)の長さです。
@param x 実数
@param y 実数
@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。
@raise RangeError 引数のどちらかに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.hypo... -
Benchmark
. # bm(label _ width = 0 , *labels) {|rep| . . . } -> [Benchmark :: Tms] (3119.0) -
Benchmark.#benchmark メソッドの引数を簡略化したものです。
...Benchmark.#benchmark メソッドの引数を簡略化したものです。
Benchmark.#benchmark メソッドと同様に働きます。
@param label_width ラベルの幅を指定します。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定し......ます。
//emlist[][ruby]{
require 'benchmark'
n = 50000
Benchmark.bm do |x|
x.report { for i in 1..n; a = "1"; end }
x.report { n.times do ; a = "1"; end }
x.report { 1.upto(n) do ; a = "1"; end }
end
#=>
#
# user system total real
# 1.033333 0.016667 1.016667 (......0000 1.483333 ( 0.694605)
# 1.516667 0.000000 1.516667 ( 0.711077)
//}
以下のようにも書けます。
//emlist[][ruby]{
require 'benchmark'
n = 50000
Benchmark.bm(7) do |x|
x.report("for:") { for i in 1..n; a = "1"; end }
x.report("times:") { n.times do ; a = "1"; end }
x....