るりまサーチ

最速Rubyリファレンスマニュアル検索!
17580件ヒット [1-100件を表示] (0.082秒)

別のキーワード

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

ライブラリ

クラス

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

RubyVM.resolve_feature_path (29134.0)

require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}...

RubyVM::AbstractSyntaxTree::Node#children -> Array (29106.0)

self の子ノードを配列で返します。

...type によって異なります。

戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//}...

RubyVM::InstructionSequence#absolute_path -> String | nil (29100.0)

self が表す命令シーケンスの絶対パスを返します。

...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = Ruby...
...VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@see RubyVM::InstructionSequence#path...

RubyVM::InstructionSequence#path -> String (29100.0)

self が表す命令シーケンスの相対パスを返します。

...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = Ruby...
...VM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@see RubyVM::InstructionSequence#absolute_path...

RubyVM::InstructionSequence.compile(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (23222.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...した Ruby のソースコードを元にコンパイル済みの
Ruby
VM::InstructionSequence オブジェクトを作成して返します。

@param source Ruby のソースコードを文字列で指定します。

@param file ファイル名を文字列で指定します。

@param path 引数...
...ンを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
Ruby
VM::InstructionSequence.compile_option= を参照
してください。

Ruby
VM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence...
...:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

絞り込み条件を変える

RubyVM::InstructionSequence.new(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (23222.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...した Ruby のソースコードを元にコンパイル済みの
Ruby
VM::InstructionSequence オブジェクトを作成して返します。

@param source Ruby のソースコードを文字列で指定します。

@param file ファイル名を文字列で指定します。

@param path 引数...
...ンを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
Ruby
VM::InstructionSequence.compile_option= を参照
してください。

Ruby
VM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence...
...:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

RubyVM::AbstractSyntaxTree.parse_file(pathname) -> RubyVM::AbstractSyntaxTree::Node (23212.0)

pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。

...pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。

@param pathname パースする対象のファイルパスを指定します
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして...
...す。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree...
...pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。

@param pathname パースする対象のファイルパスを指定します
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関...
...なノードに置き換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
#...
...args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:41-1:49 (STR@1:41-1:49 "") nil)) nil)))
//}...

RubyVM::AbstractSyntaxTree.parse_file(pathname, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node (23212.0)

pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。

...pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。

@param pathname パースする対象のファイルパスを指定します
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関...
...なノードに置き換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
#...
...args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:41-1:49 (STR@1:41-1:49 "") nil)) nil)))
//}...

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

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

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

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

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_inst...
...>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=...

RubyVM::InstructionSequence#to_a -> Array (23018.0)

self の情報を 14 要素の配列にして返します。

...ナーバージョン。

: format_type

データフォーマットを示す数値。常に 1。

: misc

以下の要素から構成される Hash オブジェクト。

:arg_size: メソッド、ブロックが取る引数の総数(1 つもない場合は 0)。

:local_size: ローカ...
...ルでは "<main>"。文字列から作成していた場合は
"<compiled>"。

: #path

命令シーケンスの相対パス。文字列から作成していた場合は "<compiled>"。

: #absolute_path

命令シーケンスの絶対パス。文字列から作成していた場合は nil...
...ては、vm_core.h を参照。

: catch_table

例外や制御構造のオペレータ(rescue、next、redo、break など)の一覧。

: bytecode

命令シーケンスを構成する命令とオペランドの配列の配列。


//emlist[例][ruby]{
require 'pp'

iseq = RubyVM::InstructionS...

絞り込み条件を変える

WEBrick::HTTPServlet::CGIHandler::Ruby -> String (21117.0)

Ruby のパスを返します。

...
Ruby
のパスを返します。...
<< 1 2 3 ... > >>