ライブラリ
- ビルトイン (94)
-
net
/ ftp (40) - pathname (1346)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- File (72)
-
Net
:: FTP (30) -
Net
:: FTP :: MLSxEntry (10) - Pathname (1322)
-
RDoc
:: Options (24) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
モジュール
-
File
:: Constants (12) - Kernel (12)
-
RubyVM
:: AbstractSyntaxTree (10)
キーワード
- + (12)
-
/ (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - <=> (12)
- == (12)
- === (12)
-
FNM
_ PATHNAME (12) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Ruby用語集 (12)
-
SEPARATOR
_ PAT (12) -
TO
_ PATH (12) - absolute? (12)
- ascend (24)
- atime (12)
- basename (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- blockdev? (12)
- chardev? (12)
- children (12)
- chmod (12)
- chown (12)
- cleanpath (12)
- ctime (12)
- delete (12)
- descend (24)
- directory? (12)
- dirname (12)
-
each
_ child (24) -
each
_ entry (15) -
each
_ filename (12) -
each
_ line (24) - empty? (9)
- entries (12)
- eql? (12)
- executable? (12)
-
executable
_ real? (12) - exist? (12)
- extname (12)
- file? (12)
- find (24)
- fnmatch (24)
- fnmatch? (24)
- ftype (12)
- getwd (12)
- glob (40)
- grpowned? (12)
- hash (12)
- join (12)
- lchmod (12)
- lchown (12)
- lstat (12)
-
make
_ link (12) -
make
_ symlink (12) - mkdir (12)
- mkpath (12)
- mlsd (20)
- mlst (10)
- mountpoint? (12)
- mtime (12)
- new (12)
- open (24)
- opendir (24)
- owned? (12)
-
page
_ dir (12) - parent (12)
-
parse
_ file (10) - path (12)
- pathname (22)
- pipe? (12)
- pwd (12)
-
rdoc
/ generator / json _ index (12) - read (12)
- readable? (12)
-
readable
_ real? (12) - readlines (12)
- readlink (12)
- realdirpath (24)
- realpath (36)
- relative? (12)
-
relative
_ path _ from (12) - rename (12)
- rmdir (12)
- rmtree (12)
- root (12)
- root? (12)
-
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 5 feature (12) -
ruby 1
. 9 feature (12) - setgid? (12)
- setuid? (12)
- size (12)
- size? (12)
- socket? (12)
- split (42)
- stat (12)
- sticky? (12)
- sub (24)
-
sub
_ ext (12) - symlink? (12)
- sysopen (12)
-
to
_ path (12) -
to
_ s (12) - truncate (12)
- unlink (12)
- utime (12)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (12)
- zero? (12)
検索結果
先頭5件
-
Pathname
# basename(suffix = "") -> Pathname (21183.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
# each _ entry {|pathname| . . . } -> nil (21171.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...to_s) {|f| yield Pathname.new(f) } と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@see......yield Pathname.new(f) } と同じです。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:incl......ude>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@see Dir.foreach... -
Pathname
# parent -> Pathname (21171.0) -
self の親ディレクトリを指す新しい Pathname オブジェクトを返します。
...を指す新しい Pathname オブジェクトを返します。
//emlist[例 絶対パス][ruby]{
require "pathname"
path = Pathname("/usr")
path # => #<Pathname:/usr>
path.parent # => #<Pathname:/>
//}
//emlist[例 相対パス][ruby]{
require "pathname"
path = Pathname("foo/bar")
path.......parent # => #<Pathname:foo>
path.parent.parent # => #<Pathname:.>
path.parent.parent.parent # => #<Pathname:..>
//}... -
Pathname
# cleanpath(consider _ symlink = false) -> Pathname (21165.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。
@param consider_symlink 真ならパス要素にシンボリック......題ないように .. を残します。
//emlist[例][ruby]{
require "pathname"
path = Pathname.new("//.././../")
path # => #<Pathname://.././../>
path.cleanpath # => #<Pathname:/>
require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue......nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")
path.cleanpath # => #<Pathname:bar/bar>
path.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}... -
Pathname
# glob(pattern , flags=0) -> [Pathname] (21154.0) -
ワイルドカードの展開を行なった結果を、 Pathname オブジェクトの配列として返します。
...、
Pathname オブジェクトの配列として返します。
引数の意味は、Dir.glob と同じです。 flag の初期値である 0 は「何
も指定しない」ことを意味します。
ブロックが与えられたときは、ワイルドカードにマッチした Pathname オ......ンです
@param flags パターンマッチ時のふるまいを変化させるフラグを指定します
//emlist[][ruby]{
require "pathname"
Pathname("ruby-2.4.2").glob("R*.md") # => [#<Pathname:ruby-2.4.2/README.md>, #<Pathname:ruby-2.4.2/README.ja.md>]
//}
@see Dir.glob
@see Pathname.glob... -
Pathname
# glob(pattern , flags=0) {|pathname| . . . } -> nil (21154.0) -
ワイルドカードの展開を行なった結果を、 Pathname オブジェクトの配列として返します。
...、
Pathname オブジェクトの配列として返します。
引数の意味は、Dir.glob と同じです。 flag の初期値である 0 は「何
も指定しない」ことを意味します。
ブロックが与えられたときは、ワイルドカードにマッチした Pathname オ......ンです
@param flags パターンマッチ時のふるまいを変化させるフラグを指定します
//emlist[][ruby]{
require "pathname"
Pathname("ruby-2.4.2").glob("R*.md") # => [#<Pathname:ruby-2.4.2/README.md>, #<Pathname:ruby-2.4.2/README.ja.md>]
//}
@see Dir.glob
@see Pathname.glob... -
Pathname
. glob(pattern , flags=0) -> [Pathname] (21154.0) -
ワイルドカードの展開を行なった結果を、 Pathname オブジェクトの配列として返します。
...、
Pathname オブジェクトの配列として返します。
引数の意味は、Dir.glob と同じです。 flag の初期値である 0 は「何
も指定しない」ことを意味します。
ブロックが与えられたときは、ワイルドカードにマッチした Pathname オ......イルドカードパターンです
@param flags パターンマッチ時のふるまいを変化させるフラグを指定します
//emlist[][ruby]{
require "pathname"
Pathname.glob("lib/i*.rb") # => [#<Pathname:lib/ipaddr.rb>, #<Pathname:lib/irb.rb>]
//}
@see Dir.glob
@see Pathname#glob... -
Pathname
. glob(pattern , flags=0) {|pathname| . . . } -> nil (21154.0) -
ワイルドカードの展開を行なった結果を、 Pathname オブジェクトの配列として返します。
...、
Pathname オブジェクトの配列として返します。
引数の意味は、Dir.glob と同じです。 flag の初期値である 0 は「何
も指定しない」ことを意味します。
ブロックが与えられたときは、ワイルドカードにマッチした Pathname オ......イルドカードパターンです
@param flags パターンマッチ時のふるまいを変化させるフラグを指定します
//emlist[][ruby]{
require "pathname"
Pathname.glob("lib/i*.rb") # => [#<Pathname:lib/ipaddr.rb>, #<Pathname:lib/irb.rb>]
//}
@see Dir.glob
@see Pathname#glob... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (21153.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")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_......path # => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/testfile>
//}
@see File.expand_path... -
Pathname
. getwd -> Pathname (21152.0) -
カレントディレクトリを元に Pathname オブジェクトを生成します。 Pathname.new(Dir.getwd) と同じです。
...カレントディレクトリを元に Pathname オブジェクトを生成します。
Pathname.new(Dir.getwd) と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname.getwd #=> #<Pathname:/home/zzak/projects/ruby>
//}
@see Dir.getwd... -
Pathname
. pwd -> Pathname (21152.0) -
カレントディレクトリを元に Pathname オブジェクトを生成します。 Pathname.new(Dir.getwd) と同じです。
...カレントディレクトリを元に Pathname オブジェクトを生成します。
Pathname.new(Dir.getwd) と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname.getwd #=> #<Pathname:/home/zzak/projects/ruby>
//}
@see Dir.getwd...