るりまサーチ

最速Rubyリファレンスマニュアル検索!
166件ヒット [1-100件を表示] (0.215秒)
トップページ > クエリ:i[x] > クエリ:E[x] > クエリ:transact[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. ipaddr to_i

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Shell::Filter#transact { ... } -> object (24213.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#transaction(read_only = false) {|pstore| ... } -> object (15300.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]
e
nd

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

PStore#in_transaction -> () (15200.0)

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

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

Shell.install_system_commands(pre = "sys_") -> () (12206.0)

system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.

...system_path上にある全ての実行可能ファイルをShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.

@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。

使用例: ls -l | head -n 5...
...のような例。

require 'shell'
Shell.install_system_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l|
puts l
}
}...

Shell.alias_command(alias, command, *opts) {...} -> self (9306.0)

コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

...コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

@param alias エイリアスの名前を文字列で指定します.

@param command コマンド名を文字列で指定します.

@param...
...を指定します.

使用例: ls -la | sort -k 5 のような例。

require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}...

絞り込み条件を変える

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

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

...する 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|
e
cho(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

Shell.unalias_command(alias) -> () (9206.0)

commandのaliasを削除します.

...mandのaliasを削除します.

@param alias 削除したいエイリアスの名前を文字列で指定します。

@raise NameError alias で指定したコマンドが無い場合に発生します。

使用例: ls -la | sort -k 5 のような例。
require 'shell'
Shell.def_system_comman...
...ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}
Shell.unalias_command("lsla")
begin
Shell.unalias_command("lsla")
rescue NameError => err
puts err
e
nd...

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

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

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

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

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

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

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

...する 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|
e
cho(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

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

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

...する 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|
e
cho(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

絞り込み条件を変える

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

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

...る 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::Filter#glob(pattern) -> Shell::Filter (6306.0)

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

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

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

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

@see Dir.[]...

Shell::Filter#|(filter) -> object (6236.0)

パイプ結合を filter に対して行います。

...ilter に対して行います。

@param filter Shell::Filter オブジェクトを指定します。

@return filter を返します。

使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Shell.new
sh.transact...
...{
i
= 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i
+= 1
e
nd
}...

Shell#chdir(path, &block) -> self (6206.0)

カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.

...レクトリを文字列で指定します.

@param block path で指定したディレクトリで行う操作をブロックで指定します.

使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}...

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

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

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

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

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

絞り込み条件を変える

<< 1 2 > >>