るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#to_s -> String (21103.0)

パス名を文字列で返します。

...パス名を文字列で返します。


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

p
ath = Pathname.new("/tmp/hogehoge")
File.open(path)
//}...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (15318.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"

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

@see File.expand_path...

Pathname#to_path -> String (9124.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s...

Pathname#mkpath -> nil (9118.0)

FileUtils.mkpath(self.to_s) と同じです。

...FileUtils.mkpath(self.to_s) と同じです。


@see FileUtils.#mkpath...

Pathname#open(mode = &#39;r&#39;, perm = 0666) -> File (6218.0)

File.open(self.to_s, *args, &block) と同じです。

...File.open(self.to_s, *args, &block) と同じです。


@see File.open...

絞り込み条件を変える

Pathname#open(mode = &#39;r&#39;, perm = 0666) {|file| ... } -> object (6218.0)

File.open(self.to_s, *args, &block) と同じです。

...File.open(self.to_s, *args, &block) と同じです。


@see File.open...

Pathname#empty? -> bool (6134.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

...ては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'

Pathname
("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => tru...
...e
//}

//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'

Pathname
("testfile").empty? # => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}

@see Dir.empty?, FileTest.#empty?, Pathname#zero?...

Pathname#ftype -> String (6118.0)

File.ftype(self.to_s) と同じです。

...File.ftype(self.to_s) と同じです。


@see File.ftype...

Pathname#grpowned? -> bool (6118.0)

FileTest.grpowned?(self.to_s) と同じです。

...FileTest.grpowned?(self.to_s) と同じです。


@see FileTest.#grpowned?...
<< 1 2 3 ... > >>