種類
- インスタンスメソッド (801)
- 文書 (45)
- 特異メソッド (22)
- ライブラリ (11)
- 関数 (11)
ライブラリ
- ビルトイン (22)
- pathname (768)
-
rexml
/ document (11) - uri (22)
クラス
- Pathname (768)
-
REXML
:: Elements (11) -
Thread
:: Backtrace :: Location (22) -
URI
:: FTP (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) - atime (11)
- basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- build (22)
- chardev? (11)
- chmod (11)
- chown (11)
- ctime (11)
-
delete
_ all (11) - directory? (11)
- dirname (11)
-
each
_ entry (13) -
each
_ line (22) - empty? (8)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- extname (11)
- file? (11)
- find (22)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- grpowned? (11)
- inspect (11)
- irb (11)
- lchmod (11)
- lchown (11)
- lstat (11)
-
make
_ link (11) -
make
_ symlink (11) - mkdir (11)
- mkpath (11)
- mtime (11)
- open (22)
- opendir (22)
- owned? (11)
- pipe? (11)
-
rb
_ class _ path (11) - read (11)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- rename (11)
- rmdir (11)
- rmtree (11)
-
ruby 1
. 6 feature (11) - setgid? (11)
- setuid? (11)
- size (11)
- size? (11)
- socket? (11)
- split (11)
- stat (11)
- sticky? (11)
- symlink? (11)
- sysopen (11)
-
to
_ path (11) - truncate (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
- zero? (11)
検索結果
先頭5件
-
Pathname
# to _ s -> String (21113.0) -
パス名を文字列で返します。
...パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (18125.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (9287.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
# to _ path -> String (9123.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s... -
Pathname
# mkpath -> nil (9116.0) -
FileUtils.mkpath(self.to_s) と同じです。
...FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath... -
VALUE rb
_ class _ path(VALUE klass) (6112.0) -
klass の名前を返します.klassが無名クラス、無名モジュー ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。
...klass の名前を返します.klassが無名クラス、無名モジュー
ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。
Module#to_s の定義は
rb_str_dup(rb_class_path(klass));
です。... -
Pathname
# basename(suffix = "") -> Pathname (3116.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 (3116.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 _ entry {|pathname| . . . } -> nil (3116.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...each(self.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>......each(self.to_s) {|f| yield Pathname.new(f) } と同じです。
ブロックを省略した場合は Enumerator を返します。
//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 Dir.foreach... -
Pathname
# readlink -> Pathname (3116.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
...Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink...