るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. openssl name
  4. win32ole name
  5. net/imap name

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#basename(suffix = "") -> Pathname (9202.0)

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

...Pathname.new(File.basename(self.to_s, suffix)) と同じです。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

//emli...
...require "pathname"

Pathname
("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname
("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Pathname
("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Pathname
("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Pathname
("ruby/y....
...tab.c").basename(".*") #=> #<Pathname:"y.tab">
//}

@see File.basename...

Pathname#dirname -> Pathname (9202.0)

Pathname.new(File.dirname(self.to_s)) と同じです。

...Pathname.new(File.dirname(self.to_s)) と同じです。

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

Pathname
('/usr/bin/shutdown').dirname # => #<Pathname:/usr/bin>
//}

@see File.dirname...

Pathname#each_filename {|v| ... } -> nil (9102.0)

self のパス名要素毎にブロックを実行します。

...self のパス名要素毎にブロックを実行します。

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

Pathname
.new("/foo/../bar").each_filename {|v| p v}

# => "foo"
# ".."
# "bar"
//}...

Pathname#extname -> String (9102.0)

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

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


@see File.extname...

Pathname#rename(to) -> 0 (9102.0)

File.rename(self.to_s, to) と同じです。

...File.rename(self.to_s, to) と同じです。

@param to ファイル名を表す文字列を指定します。


@see File.rename...

絞り込み条件を変える

Kernel#Pathname(path) -> Pathname (6202.0)

文字列 path を元に Pathname オブジェクトを生成します。

...文字列 path を元に Pathname オブジェクトを生成します。

Pathname
.new(path) と同じです。

@param path 文字列、または類似のオブジェクトを与えます。
実際には to_str に反応するオブジェクトなら何でも構いません。...

Pathname (6002.0)

パス名をオブジェクト指向らしく扱うクラスです。

...クラスです。

Pathname
オブジェクトはパス名を表しており、ファイルやディレクトリそのものを表してはいません。
当然、存在しないファイルのパス名も扱えます。

絶対パスも相対パスも扱えます。

Pathname
オブジェクト...
...るメソッドはありません。

Pathname
のインスタンスメソッドには、ディレクトリのパスを返す Pathname#dirname のように、
文字列操作だけで結果を返すものもあれば、ファイルの中身を読み出す Pathname#read のように
ファイルシ...
...ムにアクセスするものもあります。

Pathname
オブジェクトの生成には、Pathname.new のほかに Kernel#Pathname も使えます。

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

Pathname
.new("foo/bar") # => #<Pathname:foo/bar>
Pathname
("foo/bar") # => #<Pathname:foo/bar>
//}...

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

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

...ruby]{
require "pathname"

Pathname
("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/shar...
...e>
# => #<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#+(other) -> Pathname (3102.0)

パス名を連結します。つまり、other を self からの相対パスとした新しい Pathname オブジェクトを生成して返します。

...た新しい
Pathname
オブジェクトを生成して返します。

other が絶対パスなら単に other と同じ内容の Pathname オブジェクトが返さ
れます。

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

Pathname
("foo/bar")+"baz" # => #<Pathname:foo/bar/baz>
Pathname
("foo/bar/")+"...
...baz" # => #<Pathname:foo/bar/baz>
Pathname
("foo/bar")+"/baz" # => #<Pathname:/baz>
Pathname
("foo/bar")+"../baz" # => #<Pathname:foo/baz>
//}

@param other 文字列か Pathname オブジェクトを指定します。...

Pathname#/(other) -> Pathname (3102.0)

パス名を連結します。つまり、other を self からの相対パスとした新しい Pathname オブジェクトを生成して返します。

...た新しい
Pathname
オブジェクトを生成して返します。

other が絶対パスなら単に other と同じ内容の Pathname オブジェクトが返さ
れます。

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

Pathname
("foo/bar")+"baz" # => #<Pathname:foo/bar/baz>
Pathname
("foo/bar/")+"...
...baz" # => #<Pathname:foo/bar/baz>
Pathname
("foo/bar")+"/baz" # => #<Pathname:/baz>
Pathname
("foo/bar")+"../baz" # => #<Pathname:foo/baz>
//}

@param other 文字列か Pathname オブジェクトを指定します。...

絞り込み条件を変える

<< 1 2 3 ... > >>