356件ヒット
[1-100件を表示]
(0.082秒)
モジュール
-
GC
:: Profiler (11)
オブジェクト
- ENV (51)
キーワード
-
alias
_ command (6) - debug (6)
- debug? (6)
-
debug
_ output _ exclusive _ unlock (3) -
debug
_ output _ unlock (6) -
def
_ system _ command (6) -
each
_ active _ object (6) - filter (6)
- foreach (11)
- generate (11)
-
generate
_ line (11) -
install
_ system _ commands (6) - instance (22)
- new (44)
- notify (6)
- open (44)
- parse (22)
-
parse
_ line (11) -
raw
_ data (11) - read (11)
- readlines (11)
- reject (11)
- select (11)
- shift (11)
-
ssl
_ params (11) - table (11)
-
to
_ h (12) -
try
_ convert (11) -
unalias
_ command (6) -
undef
_ system _ command (6)
検索結果
先頭5件
-
ENV
. shift -> [String , String] | nil (6302.0) -
環境変数を一つ取り除いて、それを名前と値の組の配列で返します。 環境変数が一つも設定されていなければ nil を返します。
環境変数を一つ取り除いて、それを名前と値の組の配列で返します。
環境変数が一つも設定されていなければ nil を返します。 -
Hash
. new {|hash , key| . . . } -> Hash (3414.0) -
空の新しいハッシュを生成します。ブロックの評価結果がデフォルト値になりま す。設定したデフォルト値はHash#default_procで参照できます。
...の新しいハッシュを生成します。ブロックの評価結果がデフォルト値になりま
す。設定したデフォルト値はHash#default_procで参照できます。
値が設定されていないハッシュ要素を参照するとその都度ブロックを
実行し、その......ルト値は全部同一のオブジェクトなので、
# 破壊的変更によって他のキーに対応する値も変更されます。
h = Hash.new("foo")
p h[1] #=> "foo"
p h[1].object_id #=> 6127170
p h[1] << "bar" #=> "foobar"
p h[1] #=> "f......だ無いキーが呼び出される度に
# ブロックを評価するので、全て別のオブジェクトになります。
h = Hash.new {|hash, key| hash[key] = "foo"}
p h[1] #=> "foo"
p h[1].object_id #=> 6126900
p h[1] << "bar" #=> "foobar"
p h[1]... -
Hash
. try _ convert(obj) -> Hash | nil (3302.0) -
to_hash メソッドを用いて obj をハッシュに変換しようとします。
...to_hash メソッドを用いて obj をハッシュに変換しようとします。
何らかの理由で変換できないときには nil を返します。
このメソッドは引数がハッシュであるかどうかを調べるために使えます。
//emlist[][ruby]{
Hash.try_convert({......1=>2}) # => {1=>2}
Hash.try_convert("1=>2") # => nil
//}... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (3219.0) -
commandを削除します.
...の文字列を指定します。
動作例:
require 'shell'
Shell.def_system_command("ls")
# ls を定義
Shell.undef_system_command("ls")
# ls を 削除
sh = Shell.new
begin
sh.transact {
ls("-l").each {|l|
puts l
}
}
rescue NameError => err
put... -
Hash
. new(ifnone = nil) -> Hash (3204.0) -
空の新しいハッシュを生成します。ifnone はキーに対 応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
...none はキーに対
応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
ifnoneを省略した Hash.new は {} と同じです。
デフォルト値として、毎回同一のオブジェクトifnoneを返します。......それにより、一箇所のデフォルト値の変更が他の値のデフォルト値にも影響します。
//emlist[][ruby]{
h = Hash.new([])
h[0] << 0
h[1] << 1
p h.default #=> [0, 1]
//}
これを避けるには、破壊的でないメソッドで再代入する必要が有ります。......][ruby]{
h = Hash.new([])
p h[1] #=> []
p h[1].object_id #=> 6127150
p h[1] << "bar" #=> ["bar"]
p h[1] #=> ["bar"]
p h[2] #=> ["bar"]
p h[2].object_id #=> 6127150
p h #=> {}
h = Hash.new([].freeze)
h[0... -
Shell
. debug -> bool | Integer (3203.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
. debug? -> bool | Integer (3203.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
. debug _ output _ exclusive _ unlock { . . . } -> Mutex | nil (3202.0) -
@todo
@todo
@see Mutex#exclusive_unlock -
Shell
. debug _ output _ unlock -> Mutex | nil (3202.0) -
@todo
@todo
@see Mutex#unlock@todo
@see Thread::Mutex#unlock -
Shell
. notify(*opts) {|message| . . . } -> String (3202.0) -
@todo
@todo -
Shell
:: ProcessController . each _ active _ object {|ref| . . . } -> () (3202.0) -
@todo
@todo -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (3149.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
...イルを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|
puts l
}
}... -
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (3143.0) -
コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
...コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
@param alias エイリアスの名前を文字列で指定します.
@param command コマンド名を文字列で指定します.
@param......を指定します.
使用例: 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.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}... -
Shell
. unalias _ command(alias) -> () (3143.0) -
commandの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.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}
Shell.unalias_command......("lsla")
begin
Shell.unalias_command("lsla")
rescue NameError => err
puts err
end...