るりまサーチ

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

別のキーワード

  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 (18118.0)

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

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

Hash.ruby2_keywords_hash?(hash) -> bool (6192.0)

Module#ruby2_keywordsやProc#ruby2_keywordsによる ruby2_keywords フラグが設定されているかどうかを返します。

...Module#ruby2_keywordsやProc#ruby2_keywordsによる
ruby
2_keywords フラグが設定されているかどうかを返します。

このメソッドはデバッグや調査、シリアライゼーションのために本当に必要な場合のために
用意されていて、普通のプログ...
...れていません。

ruby
2.7.1 で追加されたため、ruby 2.7.0 では定義されていません。

//emlist[][ruby]{
ruby
2_keywords def foo(*args)
Hash.ruby2_keywords_hash?(args.last)
end
foo(k: 1) # => true
foo({k: 1}) # => false
//}

@see Module#ruby2_keywords, Proc#ruby2_keywords...

Gem.ruby_engine -> String (6118.0)

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

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

Gem::QuickLoader.load_full_rubygems_library (6101.0)

prelude.c で定義されている内部用のメソッドです。

prelude.c で定義されている内部用のメソッドです。

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

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

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

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

@param file ファイル名を文字列で指定しま...
...れかで指定します。詳細は
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 (3123.0)

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

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

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

@param file ファイル名を文字列で指定しま...
...れかで指定します。詳細は
Ruby
VM::InstructionSequence.compile_option= を参照
してください。

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

@see RubyVM::InstructionSequence.compile_file...

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

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

...ドを返します。

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

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9...
...文字列を抽象構文木にパースし、その木の根ノードを返します。

@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコ...
...あるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# bo...
...dy:
# (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)
# => (SCOPE@1:0-1:15
# tbl: [:x, :y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (L...

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

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

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

@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコ...
...あるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# bo...
...dy:
# (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)
# => (SCOPE@1:0-1:15
# tbl: [:x, :y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (L...

RubyVM::InstructionSequence.compile_file(file, options = nil) -> RubyVM::InstructionSequence (3117.0)

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

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

Ruby
VM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。

@param...
...細は
Ruby
VM::InstructionSequence.compile_option= を参照
してください。

# /tmp/hello.rb
puts "Hello, world!"

# irb
Ruby
VM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>

@see RubyVM::Inst...

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

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

...のファイルパスを指定します
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# bo...
...dy:
# (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)))
//}...
...換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# bo...

絞り込み条件を変える

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

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

...換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# bo...
...dy:
# (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.of(proc) -> RubyVM::AbstractSyntaxTree::Node (3107.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...す。

//emlist[][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::AbstractSyntaxT...

RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node (3107.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...す。

//emlist[][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::AbstractSyntaxT...

RubyVM::InstructionSequence.load_from_binary(binary) -> RubyVM::InstructionSequence (3107.0)

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

...
Ruby
VM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起...
...りません。自分が変換したバイナリデータを使うべきです。

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

@see RubyVM::InstructionSequence#to_binary...
<< 1 2 3 ... > >>