ライブラリ
- ビルトイン (6)
- benchmark (9)
- fileutils (1)
- readline (1)
-
rubygems
/ defaults (1) -
rubygems
/ source _ info _ cache (4) - shell (8)
-
shell
/ command-processor (5) -
shell
/ filter (13) -
shell
/ system-command (9) -
win32
/ resolv (1)
クラス
-
Benchmark
:: Tms (5) - Dir (6)
-
Gem
:: SourceInfoCache (4) - Shell (8)
-
Shell
:: CommandProcessor (5) -
Shell
:: Filter (13) -
Shell
:: SystemCommand (9) -
Win32
:: Resolv (1)
キーワード
- < (1)
- >> (1)
- FORMAT (2)
- active? (1)
-
alias
_ command (1) - benchmark (1)
- bm (1)
- bmbm (1)
- cat (3)
- command (1)
- cstime (1)
-
def
_ system _ command (1) -
default
_ system _ source _ cache _ dir (1) - echo (3)
- entries (1)
- foreach (2)
- format (1)
-
get
_ hosts _ path (1) - glob (3)
-
install
_ system _ commands (2) - kill (1)
-
latest
_ system _ cache _ file (2) - name (1)
- new (2)
- notify (2)
- open (2)
- out (1)
- readline (1)
-
rexml
/ parsers / ultralightparser (1) -
ruby 1
. 8 . 4 feature (1) -
start
_ import (1) - stime (1)
-
system
_ cache _ file (2) - tee (3)
- terminate (1)
-
to
_ a (1) -
to
_ s (1) - transact (1)
-
unalias
_ command (1) - uptodate? (1)
- wait? (1)
- | (1)
検索結果
先頭5件
-
Shell
:: Filter # system(command , *opts) -> Shell :: SystemCommand (73276.0) -
command を実行する.
command を実行する.
@param command 実行するコマンドのパスを文字列で指定します。
@param opts command のオプションを文字列で指定します。複数可。
使用例:
require 'shell'
Shell.verbose = false
sh = Shell.new
print sh.system("ls", "-l")
Shell.def_system_command("head")
sh.system("ls", "-l") | sh.head("-n 3") > STDOUT -
Shell
:: Filter # >(to) -> self (72355.0) -
toをフィルタの出力とする。 toが, 文字列ならばファイルに, IOオブジェクトであれ ばそれをそのまま出力とする。
toをフィルタの出力とする。 toが, 文字列ならばファイルに, IOオブジェクトであれ
ばそれをそのまま出力とする。
@param to 出力先を指定します。文字列ならばファイルに,IOオブジェクトならばそれに出力します。
使用例
require 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") > File.open("tail.out", "w")
#(sh.tail("-n 3") < "/e... -
Gem
:: SourceInfoCache # latest _ system _ cache _ file -> String (64204.0) -
最新のシステムキャッシュのファイル名を返します。
最新のシステムキャッシュのファイル名を返します。 -
Gem
:: SourceInfoCache # system _ cache _ file -> String (64204.0) -
システムキャッシュファイルの名前を返します。
システムキャッシュファイルの名前を返します。 -
Gem
:: SourceInfoCache . latest _ system _ cache _ file -> String (64204.0) -
最新のシステムキャッシュのファイル名を返します。
最新のシステムキャッシュのファイル名を返します。 -
Gem
:: SourceInfoCache . system _ cache _ file -> String (64204.0) -
システムキャッシュのファイル名を返します。
システムキャッシュのファイル名を返します。 -
Gem
. default _ system _ source _ cache _ dir -> String (55204.0) -
デフォルトのシステム全体のソースキャッシュファイルのパスを返します。
デフォルトのシステム全体のソースキャッシュファイルのパスを返します。 -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (45970.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... -
Shell
:: CommandProcessor . install _ system _ commands(prefix = "sys _ ") -> () (45904.0) -
全てのシステムコマンドをメソッドとして定義します。
全てのシステムコマンドをメソッドとして定義します。
既に定義されているコマンドを再定義することはありません。
デフォルトでは全てのコマンドに "sys_" というプレフィクスが付きます。
また、メソッド名として使用できない文字は全て "_" に置換してメソッドを定義します。
このメソッドの実行中に発生した例外は単に無視されます。
@param prefix プレフィクスを指定します。 -
Shell
:: SystemCommand # active? -> bool (36601.0) -
@todo
@todo -
Shell
:: SystemCommand # kill(signal) -> Integer (36601.0) -
自身のプロセスにシグナルを送ります。
自身のプロセスにシグナルを送ります。
@param signal シグナルを整数かその名前の文字列で指定します。
負の値を持つシグナル(あるいはシグナル名の前に-)を指定すると、
プロセスではなくプロセスグループにシグナルを送ります。
@see Process.#kill -
Shell
:: SystemCommand # notify(*opts) -> String (36601.0) -
@todo
@todo
@param opts
@see Shell#notify -
Shell
:: SystemCommand # notify(*opts) {|message| . . . } -> String (36601.0) -
@todo
@todo
@param opts
@see Shell#notify -
Shell
:: SystemCommand # start _ import -> () (36601.0) -
@todo
@todo -
Shell
:: SystemCommand # terminate -> () (36601.0) -
@todo
@todo -
Shell
:: SystemCommand # wait? -> bool (36601.0) -
@todo
@todo -
Shell
:: Filter # >>(to) -> self (36319.0) -
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば
それをそのまま出力とする。
@param to 出力先を指定します。文字列ならばファイルに、IOオブジェクトならばそれに出力します。
使用例
require 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> ... -
rexml
/ parsers / ultralightparser (36091.0) -
パース結果を配列で作られた木構造により返すパーサ。
パース結果を配列で作られた木構造により返すパーサ。
REXML::Parsers::UltraLightParser.new でパーサオブジェクトを
生成し、REXML::Parsers::UltraLightParser#parse でパースし
その結果の木構造を返します。
===[a:nodes] ノードの表現
REXML::Parsers::UltraLightParser#parse が返す
XML の各ノードは配列で表現されます。
配列の最初の要素はシンボルでノードの種類を表わし、2番目以降の要素で
そのノードの情報を保持しています。
例えばテキストノードは [:text, テキ... -
Dir
. foreach(path , encoding: Encoding . find("filesystem")) -> Enumerator (28801.0) -
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ブロックが与えられなかった場合、各エントリを文字列として保持する
Enumerator オブジェクトを返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//... -
Dir
. foreach(path , encoding: Encoding . find("filesystem")) {|file| . . . } -> nil (28801.0) -
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ブロックが与えられなかった場合、各エントリを文字列として保持する
Enumerator オブジェクトを返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//... -
Benchmark
. # benchmark(caption = "" , label _ width = nil , fmtstr = nil , *labels) {|rep| . . . } -> [Benchmark :: Tms] (28309.0) -
Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示されます。
@param caption レポートの一行目に表示する文字列を指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用されます。... -
Readline
. # readline(prompt = "" , add _ hist = false) -> String | nil (28291.0) -
prompt を出力し、ユーザからのキー入力を待ちます。 エンターキーの押下などでユーザが文字列を入力し終えると、 入力した文字列を返します。 このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。 何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、 ユーザからの入力がない場合は nil を返します。
prompt を出力し、ユーザからのキー入力を待ちます。
エンターキーの押下などでユーザが文字列を入力し終えると、
入力した文字列を返します。
このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。
何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、
ユーザからの入力がない場合は nil を返します。
本メソッドはスレッドに対応しています。
入力待ち状態のときはスレッドコンテキストの切替えが発生します。
入力時には行内編集が可能で、vi モードと Emacs モードが用意されています。
デフォルトは Emacs モードです。
... -
Shell
. def _ system _ command(command , path = command) -> nil (28258.0) -
Shell のメソッドとして command を登録します.
Shell のメソッドとして command を登録します.
OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.
@param command Shell のメソッドとして定義するコマンドを文字列で指定します。
@param path command のパスを指定します。
指定しない場合はcommand と同じになります。
例)
require 'shell'
Shell.def_system_command "ls"
# ls ... -
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (27985.0) -
コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
@param alias エイリアスの名前を文字列で指定します.
@param command コマンド名を文字列で指定します.
@param opts command で指定したコマンドのオプションを指定します.
使用例: ls -la | sort -k 5 のような例。
require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "... -
Shell
. unalias _ command(alias) -> () (27937.0) -
commandのaliasを削除します.
commandのaliasを削除します.
@param alias 削除したいエイリアスの名前を文字列で指定します。
@raise NameError alias で指定したコマンドが無い場合に発生します。
使用例: 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.trans... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (27919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする 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") >> "al... -
Win32
:: Resolv . # get _ hosts _ path -> String | nil (27919.0) -
hosts ファイルのパスを返します。ファイルが存在しない場合は nil を返します。
hosts ファイルのパスを返します。ファイルが存在しない場合は nil を返します。
例:
require "win32/resolv"
p Win32::Resolv.get_hosts_path #=> "C:\Windows\System32\drivers\etc\hosts" -
Benchmark
:: Tms # cstime -> Float (27649.0) -
子プロセスの System CPU time
子プロセスの System CPU time -
Benchmark
:: Tms # stime -> Float (27649.0) -
System CPU time
System CPU time -
Shell
:: Filter # cat(*files) -> Shell :: Filter (19219.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|
echo(l) | tee(file + ".tee") >> "al... -
Shell
:: Filter # tee(file) -> Shell :: Filter (19219.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|
echo(l) | tee(file + ".tee") >> "all... -
Dir
. entries(path , encoding: Encoding . find("filesystem")) -> [String] (19201.0) -
ディレクトリ path に含まれるファイルエントリ名の 配列を返します。
ディレクトリ path に含まれるファイルエントリ名の
配列を返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
Dir.entries('.') #=> [".", "..", "bar", "foo"]
... -
Shell
# echo(*strings) -> Shell :: Filter (18919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする 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") >> "al... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (18919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする 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") >> "al... -
Shell
:: Filter # glob(pattern) -> Shell :: Filter (18919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、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|
... -
Shell
:: Filter # |(filter) -> object (18745.0) -
パイプ結合を filter に対して行います。
パイプ結合を filter に対して行います。
@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(... -
FileUtils
. # uptodate?(newer , older _ list , options = nil) -> bool (18637.0) -
newer が、older_list に含まれるすべてのファイルより新しいとき真。 存在しないファイルは無限に古いとみなされます。
newer が、older_list に含まれるすべてのファイルより新しいとき真。
存在しないファイルは無限に古いとみなされます。
@param newer ファイルを一つ指定します。
@param older_list ファイル名の配列を指定します。
@param options どのようなオプションも指定することはできません。
@raise ArgumentError options にオプションを指定した場合に発生します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.uptodate?('hello.o', ['hello.... -
Shell
:: Filter # to _ a -> [String] (18619.0) -
実行結果を文字列の配列で返します。
実行結果を文字列の配列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a -
Shell
:: Filter # to _ s -> String (18619.0) -
実行結果を文字列で返します。
実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
} -
Shell
:: SystemCommand # command -> String (18601.0) -
@todo
@todo
コマンド名を返します。 -
Shell
:: SystemCommand # name -> String (18601.0) -
@todo
@todo
コマンド名を返します。 -
Shell
:: Filter # transact { . . . } -> object (18391.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 # <(src) -> self (18337.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 # out(dev = STDOUT , &block) -> () (18337.0) -
Shell#transact を呼び出しその結果を dev に出力します。
Shell#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")
}
} -
Dir
. new(path , encoding: Encoding . find("filesystem")) -> Dir (10873.0) -
path に対するディレクトリストリームをオープンして返します。
path に対するディレクトリストリームをオープンして返します。
ブロックを指定して呼び出した場合は、ディレクトリストリームを
引数としてブロックを実行します。ブロックの実行が終了すると、
ディレクトリは自動的にクローズされます。
ブロックの実行結果を返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@rai... -
Dir
. open(path , encoding: Encoding . find("filesystem")) -> Dir (10873.0) -
path に対するディレクトリストリームをオープンして返します。
path に対するディレクトリストリームをオープンして返します。
ブロックを指定して呼び出した場合は、ディレクトリストリームを
引数としてブロックを実行します。ブロックの実行が終了すると、
ディレクトリは自動的にクローズされます。
ブロックの実行結果を返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@rai... -
Dir
. open(path , encoding: Encoding . find("filesystem")) {|dir| . . . } -> object (10873.0) -
path に対するディレクトリストリームをオープンして返します。
path に対するディレクトリストリームをオープンして返します。
ブロックを指定して呼び出した場合は、ディレクトリストリームを
引数としてブロックを実行します。ブロックの実行が終了すると、
ディレクトリは自動的にクローズされます。
ブロックの実行結果を返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@rai... -
Benchmark
:: Tms . new(utime = 0 . 0 , stime = 0 . 0 , cutime = 0 . 0 , cstime = 0 . 0 , real = 0 . 0 , label = nil) -> Benchmark :: Tms (10837.0) -
新しい Benchmark::Tms オブジェクトを生成して返します。
新しい Benchmark::Tms オブジェクトを生成して返します。
@param utime User CPU time
@param stime System CPU time
@param cutime 子プロセスの User CPU time
@param cstime 子プロセスの System CPU time
@param real 実経過時間
@param label ラベル -
Shell
# cat(*files) -> Shell :: Filter (10219.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|
echo(l) | tee(file + ".tee") >> "al... -
Shell
# tee(file) -> Shell :: Filter (10219.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|
echo(l) | tee(file + ".tee") >> "all... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (10219.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|
echo(l) | tee(file + ".tee") >> "al... -
Shell
:: CommandProcessor # tee(file) -> Shell :: Filter (10219.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|
echo(l) | tee(file + ".tee") >> "all... -
Benchmark
. # bm(label _ width = 0 , *labels) {|rep| . . . } -> [Benchmark :: Tms] (10045.0) -
Benchmark.#benchmark メソッドの引数を簡略化したものです。
Benchmark.#benchmark メソッドの引数を簡略化したものです。
Benchmark.#benchmark メソッドと同様に働きます。
@param label_width ラベルの幅を指定します。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。
//emlist[][ruby]{
require 'benchmark'
n = 50000
Benchmark.bm do |x|
x.report { for i in 1..n; a = "1"; end }
x.report { n.t... -
Benchmark
. # bmbm(width = 0) {|job| . . . } -> [Benchmark :: Tms] (9919.0) -
Benchmark::Job オブジェクトを生成して、それを引数として与えられたブロックを 実行します。
Benchmark::Job オブジェクトを生成して、それを引数として与えられたブロックを
実行します。
ベンチマークの結果は GC の影響によって歪められてしまうことがあります。
このメソッドは与えられたブロックを二度実行する事によってこの影響を最小化します。
一回目は実行環境を安定化するためにリハーサルとして実行します。二回目は本番として
実行します。
二回目のブロック実行の前に GC.start を実行しますが、この実行時間は計測には
含まれません。しかし、実際にはこのメソッドを使用しても、GC などの影響を分離する
ことは保証されません。
@param width ラベルの幅を... -
Shell
# glob(pattern) -> Shell :: Filter (9919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、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|
... -
Shell
:: CommandProcessor # glob(pattern) -> Shell :: Filter (9919.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、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|
... -
Benchmark
:: FORMAT -> String (9637.0) -
Benchmark.#benchmark の第三引数のデフォルト値。
Benchmark.#benchmark の第三引数のデフォルト値。
: %u
user CPU time で置き換えられます。Benchmark::Tms#utime
: %y
system CPU time で置き換えられます(Mnemonic: y of "s*y*stem")。Benchmark::Tms#stime
: %U
子プロセスの user CPU time で置き換えられます。Benchmark::Tms#cutime
: %Y
子プロセスの system CPU time で置き換えられます。Benchmark::Tms#cstime
: %t
t... -
Benchmark
:: Tms # format(fmtstr = nil , *args) -> String (9637.0) -
self を指定されたフォーマットで整形して返します。
self を指定されたフォーマットで整形して返します。
このメソッドは Kernel.#format のようにオブジェクトを整形しますが、
以下の拡張を使用することができます。
: %u
user CPU time で置き換えられます。Benchmark::Tms#utime
: %y
system CPU time で置き換えられます(Mnemonic: y of "s*y*stem")。Benchmark::Tms#stime
: %U
子プロセスの user CPU time で置き換えられます。Benchmark::Tms#cutime
: %Y
子プロセスの s... -
Benchmark
:: Tms :: FORMAT -> String (9637.0) -
Benchmark.#benchmark の第三引数のデフォルト値。
Benchmark.#benchmark の第三引数のデフォルト値。
: %u
user CPU time で置き換えられます。Benchmark::Tms#utime
: %y
system CPU time で置き換えられます(Mnemonic: y of "s*y*stem")。Benchmark::Tms#stime
: %U
子プロセスの user CPU time で置き換えられます。Benchmark::Tms#cutime
: %Y
子プロセスの system CPU time で置き換えられます。Benchmark::Tms#cstime
: %t
t... -
ruby 1
. 8 . 4 feature (1765.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
ruby 1.8.4 feature
ruby 1.8.4 での ruby 1.8.3 からの変更点です。
掲載方針
*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。
以下は各変更点に付けるべきタグです。
記号について(特に重要なものは大文字(主観))
# * カテゴリ
# * [ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加され...