別のキーワード
種類
- 文書 (85)
- 特異メソッド (72)
- インスタンスメソッド (57)
ライブラリ
- etc (48)
- pathname (39)
- resolv (36)
-
shell
/ filter (6)
クラス
-
Etc
:: Group (24) -
Etc
:: Passwd (24) - Pathname (39)
- Resolv (24)
-
Resolv
:: Hosts (12) -
Shell
:: Filter (6)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
-
each
_ address (12) -
each
_ child (24) -
each
_ entry (15) -
each
_ name (24) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12)
検索結果
先頭5件
-
Etc
:: Group . each {|entry| . . . } -> Etc :: Group (29225.0) -
/etc/group に含まれるエントリを一つずつブロックに渡して評価します。 ブロックを省略した場合は Enumerator を返します。
.../etc/group に含まれるエントリを一つずつブロックに渡して評価します。
ブロックを省略した場合は Enumerator を返します。
@see Etc.#getpwent... -
Etc
:: Passwd . each {|entry| . . . } -> Etc :: Passwd (29225.0) -
/etc/passwd に含まれるエントリを一つずつブロックに渡して評価します。 ブロックを省略した場合は Enumerator を返します。
.../etc/passwd に含まれるエントリを一つずつブロックに渡して評価します。
ブロックを省略した場合は Enumerator を返します。
@see Etc.#getpwent... -
Etc
:: Group . each -> Enumerator (29125.0) -
/etc/group に含まれるエントリを一つずつブロックに渡して評価します。 ブロックを省略した場合は Enumerator を返します。
.../etc/group に含まれるエントリを一つずつブロックに渡して評価します。
ブロックを省略した場合は Enumerator を返します。
@see Etc.#getpwent... -
Etc
:: Passwd . each -> Enumerator (29125.0) -
/etc/passwd に含まれるエントリを一つずつブロックに渡して評価します。 ブロックを省略した場合は Enumerator を返します。
.../etc/passwd に含まれるエントリを一つずつブロックに渡して評価します。
ブロックを省略した場合は Enumerator を返します。
@see Etc.#getpwent... -
Shell
:: Filter # each(rs = nil) -> () (18113.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 (6142.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] (6142.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 (6114.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 (6114.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
. each _ address(name) {|address| . . . } -> () (6107.0) -
ホスト名 name の IP アドレスをルックアップし、 各ルックアップ結果のアドレスに対してブロックを評価します。
...ホスト名 name の IP アドレスをルックアップし、
各ルックアップ結果のアドレスに対してブロックを評価します。
ルックアップは /etc/hosts, DNS の順で行います。
@param name ホスト名を文字列で与えます。...