るりまサーチ

最速Rubyリファレンスマニュアル検索!
108件ヒット [1-100件を表示] (0.043秒)
トップページ > クエリ:@[x] > クエリ:compile_file[x]

別のキーワード

  1. mkmf try_compile
  2. ripper compile_error
  3. _builtin compile
  4. kernel try_compile
  5. _builtin compile_file

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

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

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

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

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

@
param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいず...
...yVM::InstructionSequence.compile_option= を参照
してください。

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

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

@
see RubyVM::InstructionSequence.compile...

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

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

...クトを作成して返します。

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

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

@
param path 引数 file の絶対パスファイル名を文字列で指定します。

@
param line 引数 source の 1 行...
...かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

RubyVM::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 (42.0)

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

...クトを作成して返します。

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

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

@
param path 引数 file の絶対パスファイル名を文字列で指定します。

@
param line 引数 source の 1 行...
...かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

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

@
see RubyVM::InstructionSequence.compile_file...

RubyVM::InstructionSequence.compile_option=(options) (24.0)

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

...命令シーケンスのコンパイル時のデフォルトの最適化オプションを引数
options で指定します。

@
param options コンパイル時の最適化オプションを true、false、nil、
Hash のいずれかで指定します。true を指定した場合は...
...compile、.compile_file メソッドの実行の際に option 引数を指定し
た場合はその実行のみ最適化オプションを変更する事もできます。

@
see RubyVM::InstructionSequence.new,
RubyVM::InstructionSequence.compile,
RubyVM::InstructionSequence.compile_file...

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

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

...::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

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

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

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.abs...
...olute_path # => "/tmp/method.rb"

@
see RubyVM::InstructionSequence#path...

絞り込み条件を変える

RubyVM::InstructionSequence#base_label -> String (18.0)

self が表す命令シーケンスの基本ラベルを返します。

...nstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"

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

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

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq....
...base_label # => "<main>"

例3:

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

RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@
see RubyVM::InstructionSequence#label...

RubyVM::InstructionSequence#label -> String (18.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

...:InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"

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

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

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.lab...
...el # => "<main>"

例3:

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

RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"

@
see RubyVM::InstructionSequence#base_label...

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

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

...ompiled>@<compiled>>
iseq.path
# => "<compiled>"

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

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

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

@
see Ruby...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (12.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...を作成して返します。

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

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(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_proc = proc { str = 'a' + 'b' }

# ir...
<< 1 2 > >>