1663件ヒット
[1-100件を表示]
(0.030秒)
別のキーワード
ライブラリ
モジュール
キーワード
- BigDecimal (14)
- Complex (14)
- Float (7)
- Integer (7)
-
LOG
_ MASK (12) -
LOG
_ UPTO (12) - Rational (12)
- adler32 (10)
-
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) - benchmark (12)
- blockdev? (12)
-
caller
_ locations (24) - cd (24)
- chardev? (12)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chown (12)
-
chown
_ R (12) -
compare
_ stream (12) - copy (12)
- cp (12)
-
cp
_ lr (7) -
cp
_ r (12) - crc32 (10)
- deflate (12)
- directory? (12)
- dump (36)
- empty? (9)
- exec (48)
-
executable
_ real? (12) - exist? (12)
- file? (12)
- fork (24)
- getpriority (12)
- getpty (24)
- grpowned? (12)
- identical? (12)
- install (12)
- link (12)
- ln (12)
-
ln
_ s (12) -
ln
_ sf (12) - load (24)
- log (12)
- makedirs (12)
-
marshal
_ version (12) - mkdir (12)
-
mkdir
_ p (12) - mkpath (12)
- move (12)
- mv (12)
- open (64)
- open! (12)
- owned? (12)
- parse (12)
- parse! (12)
- pipe? (12)
-
pipeline
_ r (24) -
pipeline
_ rw (24) -
pipeline
_ w (24) - popen2 (24)
- popen2e (24)
- popen3 (24)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - print (12)
- printf (24)
- putc (12)
- puts (12)
- readable? (12)
- remove (12)
- reopen (12)
- restore (24)
- rm (12)
-
rm
_ f (12) -
rm
_ r (12) -
rm
_ rf (12) - rmdir (12)
- rmtree (12)
-
safe
_ unlink (12) - select (12)
-
set
_ close _ on _ exec (12) -
set
_ non _ blocking (12) - setgid? (12)
- setpriority (12)
- setuid? (12)
- size (12)
- size? (12)
- socket? (12)
- spawn (72)
- sticky? (12)
- symlink (12)
- symlink? (12)
- system (48)
- test (24)
- timeout (21)
- touch (12)
-
trace
_ object _ allocations (12) -
trace
_ object _ allocations _ start (12) -
trace
_ object _ allocations _ stop (12) - uptodate? (12)
- writable? (12)
- zero? (12)
-
zlib
_ version (12)
検索結果
先頭5件
- Kernel
. # Rational(x , y = 1 , exception: true) -> Rational | nil - Kernel
. # Rational(x , y = 1) -> Rational - Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil - Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil - Process
. # setpriority(which , who , prio) -> 0
-
Kernel
. # Rational(x , y = 1 , exception: true) -> Rational | nil (6301.0) -
引数を有理数(Rational)に変換した結果を返します。
...を有理数(Rational)に変換した結果を返します。
@param x 変換対象のオブジェクトです。
@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。
@param exception false を指......x/y した Rational オブジェクトを
返します。
//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational(1, 3) # => (1/3)
Rational("0.1", "0.3") # => (1/3)
Rational(Complex(1,2), 2) # => ((1/2)+(1/1)*i)
//}
ただし、1.8系とは異なり、Rational オブジェ......クトは常に既約(それ以上
約分できない状態)である事に注意してください。
//emlist[例][ruby]{
Rational(2, 6) # => (1/3)
Rational(1, 3) * 3 # => (1/1)
//}
引数に文字列を指定する場合、以下のいずれかの形式で指定します。
* "1/3... -
Kernel
. # Rational(x , y = 1) -> Rational (6201.0) -
引数を有理数(Rational)に変換した結果を返します。
...引数を有理数(Rational)に変換した結果を返します。
@param x 変換対象のオブジェクトです。
@param y 変換対象のオブジェクトです。省略した場合は x だけを用いて
Rational オブジェクトを作成します。
@raise ArgumentError......x/y した Rational オブジェクトを
返します。
//emlist[例][ruby]{
Rational("1/3") # => (1/3)
Rational(1, 3) # => (1/3)
Rational("0.1", "0.3") # => (1/3)
Rational(Complex(1,2), 2) # => ((1/2)+(1/1)*i)
//}
ただし、1.8系とは異なり、Rational オブジェ......クトは常に既約(それ以上
約分できない状態)である事に注意してください。
//emlist[例][ruby]{
Rational(2, 6) # => (1/3)
Rational(1, 3) * 3 # => (1/1)
//}
引数に文字列を指定する場合、以下のいずれかの形式で指定します。
* "1/3... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6201.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/U......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6201.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/U......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Process
. # setpriority(which , who , prio) -> 0 (6201.0) -
プロセス、プロセスグループ、 ユーザのいずれかの現在のプライオリティを設定します 。プライオリティの設定に成功した場合は 0 を返します。
...かで指定します。
* Process::PRIO_PROCESS
* Process::PRIO_PGRP
* Process::PRIO_USER
@param who which の値にしたがってプロセス ID、プロセスグループ ID、ユーザ ID のいずれかを整数で指定します。
@param prio プライオリティを -20 から 20 ま......身のプライオリティを 10 に下げます。
すでに 10 よりもプライオリティが低く、
Errno::EACCES となった場合には無視して実行を続けます。
begin
Process.setpriority(Process::PRIO_PROCESS, 0, 10)
rescue Errno::EACCES
end
@see setpriority(2)... -
Gem
. # marshal _ version -> String (6101.0) -
Marshal のバージョンを表す文字列を返します。
Marshal のバージョンを表す文字列を返します。 -
ObjectSpace
. # allocation _ sourcefile(object) -> String (6101.0) -
objectの元となったソースファイル名を返します。
...uire 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "file:#{ObjectSpace::allocation_sourcefile(obj)}" # => file:test.rb
ObjectSpace::trace_object_allocations_stop
//}
@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocations_stop... -
ObjectSpace
. # allocation _ sourceline(object) -> Integer (6101.0) -
objectの元となったソースファイルの行番号を返します。
...y]{
require 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "line:#{ObjectSpace::allocation_sourceline(obj)}" # => line:4
ObjectSpace::trace_object_allocations_stop
//}
@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocations_stop... -
ObjectSpace
. # trace _ object _ allocations { . . . } (6101.0) -
与えられたブロック内でオブジェクトのトレースを行います。
...のトレースを行います。
//emlist[例][ruby]{
require 'objspace'
class C
include ObjectSpace
def foo
trace_object_allocations do
obj = Object.new
p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}"
end
end
end
C.new.foo #=> "objtrace.rb:8"
//}... -
ObjectSpace
. # trace _ object _ allocations _ start -> nil (6101.0) -
オブジェクト割り当てのトレースを開始します。
...オブジェクト割り当てのトレースを開始します。
@see ObjectSpace.#trace_object_allocations_stop...