63件ヒット
[1-63件を表示]
(0.033秒)
別のキーワード
種類
- インスタンスメソッド (35)
- モジュール関数 (22)
- 文書 (6)
クラス
- Pathname (35)
モジュール
- Syslog (22)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (6) -
each
_ entry (13) -
each
_ line (22) - open! (11)
- reopen (11)
検索結果
先頭5件
- Syslog
. # open!(ident= $ 0 , options=Syslog :: LOG _ PID|Syslog :: LOG _ CONS , facility=Syslog :: LOG _ USER) { |syslog| . . . } -> self - Syslog
. # reopen(ident= $ 0 , options=Syslog :: LOG _ PID|Syslog :: LOG _ CONS , facility=Syslog :: LOG _ USER) { |syslog| . . . } -> self - Pathname
# each _ line(*args) -> Enumerator - Pathname
# each _ line(*args) {|line| . . . } -> nil - Pathname
# each _ entry -> Enumerator
-
Syslog
. # open!(ident= $ 0 , options=Syslog :: LOG _ PID|Syslog :: LOG _ CONS , facility=Syslog :: LOG _ USER) { |syslog| . . . } -> self (108.0) -
開いていた syslog を最初にクローズする点を除いてSyslog.#open と同じです。
...log.open!("syslogtest2")
Syslog.log(Syslog::LOG_WARNING, "the sky is falling in %d seconds!", 200)
rescue RuntimeError => err
# RuntimeError は発生しない。
puts err
end
File.foreach('/var/log/system.log'){|line|
print line if line =~ /the sky is/
}
@see Syslog.#open... -
Syslog
. # reopen(ident= $ 0 , options=Syslog :: LOG _ PID|Syslog :: LOG _ CONS , facility=Syslog :: LOG _ USER) { |syslog| . . . } -> self (108.0) -
開いていた syslog を最初にクローズする点を除いてSyslog.#open と同じです。
...log.open!("syslogtest2")
Syslog.log(Syslog::LOG_WARNING, "the sky is falling in %d seconds!", 200)
rescue RuntimeError => err
# RuntimeError は発生しない。
puts err
end
File.foreach('/var/log/system.log'){|line|
print line if line =~ /the sky is/
}
@see Syslog.#open... -
Pathname
# each _ line(*args) -> Enumerator (44.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......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 (44.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......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 _ entry -> Enumerator (38.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...Dir.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>
# => #<Pathna......me:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@see Dir.foreach... -
Pathname
# each _ entry {|pathname| . . . } -> nil (38.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...Dir.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>
# => #<Pathna......me:opt>
//}
@see Dir.foreach......Dir.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>
# => #<Pathna......me:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@see Dir.foreach... -
NEWS for Ruby 2
. 6 . 0 (12.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ァイルオープンを表すモード文字 'x' が追加されました。 11258
* Kernel
* 別名
* Object#then が Object#yield_self の別名として追加されました。 14594
* 新規オプション
* Kernel.#Complex, Kernel.#Float, Kernel.#Integer,
Kernel.......推奨になる予定で、
今は警告が出ます。 14643
* File
* File.read, File.binread, File.write, File.binwrite,
File.foreach, File.readlines はパスがパイプ文字 '|' で始まっていても
外部コマンドを実行しなくなりました。 14245
*...