297件ヒット
[1-100件を表示]
(0.045秒)
ライブラリ
- English (11)
- ビルトイン (106)
- csv (44)
- mkmf (11)
- readline (11)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (18) - timeout (19)
- tracer (11)
クラス
- CSV (33)
- File (11)
- IO (29)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (18) - Tracer (11)
モジュール
-
GC
:: Profiler (11) - Kernel (77)
- Readline (11)
- Timeout (19)
キーワード
-
$ DEFAULT _ OUTPUT (11) -
$ stdout (11) - > (6)
- >> (6)
- CSV (11)
-
NEWS for Ruby 2
. 2 . 0 (10) - Ruby用語集 (11)
-
cgi
/ session (11) - chmod (11)
-
cpp
_ command (11) - filter (33)
- output= (11)
- pread (7)
- read (11)
- report (11)
-
ruby 1
. 6 feature (11) -
rubygems
/ commands / outdated _ command (11) - spawn (44)
- stdout= (11)
- sysread (11)
- timeout (19)
検索結果
先頭5件
-
File
# chmod(mode) -> 0 (21012.0) -
ファイルのモードを指定された mode に変更します。
...EXXX が発生し
ます。
@param mode chmod(2) と同様に整数で指定します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
f = File.new("out", "w");
f.chmod(0644) #=> 0
//}... -
Shell
# out(dev = STDOUT , &block) -> () (18219.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@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 # out(dev = STDOUT , &block) -> () (18219.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@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
:: Filter # out(dev = STDOUT , &block) -> () (18219.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...ェクトなどで指定します。
@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")
}
}... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (9112.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......ト
require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d:......Kernel.#openを使用するなどの工夫が必要です。
例 外部コマンドのタイムアウト
require 'timeout'
# テスト用のシェルをつくる。
File.open("loop.sh", "w"){|fp|
fp.print <<SHELL_EOT
#!/bin/bash
S="scale=10"
M=32767
trap 'echo "$S; $m1/($m1+$m2... -
Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object (9112.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......ト
require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d:......Kernel.#openを使用するなどの工夫が必要です。
例 外部コマンドのタイムアウト
require 'timeout'
# テスト用のシェルをつくる。
File.open("loop.sh", "w"){|fp|
fp.print <<SHELL_EOT
#!/bin/bash
S="scale=10"
M=32767
trap 'echo "$S; $m1/($m1+$m2... -
Readline
. output=(output) (6238.0) -
readline メソッドで使用する出力用の File オブジェクト output を指定します。 戻り値は指定した File オブジェクト output です。
...readline メソッドで使用する出力用の File オブジェクト output を指定します。
戻り値は指定した File オブジェクト output です。
@param output File オブジェクトを指定します。... -
Kernel
$ $ DEFAULT _ OUTPUT -> IO (6118.0) -
$> の別名
...$> の別名
require "English"
dout = $DEFAULT_OUTPUT.dup
$DEFAULT_OUTPUT.reopen("out.txt", "w")
print "foo"
$DEFAULT_OUTPUT.close
$DEFAULT_OUTPUT = dout
p "bar" # => bar
p File.read("out.txt") #=> foo... -
Tracer
. stdout=(fp) (6106.0) -
トレース出力先を変更します。
...トレース出力先を変更します。
@param fp 新しいトレース出力先を指定します。
require 'tracer'
fp = File.open('temptrace.txt', "w")
Tracer.stdout = fp
Tracer.on {
puts "Hello"
}
fp.close... -
rubygems
/ commands / outdated _ command (6012.0) -
更新が必要な Gem パッケージの一覧を出力するためのライブラリです。
...更新が必要な Gem パッケージの一覧を出力するためのライブラリです。
Usage: gem outdated [options]
Options:
--platform PLATFORM 指定されたプラットフォームに関する情報を表示します
Local/Remote Options:
-l, --local......-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バックトレースを表示します... -
GC
:: Profiler . report(out = $ stdout) -> nil (3223.0) -
GC::Profiler.result の結果を out に出力します。
...GC::Profiler.result の結果を out に出力します。
@param out 結果の出力先を指定します。デフォルトは $stdout です。
//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.report
# => GC 4 invokes.
# Index Invoke Time(sec) Use Size(byte) Total Si......ze(byte) Total Object GC Time(ms)
# 1 0.019 303720 1269840 31746 1.25899999999999967493
//}
@see GC::Profiler.result...