るりまサーチ

最速Rubyリファレンスマニュアル検索!
647件ヒット [401-500件を表示] (0.056秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 3 4 5 6 7 > >>

Pathname#absolute? -> bool (3035.0)

self が絶対パス指定であれば真を返します。

...self が絶対パス指定であれば真を返します。

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

path
name = Pathname("/path/to/example.rb")
path
name.absolute? # => true
path
name = Pathname("../")
path
name.absolute? # => false
//}...

Pathname#delete -> Integer (3035.0)

self が指すディレクトリあるいはファイルを削除します。

...self が指すディレクトリあるいはファイルを削除します。

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

path
name = Pathname("/path/to/sample")
path
name.exist? # => true
path
name.unlink # => 1
path
name.exist? # => false
//}...

Pathname#unlink -> Integer (3035.0)

self が指すディレクトリあるいはファイルを削除します。

...self が指すディレクトリあるいはファイルを削除します。

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

path
name = Pathname("/path/to/sample")
path
name.exist? # => true
path
name.unlink # => 1
path
name.exist? # => false
//}...

Pathname#<=>(other) -> -1 | 0 | 1 | nil (3029.0)

パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合 は正、other が大きい場合は負を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。

...パス名を比較します。other と同じなら 0 を、ASCII順で self が大きい場合
は正、other が大きい場合は負を返します。大文字小文字は区別されます。
other は Pathname オブジェクトでなければなりません。

パス名の比較は単純に...
...@param other 比較対象の Pathname オブジェクトを指定します。

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

p Pathname.new("foo/bar") <=> Pathname.new("foo/bar")
p Pathname.new("foo/bar") <=> Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") <=> Pathname.new("foo/bar")
# => 0
#...

Pathname#atime -> Time (3029.0)

File.atime(self.to_s) を渡したものと同じです。

...File.atime(self.to_s) を渡したものと同じです。

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

path
name = Pathname("testfile")
path
name.atime # => 2018-12-18 20:58:13 +0900
//}

@see File.atime...

絞り込み条件を変える

Pathname#binread(*args) -> String | nil (3029.0)

IO.binread(self.to_s, *args)と同じです。

...IO.binread(self.to_s, *args)と同じです。

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

path
name = Pathname("testfile")
path
name.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
path
name.binread(20) # => "This is line one\nThi"
path
name.binread(2...

Pathname#chown(owner, group) -> Integer (3029.0)

File.chown(owner, group, self.to_s) と同じです。

...File.chown(owner, group, self.to_s) と同じです。

@param owner オーナーを指定します。

@param group グループを指定します。

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

Path
name('testfile').stat.uid # => 501
Path
name('testfile').chown(502, 12)
Path
name('testfile').stat.ui...

Pathname#ctime -> Time (3029.0)

File.ctime(self.to_s) を渡したものと同じです。

...File.ctime(self.to_s) を渡したものと同じです。

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

IO.write("testfile", "test")
path
name = Pathname("testfile")
path
name.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
path
name.chmod(0755)
path
name.ctime # => 2019-01-14 00:39:52 +0900
//}

@see File.ct...

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

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

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

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

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

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

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

@see Pathname#children...
<< < ... 3 4 5 6 7 > >>