るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. bigdecimal to_r
  5. fileutils cp_r

キーワード

検索結果

Shell#command_processor -> Shell::CommandProcessor (12405.0)

@todo

@todo

Shell#transact { ... } -> object (6110.0)

ブロック中で shell を self として実行します。

...ブロック中で shell を self として実行します。

例:

r
equire 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}...

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (212.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@param...
...す。

@param file2 文字列でファイルへのパスを指定します。

r
equire 'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
r
escue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:ex...
...ists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (212.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...Kernel.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@param...
...す。

@param file2 文字列でファイルへのパスを指定します。

r
equire 'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
r
escue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:ex...
...ists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell#cat(*files) -> Shell::Filter (110.0)

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

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

@param files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
r
equire 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each {...

絞り込み条件を変える

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

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

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

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
r
equire 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |fi...

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

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

...ilter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

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

@see Dir.[]...

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

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

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

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
r
equire 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each {...