るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

モジュール

検索結果

<< < ... 6 7 8 >>

Enumerable#any?(pattern) -> bool (12.0)

すべての要素が偽である場合に false を返します。 真である要素があれば、ただちに true を返します。

...=== item を評価します。

//emlist[例][ruby]{
require
'set'
p Set[1, 2, 3].any? {|v| v > 3 } # => false
p Set[1, 2, 3].any? {|v| v > 1 } # => true
p Set[].any? {|v| v > 0 } # => false
p Set['ant', 'bear', 'cat'].any?(/d/) # => false
p Set[nil, true, 99].any?...

Shell#echo(*strings) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ンド echo に与える引数を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}...

Shell#glob(pattern) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...の書式については、Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

Shell#tee(file) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...tee に与えるファイル名を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ンド echo に与える引数を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}...

絞り込み条件を変える

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...の書式については、Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

Shell::CommandProcessor#tee(file) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...tee に与えるファイル名を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

Shell::Filter#each(rs = nil) -> () (12.0)

フィルタの一行ずつをblockに渡します。

...行ずつをblockに渡します。

@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。

使用例
require
'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}...

Shell::Filter#echo(*strings) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ンド echo に与える引数を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}...

Shell::Filter#glob(pattern) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...の書式については、Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

絞り込み条件を変える

Shell::Filter#tee(file) -> Shell::Filter (12.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...tee に与えるファイル名を文字列で指定します。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat
(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"...

Shell::Filter#to_a -> [String] (12.0)

実行結果を文字列の配列で返します。

...実行結果を文字列の配列で返します。

require
'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a...

Shell::Filter#to_s -> String (12.0)

実行結果を文字列で返します。

...実行結果を文字列で返します。

require
'shell'
Shell.def_system_command("wc")
sh = Shell.new

sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}...

制御構造 (12.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...引数を指定した場合はループの戻り値はその引数になります。


====[a:next] next

//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}

文法:

next

next val


nextはもっとも内側の...
...が省略された場合には nil を戻り値とします。

トップレベルで return した場合はプログラムが終了します。
require
, load されたファイル内のトップレベルで return した場合は呼び出し元に返ります。

====[a:BEGIN] BEGIN

//emlist[例][...
<< < ... 6 7 8 >>