るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dsa p
  5. dh p=

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (24572.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

...Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

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

path
= Pathname("testfile")
Path
name.pwd # => #<Pathname:/path/to>
path
.expand_...
...path # => #<Pathname:/path/to/testfile>
path
.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

URI::Generic#path -> String | nil (24278.0)

自身の path を文字列で返します。設定されていない場合は nil を返します。

... path を文字列で返します。設定されていない場合は nil を返します。

require 'uri'
p
URI.parse('http://example.com/hoge').path #=> "/hoge"
p
URI.parse('http://example.com').path #=> ""
p
URI.parse('mailto:nospam@localhost').path #=> nil
p
URI...
...('ftp://example.com/foo').path #=> 'foo'
p
URI('ftp://example.com/%2Ffoo').path #=> '/foo'...

IO#path -> String | nil (24245.0)

IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。

...が返すパスがファイルシステム上に存在することは保証されていません。

//emlist[例][ruby]{
p
STDIN.path # => "<STDIN>"
p
IO.new(IO.sysopen("/")).path # => "/"
p
IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}...

Tempfile#path -> String | nil (24226.0)

テンポラリファイルのパス名を返します。

...テンポラリファイルのパス名を返します。

Tempfile#close! を実行後だった場合にはnilを返します。

require "tempfile"
tf = Tempfile.new("hoo")
p
tf.path # => "/tmp/hoo.10596.0"
tf.close!
p
tf.path # => nil...

CSV#path -> String (24224.0)

IO#path に委譲します。

...IO#path に委譲します。


@see IO#path...

絞り込み条件を変える

Net::HTTPGenericRequest#path -> String (24224.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}...

File#path -> String (24221.0)

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

...::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 } #=> "/tmp"
//}...
...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?)
//}...

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

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

..."<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

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

# /tmp/meth...
...od.rb
def hello
p
uts "hello, world"
end

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

@see RubyVM::InstructionSequence#absolute_path...

TracePoint#path -> String (24220.0)

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

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

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

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

Zlib::GzipFile#path -> String (24218.0)

関連付けられている IO オブジェクトのパスを返します。 このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。

...関連付けられている IO オブジェクトのパスを返します。
このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。...

絞り込み条件を変える

<< 1 2 3 ... > >>