るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.105秒)
トップページ > クエリ:l[x] > バージョン:2.4.0[x] > クエリ:system[x] > クエリ:to_s[x]

別のキーワード

  1. kernel system
  2. _builtin system
  3. socket af_system
  4. socket pf_system
  5. socket eai_system

ライブラリ

クラス

モジュール

キーワード

検索結果

Shell::Filter#to_s -> String (63358.0)

実行結果を文字列で返します。

実行結果を文字列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new

sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}

REXML::NotationDecl (18145.0)

DTD の記法宣言を表すクラスです。

DTD の記法宣言を表すクラスです。


//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!NOTATION type-image-svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!NOTATION type-image-gif PUBLIC "image/gif">...

Shell::Filter#|(filter) -> object (9409.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(...

Benchmark.#measure(label = "") { ... } -> Benchmark::Tms (337.0)

与えられたブロックを実行して、経過した時間を Process.#times で計り、 Benchmark::Tms オブジェクトを生成して返します。

与えられたブロックを実行して、経過した時間を Process.#times で計り、
Benchmark::Tms オブジェクトを生成して返します。

Benchmark::Tms オブジェクトには to_s が定義されているので、
基本的には以下のように使います。

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

puts Benchmark::CAPTION
puts Benchmark.measure { "a"*1_000_000 }

#=>
#
# user system total real
# 1.1666...