種類
- インスタンスメソッド (160)
- 特異メソッド (12)
ライブラリ
- pstore (22)
- shell (48)
-
shell
/ command-processor (36) -
shell
/ filter (66)
クラス
- PStore (22)
- Shell (48)
-
Shell
:: CommandProcessor (36) -
Shell
:: Filter (66)
キーワード
- < (6)
- > (6)
- >> (6)
- cat (18)
- chdir (6)
- echo (18)
- glob (18)
-
in
_ transaction (11) -
install
_ system _ commands (6) - out (12)
- tee (18)
-
to
_ s (6) - transaction (11)
-
undef
_ system _ command (6) - | (6)
検索結果
先頭5件
-
Shell
# transact { . . . } -> object (24313.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
:: CommandProcessor # transact { . . . } -> object (24313.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 (24313.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 -> () (12300.0) -
トランザクションの中でなければ例外を発生させます。
トランザクションの中でなければ例外を発生させます。 -
PStore
# transaction(read _ only = false) {|pstore| . . . } -> object (12300.0) -
トランザクションに入ります。 このブロックの中でのみデータベースの読み書きができます。
...トランザクションが使用可能です。
@param read_only 真を指定すると、読み込み専用のトランザクションになります。
@return ブロックで最後に評価した値を返します。
@raise PStore::Error read_only を真にしたときに、データベース......ようした場合に発生します。
例:
require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots # => []
ary = db["root"] = [1,2,3,4]
ary[0] = [1,1.5]
end
db.transaction(true) do |pstore|
pstore["root"] = 'aaa' # => ここで例外発生
e... -
Shell
# chdir(path , &block) -> self (3206.0) -
カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.
...レクトリを変更する.
@param path カレントディレクトリを文字列で指定します.
@param block path で指定したディレクトリで行う操作をブロックで指定します.
使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=......> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...それらを内容とする Filter オブジェクトを返します.
@param files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
..., それらを内容とする Filter オブジェクトを返します.
@param strings シェルコマンド echo に与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|... -
Shell
:: CommandProcessor # glob(pattern) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...れらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。
動作例
require 'shell'
Shell.def_system_comma......nd("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"
}
}
}
@see Dir.[]... -
Shell
:: CommandProcessor # tee(file) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
..., それらを内容とする Filter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |f... -
Shell
:: Filter # <(src) -> self (3206.0) -
srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ ばそれをそのまま入力とする。
...srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ
ばそれをそのまま入力とする。
@param src フィルタの入力を, 文字列もしくは,IO オブジェクトで指定します。
使用例
require 'shell'
Shell.def......_system_command("head")
sh = Shell.new
sh.transact {
(sh.head("-n 30") < "/etc/passwd") > "ugo.txt"
}... -
Shell
:: Filter # cat(*files) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...それらを内容とする Filter オブジェクトを返します.
@param files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
..., それらを内容とする Filter オブジェクトを返します.
@param strings シェルコマンド echo に与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|... -
Shell
:: Filter # glob(pattern) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...れらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。
動作例
require 'shell'
Shell.def_system_comma......nd("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"
}
}
}
@see Dir.[]... -
Shell
:: Filter # tee(file) -> Shell :: Filter (3206.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
..., それらを内容とする Filter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |f...