るりまサーチ

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

別のキーワード

  1. string b
  2. _builtin b
  3. b string
  4. b
  5. b _builtin

モジュール

検索結果

<< 1 2 3 ... > >>

Kernel.#system(command, options={}) -> bool | nil (18236.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。
コマンドが実行できなかったのか、コマンドが失敗したのかは...
...ル経由でコマンドを実行][ruby]{
system
("echo *") # => true
# fileA fileB fileC ...
//}

//emlist[exceptionオプションを指定][ruby]{
system
("sad", exception: true) # => Errno::ENOENT (No such file or directory - sad)
system
('ruby -e "exit(false)"', exception: true)...
...# => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system
('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(env, command, options={}) -> bool | nil (18236.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。
コマンドが実行できなかったのか、コマンドが失敗したのかは...
...ル経由でコマンドを実行][ruby]{
system
("echo *") # => true
# fileA fileB fileC ...
//}

//emlist[exceptionオプションを指定][ruby]{
system
("sad", exception: true) # => Errno::ENOENT (No such file or directory - sad)
system
('ruby -e "exit(false)"', exception: true)...
...# => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system
('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(env, program, *args, options={}) -> bool | nil (18221.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。コマンドが実行できなかったのか、コマンドが失敗したの
かは...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system
("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(program, *args, options={}) -> bool | nil (18221.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。コマンドが実行できなかったのか、コマンドが失敗したの
かは...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system
("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(command, options={}) -> bool | nil (18218.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。
コマンドが実行できなかったのか、コマンドが失敗したのかは...
...文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash

//emlist[シェル経由でコマンドを実行][ruby]{
system
("echo *") # => true
# fileA fileB fileC ...
//}


@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

絞り込み条件を変える

Kernel.#system(env, command, options={}) -> bool | nil (18218.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。
コマンドが実行できなかったのか、コマンドが失敗したのかは...
...文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash

//emlist[シェル経由でコマンドを実行][ruby]{
system
("echo *") # => true
# fileA fileB fileC ...
//}


@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(env, program, *args, options={}) -> bool | nil (18218.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。コマンドが実行できなかったのか、コマンドが失敗したの
かは...
...s オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system
("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(program, *args, options={}) -> bool | nil (18218.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...ドを実行することができなかった場合、多くのシェルはステータス
127 を返します。シェルを介さない場合は Ruby の子プロセスがステータス
127 で終了します。コマンドが実行できなかったのか、コマンドが失敗したの
かは...
...s オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system
("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Benchmark.#benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> [Benchmark::Tms] (9418.0)

Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

...
B
enchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示...
...指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用されます。
@param labels ブロックが Benchmark::Tms オブジェクト...
...す。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 で置き換えられます。Benchmar...

Benchmark.#bmbm(width = 0) {|job| ... } -> [Benchmark::Tms] (9206.0)

Benchmark::Job オブジェクトを生成して、それを引数として与えられたブロックを 実行します。

...
B
enchmark::Job オブジェクトを生成して、それを引数として与えられたブロックを
実行します。

ベンチマークの結果は GC の影響によって歪められてしまうことがあります。
このメソッドは与えられたブロックを二度実行する...
...分離する
ことは保証されません。

@param width ラベルの幅を指定します。

//emlist[][ruby]{
require 'benchmark'

array = (1..1000000).map { rand }

B
enchmark.bmbm do |x|
x.report("sort!") { array.dup.sort! }
x.report("sort") { array.dup.sort }
end

#=>
#
# Rehearsal --...
...11.938000 ( 12.756000)
# sort 13.048000 0.020000 13.068000 ( 13.857000)
# ------------------------------- total: 25.006000sec
#
# user system total real
# sort! 12.959000 0.010000 12.969000 ( 13.793000)
# sort 12.007000 0.000000 12.007000 ( 12.791000)
//}...

絞り込み条件を変える

Zlib::OS_ZSYSTEM -> Integer (9100.0)

OS の種類を表す定数です。

OS の種類を表す定数です。

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (6118.0)

Benchmark.#benchmark メソッドの引数を簡略化したものです。

...
B
enchmark.#benchmark メソッドの引数を簡略化したものです。

B
enchmark.#benchmark メソッドと同様に働きます。

@param label_width ラベルの幅を指定します。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定し...
...ます。

//emlist[][ruby]{
require 'benchmark'

n = 50000
B
enchmark.bm do |x|
x.report { for i in 1..n; a = "1"; end }
x.report { n.times do ; a = "1"; end }
x.report { 1.upto(n) do ; a = "1"; end }
end

#=>
#
# user system total real
# 1.033333 0.016667 1.016667 (...
...す。

//emlist[][ruby]{
require 'benchmark'

n = 50000
B
enchmark.bm(7) do |x|
x.report("for:") { for i in 1..n; a = "1"; end }
x.report("times:") { n.times do ; a = "1"; end }
x.report("upto:") { 1.upto(n) do ; a = "1"; end }
end

#=>
# user system total rea...

REXML::DocType#public -> String | nil (6118.0)

DTD の公開識別子を返します。

...list[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype.system # => "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype.public # =>...
..."-//W3C//DTD XHTML 1.0 Strict//EN"

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root SYSTEM "foobar">
EOS
doctype.system # => "foobar"
doctype.public # => nil
//}...
<< 1 2 3 ... > >>