るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
67件ヒット [1-67件を表示] (0.171秒)

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. pop n_bytes
  5. openssl n

検索結果

Shell::CommandProcessor#system(command, *opts) -> Shell::SystemCommand (64279.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::CommandProcessor#find_system_command(command) (64207.0)

@todo

@todo

Net::FTP#system -> String (63607.0)

サーバーの OS のタイプを返します。

サーバーの OS のタイプを返します。

@raise Net::FTPTempError 応答コードが 4yz のときに発生します。
@raise Net::FTPPermError 応答コードが 5yz のときに発生します。
@raise Net::FTPProtoError 応答コードが RFC 的に正しくない場合に発生します。
@raise Net::FTPReplyError 応答コードが上の場合以外でエラーである場合に発生します。

REXML::NotationDecl#system -> String | nil (63607.0)

システム識別子(URI)を返します。

システム識別子(URI)を返します。

宣言がシステム識別子を含まない場合は nil を返します。

Shell#system(command, *opts) -> Shell::SystemCommand (55279.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#system(command, *opts) -> Shell::SystemCommand (55279.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#find_system_command(command) (55207.0)

@todo

@todo

Shell::Filter#find_system_command(command) (55207.0)

@todo

@todo

REXML::DocType#system -> String | nil (54661.0)

DTD のシステム識別子を返します。

DTD のシステム識別子を返します。

DTD が外部サブセットを含んでいない場合は nil を返します。

//emlist[][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.w...

Shell::SystemCommand#command -> String (36304.0)

@todo

@todo

コマンド名を返します。

絞り込み条件を変える

Shell::SystemCommand#name -> String (36304.0)

@todo

@todo

コマンド名を返します。

Kernel#xsystem(command, opts = nil) -> () (27670.0)

Kernel.#system と同じですが、コマンドの出力は(標準出力、標準エラー 出力ともに)ログファイルに出力します。ログファイル名は mkmf.log です。

Kernel.#system と同じですが、コマンドの出力は(標準出力、標準エラー
出力ともに)ログファイルに出力します。ログファイル名は mkmf.log です。

@param command コマンドを指定します。
@param opts オプションを Hash で指定します。
:werror というキーに真を指定すると

@see Kernel.#system

Gem::SourceInfoCache#latest_system_cache_file -> String (27607.0)

最新のシステムキャッシュのファイル名を返します。

最新のシステムキャッシュのファイル名を返します。

Gem::SourceInfoCache#system_cache_file -> String (27607.0)

システムキャッシュファイルの名前を返します。

システムキャッシュファイルの名前を返します。

Matrix#eigensystem -> Matrix::EigenvalueDecomposition (27604.0)

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

Matrix::EigenvalueDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(右固有ベクトル、固有値行列、左固有ベクトル)
を得ることができます。
これを [V, D, W] と書くと、
(元の行列が対角化可能ならば)、
D は対角行列で、 self == V*D*W, V = W.inverse を満たします。
D のそれぞれの対角成分が行列の固有値です。

//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [...

絞り込み条件を変える

Shell::SystemCommand#input=(inp) (27604.0)

@todo

@todo

REXML::NotationDecl#system=(value) (27307.0)

システム識別子を変更します。

システム識別子を変更します。

@param value 設定するシステム識別子

Shell::SystemCommand#notify(*opts) -> String (27304.0)

@todo

@todo

@param opts

@see Shell#notify

Shell::SystemCommand#notify(*opts) {|message| ... } -> String (27304.0)

@todo

@todo

@param opts

@see Shell#notify

Shell::SystemCommand#terminate -> () (27304.0)

@todo

@todo

絞り込み条件を変える

SystemCallError#errno -> Integer | nil (27304.0)

レシーバに対応するシステム依存のエラーコードを返します。

レシーバに対応するシステム依存のエラーコードを返します。

エラーコードを渡さない形式で生成した場合は nil を返します。

begin
raise Errno::ENOENT
rescue Errno::ENOENT => err
p err.errno # => 2
p Errno::ENOENT::Errno # => 2
end

begin
raise SystemCallError, 'message'
rescue SystemCallError => err
p err.e...

REXML::StreamListener#entitydecl(content) -> () (18976.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

@param content 実体宣言が配列で渡されます

実体宣言の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes...

REXML::SAX2Listener#notationdecl(name, public_or_system, public_id, system_id) -> () (18964.0)

DTDの記法宣言に出会ったときに呼び出されるコールバックメソッドです。

DTDの記法宣言に出会ったときに呼び出されるコールバックメソッドです。

@param name 記法名が文字列で渡されます
@param public_or_system "PUBLIC" もしくは "SYSTEM" が渡されます
@param public_id 公開識別子が文字列で渡されます。指定されていない場合はnilが渡されます
@param system_id システム識別子が文字列で渡されます。指定されていない場合はnilが渡されます

Rake::Application#options -> OpenStruct (18640.0)

コマンドラインで与えられたアプリケーションのオプションを返します。

コマンドラインで与えられたアプリケーションのオプションを返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
Rake.application.options # => #<OpenStruct always_multitask=false, backtrace=false, build_all=false, dryrun=false, ignore_deprecate=false, ignore_system=false, job_stats=...

Shell#transact { ... } -> object (18358.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::CommandProcessor#transact { ... } -> object (18358.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#transact { ... } -> object (18358.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 と同じとなる。
}

REXML::DocType#external_id -> String | nil (18352.0)

DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。

DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の
いずれかの文字列を返します。

それ以外の場合は nil を返します。

//emlist[][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....

REXML::Entity#external -> String | nil (18352.0)

実体が外部実体(external entity)宣言である場合は "SYSTEM" もしくは "PUBLIC" という文字列を返します。

実体が外部実体(external entity)宣言である場合は
"SYSTEM" もしくは "PUBLIC" という文字列を返します。

内部実体(internal entity)宣言である場合には nil を返します。

IO#close_on_exec=(bool) (18322.0)

自身に close-on-exec フラグを設定します。

自身に close-on-exec フラグを設定します。

このフラグをセットすると exec(2) 時にそのファイルデスクリプタを
close します。

@see fcntl(2)
@param bool 自身の close-on-exec フラグを true か false で指定します。

f = open("/dev/null")
f.close_on_exec = true
system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
...

絞り込み条件を変える

REXML::StreamListener#notationdecl(content) -> () (18322.0)

DTDの記法宣言をパースしたときに呼び出されるコールバックメソッドです。

DTDの記法宣言をパースしたときに呼び出されるコールバックメソッドです。

@param content 記法宣言が
[記法名文字列, 種別("PUBLIC" もしくは "SYSTEM"), 公開識別子文字列,
URI文字列] という配列で渡されます。

Shell::SystemCommand#each(rs = nil) {|line| ... } (18304.0)

@todo

@todo

@param rs

Shell::SystemCommand#kill(signal) -> Integer (18304.0)

自身のプロセスにシグナルを送ります。

自身のプロセスにシグナルを送ります。

@param signal シグナルを整数かその名前の文字列で指定します。
負の値を持つシグナル(あるいはシグナル名の前に-)を指定すると、
プロセスではなくプロセスグループにシグナルを送ります。

@see Process.#kill

Shell::SystemCommand#active? -> bool (18004.0)

@todo

@todo

Shell::SystemCommand#flush -> () (18004.0)

@todo

@todo

絞り込み条件を変える

Shell::SystemCommand#start -> () (18004.0)

@todo

@todo

Shell::SystemCommand#start_export (18004.0)

@todo

@todo

Shell::SystemCommand#start_import -> () (18004.0)

@todo

@todo

Shell::SystemCommand#super_each -> () (18004.0)

@todo

@todo

Shell::Filter#each です。

Shell::SystemCommand#wait? -> bool (18004.0)

@todo

@todo

絞り込み条件を変える

REXML::SAX2Listener#doctype(name, pub_sys, long_name, uri) -> () (9658.0)

文書型宣言(DTD)に出会った時に呼び出されるコールバックメソッドです。

文書型宣言(DTD)に出会った時に呼び出されるコールバックメソッドです。

@param name 宣言されているルート要素名が文字列で渡されます。
@param pub_sys "PUBLIC" もしくは "SYSTEM" が渡されます。nilが渡される場合もあります。
@param long_name "SYSTEM" の場合はシステム識別子が、"PUBLIC"の場合は公開識別子が
文字列で渡されます
@param uri "SYSTEM" の場合は nil が、"PUBLIC" の場合はシステム識別子が渡されます

REXML::StreamListener#doctype(name, pub_sys, long_name, uri) -> () (9658.0)

文書型宣言(DTD)をパースしたときに呼び出されるコールバックメソッドです。

文書型宣言(DTD)をパースしたときに呼び出されるコールバックメソッドです。

pub_sys, long_name, uri はDTDが内部サブセットのみを
利用している場合には nil が渡されます。

@param name 宣言されているルート要素名が文字列で渡されます。
@param pub_sys "PUBLIC" もしくは "SYSTEM" が渡されます。nilが渡される場合もあります。
@param long_name "SYSTEM" の場合はシステム識別子が、"PUBLIC"の場合は公開識別子が
文字列で渡されます
@param uri "SYSTEM" の場...

Benchmark::Tms#format(fmtstr = nil, *args) -> String (9394.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...

RDoc::Options#op_dir -> String (9322.0)

コマンドライン引数の --op オプションで指定したディレクトリを返します。

コマンドライン引数の --op オプションで指定したディレクトリを返します。

--ri、--ri-site、--ri-system オプションにも影響される事に注意してください。

@return 設定されたディレクトリを文字列で返します。

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (9322.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#glob(pattern) -> Shell::Filter (9322.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|
...

String#sum(bits = 16) -> Integer (9322.0)

文字列の bits ビットのチェックサムを計算します。

文字列の bits ビットのチェックサムを計算します。

以下と同じです。

//emlist[][ruby]{
def sum(bits)
sum = 0
each_byte {|c| sum += c }
return 0 if sum == 0
sum & ((1 << bits) - 1)
end
//}

例えば以下のコードで UNIX System V の
sum(1) コマンドと同じ値が得られます。

//emlist[例][ruby]{
sum = 0
ARGF.each_line do |line|
sum += line.sum
end
sum %= ...

SystemExit#status -> Integer (9304.0)

例外オブジェクトに保存された終了ステータスを返します。

例外オブジェクトに保存された終了ステータスを返します。

終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。

例:

begin
exit 1
rescue SystemExit => err
p err.status # => 1
end

begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end

Shell::CommandProcessor#out(dev = STDOUT, &block) -> () (9058.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")
}
}

Benchmark::Tms#cstime -> Float (9052.0)

子プロセスの System CPU time

子プロセスの System CPU time

絞り込み条件を変える

Benchmark::Tms#stime -> Float (9052.0)

System CPU time

System CPU time

Benchmark::Tms#to_a -> Array (9040.0)

6 要素の配列を返します。

6 要素の配列を返します。

要素は以下の順番で配列に格納されています。
* ラベル
* user CPU time
* system CPU time,
* 子プロセスの user CPU time
* 子プロセスの system CPU time,
* 実経過時間

Shell::CommandProcessor#cat(*files) -> Shell::Filter (9022.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 (9022.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...

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

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

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

DTD が公開識別子による外部サブセットを含んでいない場合は nil を返します。

//emlist[][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:/...

絞り込み条件を変える

Shell#echo(*strings) -> Shell::Filter (322.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#glob(pattern) -> Shell::Filter (322.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#echo(*strings) -> Shell::Filter (322.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 (322.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#to_a -> [String] (322.0)

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

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

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a

絞り込み条件を変える

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

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

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

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

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

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

Shell#out(dev = STDOUT, &block) -> () (58.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")
}
}

Shell::Filter#>(to) -> self (58.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...

Shell::Filter#>>(to) -> self (58.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") >> ...

絞り込み条件を変える

Shell::Filter#out(dev = STDOUT, &block) -> () (58.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")
}
}

Shell::Filter#<(src) -> self (40.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"
}