るりまサーチ

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

別のキーワード

  1. pathname glob
  2. pathname to_path
  3. pathname open
  4. pathname opendir
  5. pathname realpath

ライブラリ

クラス

キーワード

検索結果

Pathname#each_entry {|pathname| ... } -> nil (21193.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

....foreach(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>
//}

@see Dir.foreach...
....foreach(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#each_entry -> Enumerator (21093.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

....foreach(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#each_line(*args) -> Enumerator (21076.0)

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

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

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

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

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

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

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "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
("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

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

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

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

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

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

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

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

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "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
("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

NEWS for Ruby 2.6.0 (48.0)

NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...推奨になる予定で、
今は警告が出ます。 14643

* File
* File.read, File.binread, File.write, File.binwrite,
File.foreach, File.readlines はパスがパイプ文字 '|' で始まっていても
外部コマンドを実行しなくなりました。 14245

*...
...りました。
* BigDecimal.new はバージョン 2.0 で削除予定です。

* Pathname
* Pathname#read, Pathname#binread, Pathname#write,
Pathname
#binwrite, Pathname#each_line, Pathname#readlines は
パスがパイプ文字 '|' で始まっていても外部コマンド...

絞り込み条件を変える

NEWS for Ruby 2.4.0 (24.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...half には :even, :up, :down が指定可能です。 12548 12958 12953

* IO
* IO#gets, IO#readline, IO#each_line, IO#readlines, IO.foreach
chomp というキーワード引数を受け付けるようになりました。12553

* Kernel
* Kernel#clone は freeze とい...
...ト 4217
* Net::FTP.new の引数をキーワード引数に対応しました
* Net::FTP#status に省略可能なキーワード引数 pathname を追加
solebox による貢献。https://github.com/ruby/ruby/pull/1478 12965

* openssl
* Ruby/OpenSSL 2.0
OpenSSL は https...
...して残っています。

* optparse
* OptionParser#parseやOptionParser#orderにキーワード引数 into を追加 11191

* pathname
* Pathname#empty? を追加 12596

* readline
* Readline.quoting_detection_proc, Readline.quoting_detection_proc= を追加
12659

* re...