るりまサーチ

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

別のキーワード

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

検索結果

RubyVM::InstructionSequence#absolute_path -> String | nil (21213.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...

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

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

...[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...

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

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/to/foo.rb
# /path/to...

File.absolute_path?(file_name) -> bool (6249.0)

file_name が絶対パスなら true を、そうでなければ false を返します。

...ist[例][ruby]{
File.absolute_path?("//foo/bar\\baz") # => true
File.absolute_path?("C:foo\\bar") # => false
File.absolute_path?("~") # => false

# プラットフォームが cygwin、mswin、mingw の場合
File.absolute_path?("C:\\foo\\bar") # => true
File.absolute_path?("/foo/...
...bar\\baz") # => false

# プラットフォームが上記以外の場合
File.absolute_path?("C:\\foo\\bar") # => false
File.absolute_path?("/foo/bar\\baz") # => true
//}...

NEWS for Ruby 2.7.0 (3831.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b...
...するFile.absolute_path?メソッドが追加されました。 15868
* 変更されたメソッド
* Windows以外のプラットフォームでFile.extnameが「.」で終わる文字列に対して
「.」を返すようになりました。 15267

//emlist[][ruby]{
File.extna...

絞り込み条件を変える

NEWS for Ruby 2.0.0 (3183.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...トは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 1.9.3 以降の変更

=== 言語仕様の変更

* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に似ています)
*...
...

* RubyVM (MRI specific)
* 追加: RubyVM::InstructionSequence.of to get the instruction sequence
from a method or a block.
* 追加: RubyVM::InstructionSequence#path,
Ruby
VM::InstructionSequence#absolute_path,
Ruby
VM::InstructionSequence#label,
Ruby
VM::Instruct...

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

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

...場合は
"<compiled>"。

: #path

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

: #absolute_path

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

: #first_lineno

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


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

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_...

RubyVM::InstructionSequence#path -> String (3106.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...

File.path(filename) -> String (112.0)

指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。

...ath メソッドが定義されたオブジェクトを指定します。

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

class MyPath
def initialize(path)
@path = path
end
def to_path
File.absolute_path(@path)
end
end

File.path("/dev/null") # => "/dev/null"
File.path(Pathname("/...

Thread::Backtrace::Location#path -> String (112.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...

絞り込み条件を変える