72件ヒット
[1-72件を表示]
(0.129秒)
種類
- インスタンスメソッド (48)
- 特異メソッド (24)
ライブラリ
- shell (72)
検索結果
先頭5件
-
Shell
# verbose -> bool (27303.0) -
@todo
@todo -
Shell
. verbose -> bool (27303.0) -
@todo
@todo -
Shell
# verbose? -> bool (15303.0) -
@todo
@todo -
Shell
. verbose? -> bool (15303.0) -
@todo
@todo -
Shell
# foreach(path = nil , &block) -> () (12307.0) -
pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。
...pathがファイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。
@param path ファイルもしくはディレクトリのパスを文字列で指定します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){... -
Shell
# mkdir(*path) -> Array (9307.0) -
Dir.mkdirと同じです。 (複数可)
...Dir.mkdirと同じです。 (複数可)
@param path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=>......["foo"]
rescue => err
puts err
end... -
Shell
# pushdir(path = nil , &block) -> object (9307.0) -
カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.
...リをpathにする. pathが省略されたときには, カレントディレクトリと
ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと
きには, ブロック実行中のみpushdする.
@param path カレントディレクトリをpathにす......。
@param block イテレータとして呼ぶ場合, ブロックを指定します。
動作例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh.pushd("/usr")
p sh.cwd #=> "/usr"
sh.popd
p sh.cwd #=> "/tmp"
sh.pushd("/usr/local"){......p sh.cwd #=> "/usr/local"
}
p sh.cwd #=> "/tmp"... -
Shell
# popdir -> () (6207.0) -
ディレクトリスタックからポップし, それをカレントディレクトリにする.
...ディレクトリスタックからポップし, それをカレントディレクトリにする.
動作例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh.pushd("/usr")
p sh.cwd #=> "/usr"
sh.popd
p sh.cwd #=> "/tmp"... -
Shell
. cd(path = nil , verbose = self . verbose) -> self (3609.0) -
pathをカレントディレクトリとするShellオブジェクトを生成します.
...athをカレントディレクトリとするShellオブジェクトを生成します.
@param path カレントディレクトリとするディレクトリを文字列で指定します。
@param verbose true を指定すると冗長な出力を行います。
使用例
require 'shell'
sh......= Shell.new
sh.cd("/tmp")... -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (3219.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
...ystem_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|
puts l
}
}... -
Shell
# [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (3207.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (3207.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest...