るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub

ライブラリ

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

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

...は、to_path メソッドを呼びます。

@
param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。

//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("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}...

File#path -> String (24436.0)

オープン時に使用したパスを文字列で返します。

...

@
raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx...
..."
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

TracePoint#path -> String (24427.0)

イベントが発生したファイルのパスを返します。

...トが発生したファイルのパスを返します。

@
raise RuntimeError イベントフックの外側で実行した場合に発生します。

//emlist[例][ruby]{
def foo(ret)
ret
end
t
race = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
t
race.enable
foo 1
//}...

絞り込み条件を変える

WIN32OLE_TYPELIB#path -> String (24427.0)

TypeLibのパス名を取得します。

...TypeLibのパス名を取得します。

@
return TypeLibのパス名を文字列で返します。この値はレジストリの登録値を
そのまま利用するため、Rubyのパス名形式(ディレクトリ区切りは
「/」)ではなく、Windowsのパス名形式(...
...りは「\」)
です。
@
raise WIN32OLERuntimeError TypeLibの属性が読み取れない場合に通知します。

t
lib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library')
puts tlib.path # => 'C:\...\EXCEL.EXE'

T
ypeLibは拡張子TLB(まれにOLB)という独立し...

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

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

...list[例][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/foo.rb
//}

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

RubyVM::InstructionSequence#absolute_path -> String | nil (15427.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.expand_path(path, default_dir = &#39;.&#39;) -> String (12690.0)

path を絶対パスに展開した文字列を返します。 path が相対パスであれば default_dir を基準にします。

...
path
を絶対パスに展開した文字列を返します。
path
が相対パスであれば default_dir を基準にします。

先頭の ~ はホームディレクトリ(環境変数 HOME が使われます)に、
~USER はそのユーザのホームディレクトリに展開されます。...
...//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/home/matz/work"
p File.expand_path("..", "/tmp") #=> "/"
p File.expand_path("~") #=> "/home/matz"
p File.expand_path("~foo...
...") #=> "/home/foo"
//}

@
param path パスを表す文字列を指定します。

@
param default_dir path が相対パスであれば default_dir を基準に展開されます。...
<< 1 2 3 ... > >>