るりまサーチ

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

別のキーワード

  1. _builtin absolute_path
  2. pathname absolute?
  3. file absolute_path
  4. location absolute_path
  5. name absolute?

ライブラリ

キーワード

検索結果

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

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

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

self
を文字列から作成していた場合は nil を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i...
...seq.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.absolute_path # => "/tmp/method.rb"

@see RubyVM::I...

Thread::Backtrace::Location#absolute_path -> String (18123.0)

self が表すフレームの絶対パスを返します。

...
self
が表すフレームの絶対パスを返します。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path...

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

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

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

self
の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1...
..."<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 RubyVM::InstructionSequence#absolute_path...

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

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

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

命令シーケンスを以下の情報で表します。

: magic

データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。

: major_version

命令シーケンスのメジャーバー...
...場合は
"<compiled>"。

: #path

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

: #absolute_path

命令シーケンスの絶対パス。文字列から作成していた場合は nil。

: #first_lineno

命令シーケンスの 1 行...

Thread::Backtrace::Location#path -> String (22.0)

self が表すフレームのファイル名を返します。

...
self
が表すフレームのファイル名を返します。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}

@see Thread::Backtrace::Location#absolute_path...

絞り込み条件を変える

NEWS for Ruby 2.0.0 (18.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...たファイルのパスを返します

* Module
* 追加: Module#prepend 指定したモジュールを self の継承チェインの先頭に
「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
* 追加: Module.prepended...
...get the instruction sequence
from a method or a block.
* 追加: RubyVM::InstructionSequence#path,
RubyVM::InstructionSequence#absolute_path,
RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#base_label,
RubyVM::InstructionSequence#first_lineno to retr...

NEWS for Ruby 2.7.0 (12.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...うな場所にコメントを書けるようになりました。

//emlist[][ruby]{
foo
# .bar
.baz # => foo.baz
//}

* リテラルの「self」をレシーバーとしたプライベートメソッド呼び出しが
できるようになりました。 11297 16123

* 多重代入で...
...発生させます。 10344

* File
* 新規メソッド
* パスが絶対パスかどうかをポータブルに判定するFile.absolute_path?メソッドが追加されました。 15868
* 変更されたメソッド
* Windows以外のプラットフォームでFile.extname...