るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.017秒)
トップページ > クエリ:rect[x] > クラス:Pathname[x] > ライブラリ:pathname[x]

別のキーワード

  1. _builtin rect
  2. matrix rect
  3. complex rect
  4. numeric rect

キーワード

検索結果

Pathname#directory? -> bool (6103.0)

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

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


@see FileTest.#directory?...

Pathname#children(with_directory = true) -> [Pathname] (103.0)

self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。

...self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。

ただし、 ".", ".." は要素に含まれません。

@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。

@raise Errno::EXXX self が存在しないパ...
...スであったりディレクトリでなければ例外が発生します。

//emlist[例][ruby]{
require 'pathname'
Pathname
.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>, ... ]
//}...

Pathname#each_child(with_directory = true) -> Enumerator (103.0)

self.children(with_directory).each と同じです。

...ren(with_directory).each と同じです。

@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。

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

Pathname
("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local...
...c>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:/usr/local/var>

Pathname
("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# =...
...> #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}

@see Pathname#children...

Pathname#each_child(with_directory = true) {|pathname| ...} -> [Pathname] (103.0)

self.children(with_directory).each と同じです。

...ren(with_directory).each と同じです。

@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。

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

Pathname
("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local...
...c>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:/usr/local/var>

Pathname
("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# =...
...> #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}

@see Pathname#children...

Pathname#relative_path_from(base_directory) -> Pathname (103.0)

base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。

...ase_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。

パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。

self が相対パスなら base_directory...
...が絶対パスなら
base_directory も絶対パスでなければなりません。

@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。

@raise ArgumentError Windows上でドライブが違うなど、base_directory から self への相対...
...パスが求められないときに例外が発生します。

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

path = Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")

path.relative_path_from(base) # => #<Pathname:foo>
//}...

絞り込み条件を変える