7件ヒット
[1-7件を表示]
(0.110秒)
別のキーワード
種類
- 特異メソッド (5)
- インスタンスメソッド (2)
ライブラリ
- ビルトイン (2)
- shell (3)
-
shell
/ system-command (2)
クラス
- Dir (2)
- Shell (3)
-
Shell
:: SystemCommand (2)
キーワード
-
def
_ system _ command (1) - foreach (2)
-
install
_ system _ commands (1) -
super
_ each (1) -
undef
_ system _ command (1)
検索結果
先頭5件
-
Shell
:: SystemCommand # each(rs = nil) {|line| . . . } (81604.0) -
@todo
@todo
@param rs -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (64360.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
system_path上にある全ての実行可能ファイルを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... -
Shell
. def _ system _ command(command , path = command) -> nil (46084.0) -
Shell のメソッドとして command を登録します.
Shell のメソッドとして command を登録します.
OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.
@param command Shell のメソッドとして定義するコマンドを文字列で指定します。
@param path command のパスを指定します。
指定しない場合はcommand と同じになります。
例)
require 'shell'
Shell.def_system_command "ls"
# ls ... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (46012.0) -
commandを削除します.
commandを削除します.
@param 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
puts ... -
Shell
:: SystemCommand # super _ each -> () (45322.0) -
@todo
@todo
Shell::Filter#each です。 -
Dir
. foreach(path , encoding: Encoding . find("filesystem")) {|file| . . . } -> nil (19501.0) -
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ブロックが与えられなかった場合、各エントリを文字列として保持する
Enumerator オブジェクトを返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//... -
Dir
. foreach(path , encoding: Encoding . find("filesystem")) -> Enumerator (19201.0) -
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ディレクトリ path の各エントリを表す文字列を引数として、ブロックを評価します。
ブロックが与えられなかった場合、各エントリを文字列として保持する
Enumerator オブジェクトを返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//...