るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. pop n_mails
  5. openssl n

ライブラリ

クラス

キーワード

検索結果

Shell::CommandProcessor#transact { ... } -> object (33314.0)

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

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

例:

require '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#transact { ... } -> object (30314.0)

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

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

例:

require '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::Filter#transact { ... } -> object (30314.0)

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

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

例:

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

PStore#in_transaction -> () (18301.0)

トランザクションの中でなければ例外を発生させます。

トランザクションの中でなければ例外を発生させます。

PStore#transaction(read_only = false) {|pstore| ... } -> object (18301.0)

トランザクションに入ります。 このブロックの中でのみデータベースの読み書きができます。

...ランザクションが使用可能です。

@param read_only 真を指定すると、読み込み専用のトランザクションになります。

@return ブロックで最後に評価した値を返します。

@raise PStore::Error read_only を真にしたときに、データベースを...
...した場合に発生します。

例:

require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots # => []
a
ry = db["root"] = [1,2,3,4]
a
ry[0] = [1,1.5]
end

db.transaction(true) do |pstore|
pstore["root"] = 'aaa' # => ここで例外発生
end...

絞り込み条件を変える

Shell::CommandProcessor#cat(*files) -> Shell::Filter (9113.0)

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

...します.

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

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

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

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

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

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

@see Dir.[]...

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

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

...返します.

@param strings シェルコマンド 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#out(dev = STDOUT, &block) -> () (6029.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ll#transact を呼び出しその結果を dev に出力します。

@param dev 出力先をIO オブジェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new...
...File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

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

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

...返します.

@param file シェルコマンド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#glob(pattern) -> Shell::Filter (213.0)

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

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

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

@see Dir.[]...

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

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

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

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

@see Dir.[]...

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

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

...返します.

@param strings シェルコマンド 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#echo(*strings) -> Shell::Filter (113.0)

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

...返します.

@param strings シェルコマンド 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"
}
}
}...