1457件ヒット
[1-100件を表示]
(0.090秒)
ライブラリ
- ビルトイン (63)
-
net
/ ftp (36) - pathname (1232)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- File (44)
-
Net
:: FTP (27) -
Net
:: FTP :: MLSxEntry (9) - Pathname (1210)
-
RDoc
:: Options (22) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
モジュール
-
File
:: Constants (11) - Kernel (11)
-
RubyVM
:: AbstractSyntaxTree (8)
キーワード
- + (11)
-
/ (10) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - <=> (11)
- == (11)
- === (11)
-
FNM
_ PATHNAME (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
-
SEPARATOR
_ PAT (11) -
TO
_ PATH (11) - absolute? (11)
- ascend (22)
- atime (11)
- basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- chardev? (11)
- children (11)
- chmod (11)
- chown (11)
- cleanpath (11)
- ctime (11)
- delete (11)
- descend (22)
- directory? (11)
- dirname (11)
-
each
_ child (22) -
each
_ entry (13) -
each
_ filename (11) -
each
_ line (22) - empty? (8)
- entries (11)
- eql? (11)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- extname (11)
- file? (11)
- find (22)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- getwd (11)
- glob (36)
- grpowned? (11)
- hash (11)
- join (11)
- lchmod (11)
- lchown (11)
- lstat (11)
-
make
_ link (11) -
make
_ symlink (11) - mkdir (11)
- mkpath (11)
- mlsd (18)
- mlst (9)
- mountpoint? (11)
- mtime (11)
- new (11)
- open (22)
- opendir (22)
- owned? (11)
-
page
_ dir (11) - parent (11)
-
parse
_ file (8) - path (11)
- pathname (20)
- pipe? (11)
- pwd (11)
- read (11)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- realdirpath (22)
- realpath (33)
- relative? (11)
-
relative
_ path _ from (11) - rename (11)
- rmdir (11)
- rmtree (11)
- root (11)
- root? (11)
-
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 9 feature (11) - setgid? (11)
- setuid? (11)
- size (11)
- size? (11)
- socket? (11)
- split (40)
- stat (11)
- sticky? (11)
- sub (22)
-
sub
_ ext (11) - symlink? (11)
- sysopen (11)
-
to
_ path (11) -
to
_ s (11) - truncate (11)
- unlink (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
- zero? (11)
検索結果
先頭5件
-
Pathname (44078.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
# basename(suffix = "") -> Pathname (30383.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 (30335.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 (30112.0) -
self のパス名要素毎にブロックを実行します。
...self のパス名要素毎にブロックを実行します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/foo/../bar").each_filename {|v| p v}
# => "foo"
# ".."
# "bar"
//}... -
Pathname
# extname -> String (30100.0) -
File.extname(self.to_s) と同じです。
...File.extname(self.to_s) と同じです。
@see File.extname... -
Pathname
# rename(to) -> 0 (30100.0) -
File.rename(self.to_s, to) と同じです。
...File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (24522.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... -
Kernel
# Pathname(path) -> Pathname (24424.0) -
文字列 path を元に Pathname オブジェクトを生成します。
...文字列 path を元に Pathname オブジェクトを生成します。
Pathname.new(path) と同じです。
@param path 文字列、または類似のオブジェクトを与えます。
実際には to_str に反応するオブジェクトなら何でも構いません。... -
Pathname
# sub _ ext(replace) -> Pathname (24295.0) -
拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。
...置き換えた Pathname オブジェクトを返します。
自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。
@param replace 拡張子を文字列で指定します。
//emlist[例][ruby]{
require "pathname"
Pathname('/usr/bin/shutdown......') # => #<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/tes......t..pdf>
Pathname('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Pathname('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}... -
Pathname
# ascend {|pathname| . . . } -> nil (24289.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
...い Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/......o/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>
Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}
ファイ...