るりまサーチ

最速Rubyリファレンスマニュアル検索!
820件ヒット [1-100件を表示] (0.205秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > クエリ:string[x] > クエリ:ruby[x] > クエリ:u[x] > 種類:特異メソッド[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

検索結果

<< 1 2 3 ... > >>

RbConfig.ruby -> String (30536.0)

ruby コマンドのフルパスを返します。

...
ruby
コマンドのフルパスを返します。...

Gem.ruby_engine -> String (18536.0)

Ruby処理系実装の種類を表す文字列を返します。

...
Ruby
処理系実装の種類を表す文字列を返します。...

RubyVM::InstructionSequence.load_from_binary_extra_data(binary) -> String (18314.0)

バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。

...埋め込まれたextra_dataを取り出します。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
Ruby
VM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}

@see RubyVM::InstructionSequence#to_binary...

RubyVM::AbstractSyntaxTree.parse(string) -> RubyVM::AbstractSyntaxTree::Node (15751.0)

文字列を抽象構文木にパースし、その木の根ノードを返します。

... string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#t...
...r_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]...
...pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)...

RubyVM::AbstractSyntaxTree.parse(string, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node (15751.0)

文字列を抽象構文木にパースし、その木の根ノードを返します。

... string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#t...
...r_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]...
...pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)...

絞り込み条件を変える

RubyVM::AbstractSyntaxTree.parse(string) -> RubyVM::AbstractSyntaxTree::Node (15750.0)

文字列を抽象構文木にパースし、その木の根ノードを返します。

...

@param string パースする対象の Ruby のコードを文字列で指定します。
@raise SyntaxError string Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
#...
...args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
//}...

RubyVM::InstructionSequence.compile_option -> Hash (15125.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...//emlist[例][ruby]{
require "pp"
pp RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>...
...false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

File.absolute_path(file_name, dir_string=nil) -> String (12421.0)

file_name を絶対パスに変換した文字列を返します。

...す。
dir_string を渡した場合はそのディレクトリを基準とします。

File.expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されます。

//emlist[例][ruby]{
p Dir.getwd...
...#=> "/home/matz/work/bar"
p ENV["HOME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~...
...foo"
//}

@see File.expand_path...

Psych.dump_stream(*objects) -> String (12414.0)

オブジェクト列を YAML ドキュメント列に変換します。

...オブジェクト列を YAML ドキュメント列に変換します。

@param objects 変換対象のオブジェクト列

//emlist[例][ruby]{
Psych.dump_stream("foo\n ", {}) # => "--- ! \"foo\\n \"\n--- {}\n"
//}...

Test::Unit.setup_argv(original_argv = ARGV) { |files| ... } -> [String] (12338.0)

original_argvで指定されたオプションを解析して、テスト対象になるファイル をrequireします。

...を解析して、テスト対象になるファイル
をrequireします。

@param original_argv オプションを指定します。省略された場合は、
Object::ARGVが使用されます。

@raise ArgumentError 指定されたファイルが存在しない場合に...
...quireの対象
にします。

ブロックパラメータには上記のoriginal_argvから-xで指定されたもの以外のオ
プションが配列で渡されます。ファイル名の代わりにディレクトリを指定する
と、ディレクトリの中にあるtest_*.rbを全てrequi...
...のメソッド自体は、オプションを解析してrequireを行う以外の処理は行いま
せんが、test/unit.rbをrequireして呼び出すメソッドのため、結果的にユニッ
トテストが実行されます。testrbコマンドのように、ユニットテストを実行...

絞り込み条件を変える

GC::Profiler.result -> String (12326.0)

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 Object GC Time(ms)
1 0.012...
...e Time
Ruby
が起動してから GC が起動するまでに経過した時間
: Use Size
ヒープ内での使用サイズ
: Total Size
ヒープ全体のサイズ
: Total Object
ヒープ内に存在するオブジェクトの個数
: GC Time
GC の処理時間

@see GC::Profiler.report...

RubyVM::InstructionSequence.disasm(body) -> String (12203.0)

引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。

...
Ruby
VM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。

@param body Proc、Method オブジェクトを指定します。

例1:Proc オブジェクトを指定した場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::Inst...
...ructionSequence.disasm(p)

出力:

== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|-----------------------------------------------...
...---
local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 dup
0009 setlocal num, 0
001...
<< 1 2 3 ... > >>