57件ヒット
[1-57件を表示]
(0.076秒)
別のキーワード
ライブラリ
- pathname (39)
- resolv (12)
-
shell
/ filter (6)
クラス
- Pathname (39)
-
Resolv
:: Hosts (12) -
Shell
:: Filter (6)
キーワード
-
each
_ child (24) -
each
_ entry (15) -
each
_ name (12)
検索結果
先頭5件
-
Shell
:: Filter # each(rs = nil) -> () (18114.0) -
フィルタの一行ずつをblockに渡します。
...行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}... -
Pathname
# each _ child(with _ directory = true) -> Enumerator (6143.0) -
self.children(with_directory).each と同じです。
...ectory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #......Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:/usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
#... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (6143.0) -
self.children(with_directory).each と同じです。
...ectory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #......Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:/usr/local/var>
Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
#... -
Pathname
# each _ entry -> Enumerator (6115.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...reach(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 {|pathname| . . . } -> nil (6115.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......reach(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... -
Resolv
:: Hosts # each _ name(address) {|name| . . . } -> () (6108.0) -
IP アドレス address のホスト名をルックアップし、 各ルックアップ結果のホスト名に対してブロックを評価します。
...IP アドレス address のホスト名をルックアップし、
各ルックアップ結果のホスト名に対してブロックを評価します。
ルックアップは /etc/hosts, DNS の順で行います。
@param address IPアドレスを文字列で与えます。...