るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

クラス

キーワード

検索結果

Pathname#to_s -> String (54313.0)

パス名を文字列で返します。

...パス名を文字列で返します。


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

path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}...

Pathname#empty? -> bool (106.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

...トリの場合][ruby]{
require "pathname"
require 'tmpdir'

Pathname
("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
//}

//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'

Pathname
("testfile").empty?...
...# => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}

@see Dir.empty?, FileTest.#empty?, Pathname#zero?...

Pathname#to_path -> String (76.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s...

Pathname#atime -> Time (58.0)

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

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

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

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

@see File.atime...

Pathname#basename(suffix = "") -> Pathname (58.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#binread(*args) -> String | nil (58.0)

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

...じです。

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

pathname
= Pathname("testfile")
pathname
.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname
.binread(20) # => "This is line one\nThi"
pathname
.binread(20, 10) # => "ne one\nThis is lin...

Pathname#binwrite(string, offset=nil) -> Integer (58.0)

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

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


@see IO.binwrite

Pathname#birthtime -> Time (58.0)

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

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

@raise NotImplementedError Windows のような birthtime のない環境で発生します。


@see File.birthtime

Pathname#blockdev? -> bool (58.0)

FileTest.blockdev?(self.to_s) と同じです。

FileTest.blockdev?(self.to_s) と同じです。


@see FileTest.#blockdev?

Pathname#chardev? -> bool (58.0)

FileTest.chardev?(self.to_s) と同じです。

FileTest.chardev?(self.to_s) と同じです。


@see FileTest.#chardev?

絞り込み条件を変える

Pathname#chmod(mode) -> Integer (58.0)

File.chmod(mode, self.to_s) と同じです。

File.chmod(mode, self.to_s) と同じです。

@param mode ファイルのアクセス権限を整数で指定します。


@see File.chmod

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

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

...

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

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

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

Pathname
('testfile').stat.uid # => 501
Pathname
('testfile').chown(502, 12)
Pathname
('testfile').stat.uid # => 502
//}

@see File.chown, File#chown...

Pathname#ctime -> Time (58.0)

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

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

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

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

@see File.ctime...

Pathname#directory? -> bool (58.0)

FileTest.directory?(self.to_s) と同じです。

FileTest.directory?(self.to_s) と同じです。


@see FileTest.#directory?

Pathname#dirname -> Pathname (58.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 (58.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...

Pathname#each_line(*args) -> Enumerator (58.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...t[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line...
...uire "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("tes...

Pathname#each_line(*args) {|line| ... } -> nil (58.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...t[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line...
...uire "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname
("tes...

Pathname#executable? -> bool (58.0)

FileTest.executable?(self.to_s) と同じです。

FileTest.executable?(self.to_s) と同じです。


@see FileTest.#executable?

Pathname#executable_real? -> bool (58.0)

FileTest.executable_real?(self.to_s) と同じです。

FileTest.executable_real?(self.to_s) と同じです。


@see FileTest.#executable_real?

絞り込み条件を変える

Pathname#exist? -> bool (58.0)

FileTest.exist?(self.to_s) と同じです。

FileTest.exist?(self.to_s) と同じです。


@see FileTest.#exist?

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (58.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#extname -> String (58.0)

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

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


@see File.extname

Pathname#file? -> bool (58.0)

FileTest.file?(self.to_s) と同じです。

FileTest.file?(self.to_s) と同じです。


@see FileTest.#file?

Pathname#fnmatch(pattern, *args) -> bool (58.0)

File.fnmatch(pattern, self.to_s, *args) と同じです。

...て `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

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

path = Pathname("testfile")
path.fnmatch("test*") # => true
path.fnmatch("TEST*") # => false
path.fnmatch("TES...

絞り込み条件を変える

Pathname#fnmatch?(pattern, *args) -> bool (58.0)

File.fnmatch?(pattern, self.to_s, *args) と同じです。

File.fnmatch?(pattern, self.to_s, *args) と同じです。

@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

@see File.fnmatch?

Pathname#ftype -> String (58.0)

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

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


@see File.ftype

Pathname#grpowned? -> bool (58.0)

FileTest.grpowned?(self.to_s) と同じです。

FileTest.grpowned?(self.to_s) と同じです。


@see FileTest.#grpowned?

Pathname#lchmod(mode) -> Integer (58.0)

File.lchmod(mode, self.to_s) と同じです。

File.lchmod(mode, self.to_s) と同じです。

@param mode ファイルのアクセス権限を整数で指定します。


@see File.lchmod

Pathname#lchown(owner, group) -> Integer (58.0)

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

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

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

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


@see File.lchown

絞り込み条件を変える

Pathname#lstat -> File::Stat (58.0)

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

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


@see File.lstat

Pathname#make_link(old) -> 0 (58.0)

File.link(old, self.to_s) と同じです。

File.link(old, self.to_s) と同じです。


@see File.link

Pathname#make_symlink(old) -> 0 (58.0)

File.symlink(old, self.to_s) と同じです。

File.symlink(old, self.to_s) と同じです。


@see File.symlink

Pathname#mkdir(*args) -> 0 (58.0)

Dir.mkdir(self.to_s, *args) と同じです。

Dir.mkdir(self.to_s, *args) と同じです。


@see Dir.mkdir

Pathname#mkpath -> nil (58.0)

FileUtils.mkpath(self.to_s) と同じです。

FileUtils.mkpath(self.to_s) と同じです。


@see FileUtils.#mkpath

絞り込み条件を変える

Pathname#mtime -> Time (58.0)

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

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


@see File.mtime

Pathname#open(mode = &#39;r&#39;, perm = 0666) -> File (58.0)

File.open(self.to_s, *args, &block) と同じです。

File.open(self.to_s, *args, &block) と同じです。


@see File.open

Pathname#open(mode = &#39;r&#39;, perm = 0666) {|file| ... } -> object (58.0)

File.open(self.to_s, *args, &block) と同じです。

File.open(self.to_s, *args, &block) と同じです。


@see File.open

Pathname#opendir -> Dir (58.0)

Dir.open(self.to_s, &block) と同じです。

Dir.open(self.to_s, &block) と同じです。


@see Dir.open

Pathname#opendir {|dir| ... } -> nil (58.0)

Dir.open(self.to_s, &block) と同じです。

Dir.open(self.to_s, &block) と同じです。


@see Dir.open

絞り込み条件を変える

Pathname#owned? -> bool (58.0)

FileTest.owned?(self.to_s) と同じです。

FileTest.owned?(self.to_s) と同じです。


@see FileTest.#owned?

Pathname#pipe? -> bool (58.0)

FileTest.pipe?(self.to_s) と同じです。

FileTest.pipe?(self.to_s) と同じです。


@see FileTest.#pipe?

Pathname#read(*args) -> String | nil (58.0)

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

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


@see IO.read

Pathname#readable? -> bool (58.0)

FileTest.readable?(self.to_s) と同じです。

FileTest.readable?(self.to_s) と同じです。


@see FileTest.#readable?

Pathname#readable_real? -> bool (58.0)

FileTest.readable_real?(self.to_s) と同じです。

FileTest.readable_real?(self.to_s) と同じです。


@see FileTest.#readable_real?

絞り込み条件を変える

Pathname#readlines(*args) -> [String] (58.0)

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

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


@see IO.readlines

Pathname#readlink -> Pathname (58.0)

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

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


@see File.readlink...

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

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

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

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


@see File.rename

Pathname#rmdir -> 0 (58.0)

Dir.rmdir(self.to_s) と同じです。

Dir.rmdir(self.to_s) と同じです。


@see Dir.rmdir

Pathname#rmtree -> nil (58.0)

FileUtils.rm_r(self.to_s) と同じです。

FileUtils.rm_r(self.to_s) と同じです。


@see FileUtils.#rm_r

絞り込み条件を変える

Pathname#setgid? -> bool (58.0)

FileTest.setgid?(self.to_s) と同じです。

FileTest.setgid?(self.to_s) と同じです。


@see FileTest.#setgid?

Pathname#setuid? -> bool (58.0)

FileTest.setuid?(self.to_s) と同じです。

FileTest.setuid?(self.to_s) と同じです。


@see FileTest.#setuid?

Pathname#size -> Integer (58.0)

FileTest.size(self.to_s) と同じです。

FileTest.size(self.to_s) と同じです。


@see FileTest.#size

Pathname#size? -> bool (58.0)

FileTest.size?(self.to_s) と同じです。

FileTest.size?(self.to_s) と同じです。


@see FileTest.#size?

Pathname#socket? -> bool (58.0)

FileTest.socket?(self.to_s) と同じです。

FileTest.socket?(self.to_s) と同じです。


@see FileTest.#socket?

絞り込み条件を変える

Pathname#split -> Array (58.0)

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

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

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

pathname
= Pathname("/path/to/sample")
pathname
.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}

@see File.split...

Pathname#stat -> File::Stat (58.0)

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

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


@see File.stat

Pathname#sticky? -> bool (58.0)

FileTest.sticky?(self.to_s) と同じです。

FileTest.sticky?(self.to_s) と同じです。


@see FileTest.#sticky?

Pathname#symlink? -> bool (58.0)

FileTest.symlink?(self.to_s) と同じです。

FileTest.symlink?(self.to_s) と同じです。


@see FileTest.#symlink?

Pathname#sysopen(*args) -> Integer (58.0)

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

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


@see IO.sysopen

絞り込み条件を変える

Pathname#truncate(length) -> 0 (58.0)

File.truncate(self.to_s, length) と同じです。

File.truncate(self.to_s, length) と同じです。


@param length 変更したいサイズを整数で与えます。

@see File.truncate

Pathname#utime(atime, mtime) -> Integer (58.0)

File.utime(atime, mtime, self.to_s) と同じです。

File.utime(atime, mtime, self.to_s) と同じです。

@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。

@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。


@see File.utime

Pathname#world_readable? -> bool (58.0)

FileTest.world_readable?(self.to_s) と同じです。

FileTest.world_readable?(self.to_s) と同じです。


@see FileTest.#world_readable?

Pathname#world_writable? -> bool (58.0)

FileTest.world_writable?(self.to_s) と同じです。

FileTest.world_writable?(self.to_s) と同じです。


@see FileTest.#world_writable?

Pathname#writable? -> bool (58.0)

FileTest.writable?(self.to_s) と同じです。

FileTest.writable?(self.to_s) と同じです。


@see FileTest.#writable?

絞り込み条件を変える

Pathname#writable_real? -> bool (58.0)

FileTest.writable_real?(self.to_s) と同じです。

FileTest.writable_real?(self.to_s) と同じです。


@see FileTest.#writable_real?

Pathname#zero? -> bool (58.0)

FileTest.zero?(self.to_s) と同じです。

...FileTest.zero?(self.to_s) と同じです。


@see FileTest.#zero?
, Pathname#empty?...

Pathname#find(ignore_error: true) -> Enumerator (28.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

ブロックを省略した場合は Enumerator を返します。

@para...

Pathname#find(ignore_error: true) {|pathname| ...} -> nil (28.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

ブロックを省略した場合は Enumerator を返します。

@para...

Pathname#write(string, offset=nil, **opts) -> Integer (28.0)

IO.write(self.to_s, string, offset, **opts)と同じです。

@see IO.write

絞り込み条件を変える