別のキーワード
クラス
- CSV (12)
-
CSV
:: Table (12) - Data (12)
- IO (48)
-
JSON
:: State (12) - Object (12)
-
Rake
:: PackageTask (12) -
RubyVM
:: InstructionSequence (12) - Struct (16)
- SystemCallError (12)
モジュール
- FileUtils (12)
-
GC
:: Profiler (48) - Psych (14)
-
RubyVM
:: AbstractSyntaxTree (10)
検索結果
先頭5件
- RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence - RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node - FileUtils
. options _ of(mid) -> Array
-
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (21238.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...クトを元に
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param body Proc、Method オブジェクトを指定します。
例1:irb で実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSe......ding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/iseq_of.rb
def hello
puts "hello, world"
end
$a_global_......}
# irb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb73d... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (21221.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...list[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(metho... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (21221.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...list[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(metho... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (21220.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...list[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(metho... -
FileUtils
. options _ of(mid) -> Array (6114.0) -
与えられたメソッド名で使用可能なオプション名の配列を返します。
...与えられたメソッド名で使用可能なオプション名の配列を返します。
@param mid メソッド名を指定します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.options_of(:rm) # => ["noop", "verbose", "force"]
//}... -
GC
:: Profiler . raw _ data -> [Hash , . . . ] | nil (3013.0) -
GC のプロファイル情報を GC の発生ごとに Hash の配列 (:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ ていない場合は nil を返します。
...生ごとに Hash の配列
(:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ
ていない場合は nil を返します。
例:
GC::Profiler.enable
GC.start
GC::Profiler.raw_data
# => [
{
:GC_TIME=>1.3000000000000858e-05,
:GC_INVOKE_TIM......:GC_IS_MARKED=>false
},
# ...
]
各項目の意味を以下に示します。
: :GC_TIME
GC の処理時間(秒)
: :GC_INVOKE_TIME
Ruby が起動してから GC が起動するまでに経過した時間(秒)
: :HEAP_USE_SIZE
ヒープ内での使用サイズ(バイト)
: :HE......、GC_PROFILE_MORE_DETAIL を有効にして Ruby をビルドした場合、以下の
キーも参照できます。
* :GC_MARK_TIME
* :GC_SWEEP_TIME
* :ALLOCATE_INCREASE
* :ALLOCATE_LIMIT
* :HEAP_USE_SLOTS
* :HEAP_LIVE_OBJECTS
* :HEAP_FREE_OBJECTS
* :HAVE_FINALIZE
@see GC::Profiler.repor... -
GC
:: Profiler . result -> String (3013.0) -
GC のプロファイル情報をフォーマットし、文字列として返します。
...、GC の発生ごとに集計します。
以下は、5 回 GC が発生した場合の実行例です。
$ ruby -e "GC::Profiler.enable; a = Array.new(100000){ 'aa' }; puts GC::Profiler.result"
GC 5 invokes.
Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total O......voke Time
Ruby が起動してから GC が起動するまでに経過した時間
: Use Size
ヒープ内での使用サイズ
: Total Size
ヒープ全体のサイズ
: Total Object
ヒープ内に存在するオブジェクトの個数
: GC Time
GC の処理時間
@see GC::Profiler.rep... -
GC
:: Profiler . report(out = $ stdout) -> nil (3007.0) -
GC::Profiler.result の結果を out に出力します。
...GC::Profiler.result の結果を out に出力します。
@param out 結果の出力先を指定します。デフォルトは $stdout です。
//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.report
# => GC 4 invokes.
# Index Invoke Time(sec) Use Size(byte) Total Si......ze(byte) Total Object GC Time(ms)
# 1 0.019 303720 1269840 31746 1.25899999999999967493
//}
@see GC::Profiler.result... -
GC
:: Profiler . total _ time -> Float (3007.0) -
GC のプロファイル情報から GC の総計時間を計算し、msec 単位で返します。
...GC のプロファイル情報から GC の総計時間を計算し、msec 単位で返します。
//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.total_time # => 0.0011530000000000012
//}... -
CSV
:: Table . new(array _ of _ rows) -> CSV :: Table (114.0) -
自身を初期化します。
...化します。
全ての行が同じヘッダを持つことを仮定しています。
@param array_of_rows CSV::Row のインスタンスの配列を指定します。
//emlist[例][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["he... -
IO
. binread(path , length = nil , offset = 0) -> String | nil (107.0) -
path で指定したファイルを open し、offset の所まで seek し、 length バイト読み込みます。
...path で指定したファイルを open し、offset の所まで seek し、
length バイト読み込みます。
Kernel.#open と同様 path の先頭が "|" ならば、"|" に続くコマンドの出力を読み取ります。
length を省略するとファイルの末尾まで読み込み......ます。
ファイルを開くときの mode は "rb:ASCII-8BIT" です。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...\n")
IO.binread("testfile") # => "This is line one\nThis is line two\nThis is line three\nAnd so on.....