種類
- インスタンスメソッド (49)
- 特異メソッド (14)
- クラス (3)
- モジュール関数 (1)
クラス
- Array (1)
- Shell (20)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (9) -
Shell
:: ProcessController (4) -
Shell
:: SystemCommand (16)
モジュール
- Shellwords (2)
キーワード
- CantApplyMethod (1)
- DirStackEmpty (1)
- SystemCommand (1)
- active? (1)
-
active
_ jobs (1) -
block
_ output _ synchronize (1) - command (1)
-
debug
_ output _ synchronize (1) -
debug
_ output _ try _ lock (1) -
def
_ system _ command (2) -
default
_ system _ path (1) -
default
_ system _ path= (1) - directory? (3)
- each (1)
-
find
_ system _ command (3) - flush (1)
- ftype (3)
- input= (1)
-
install
_ system _ commands (2) - jobs (2)
- join (1)
- kill (1)
- mkdir (3)
- name (1)
- new (1)
- notify (6)
- shelljoin (2)
- start (1)
-
start
_ export (1) -
start
_ import (1) - sticky? (3)
-
super
_ each (1) - symlink (3)
- symlink? (3)
- system (3)
-
system
_ path (1) -
system
_ path= (1) - terminate (1)
-
undef
_ system _ command (2) - wait? (1)
-
waiting
_ jobs (1)
検索結果
先頭5件
-
Shell
. install _ system _ commands(pre = "sys _ ") -> () (45979.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
:: CommandProcessor . install _ system _ commands(prefix = "sys _ ") -> () (45904.0) -
全てのシステムコマンドをメソッドとして定義します。
全てのシステムコマンドをメソッドとして定義します。
既に定義されているコマンドを再定義することはありません。
デフォルトでは全てのコマンドに "sys_" というプレフィクスが付きます。
また、メソッド名として使用できない文字は全て "_" に置換してメソッドを定義します。
このメソッドの実行中に発生した例外は単に無視されます。
@param prefix プレフィクスを指定します。 -
Shell
:: ProcessController . block _ output _ synchronize { . . . } -> () (45604.0) -
@todo
@todo -
Shell
# symlink(old , new) -> 0 (36607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param old ファイル名を表す文字列を指定します。
@param new シンボリックリンクを表す文字列を指定します。
@see File.symlink -
Shell
# symlink?(file) -> bool (36607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#symlink? -
Shell
. debug _ output _ try _ lock -> bool (36607.0) -
@todo
@todo
@see Thread::Mutex#try_lock -
Shell
. default _ system _ path -> Array (36607.0) -
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
...
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。
動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [......"/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"... -
Shell
. default _ system _ path=(path) (36607.0) -
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
...
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。
動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [......"/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"... -
Shell
:: CommandProcessor # symlink(old , new) -> 0 (36604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param old ファイル名を表す文字列を指定します。
@param new シンボリックリンクを表す文字列を指定します。
@see File.symlink -
Shell
:: CommandProcessor # symlink?(file) -> bool (36604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#symlink? -
Shell
:: Filter # symlink(old , new) -> 0 (36604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param old ファイル名を表す文字列を指定します。
@param new シンボリックリンクを表す文字列を指定します。
@see File.symlink -
Shell
:: Filter # symlink?(file) -> bool (36604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#symlink? -
Shell
:: SystemCommand # kill(signal) -> Integer (36304.0) -
自身のプロセスにシグナルを送ります。
自身のプロセスにシグナルを送ります。
@param signal シグナルを整数かその名前の文字列で指定します。
負の値を持つシグナル(あるいはシグナル名の前に-)を指定すると、
プロセスではなくプロセスグループにシグナルを送ります。
@see Process.#kill -
Shell
:: Error :: CantApplyMethod (36004.0) -
メソッドを適用できないときに発生する例外です。
メソッドを適用できないときに発生する例外です。 -
Shell
# system(command , *opts) -> Shell :: SystemCommand (27943.0) -
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 # system(command , *opts) -> Shell :: SystemCommand (27940.0) -
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 (27940.0) -
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
. def _ system _ command(command , path = command) -> nil (27697.0) -
Shell のメソッドとして command を登録します.
...
Shell のメソッドとして command を登録します.
OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.
@param command Shell のメソッド......ない場合はcommand と同じになります。
例)
require 'shell'
Shell.def_system_command "ls"
# ls を定義
Shell.def_system_command "sys_sort", "sort"
# sortコマンドをsys_sortとして定義
sh = Shell.new
sh.transact {
ls.each { |l|
puts l
}
(ls("-l... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (27661.0) -
commandを削除します.
...mmand 削除するコマンドの文字列を指定します。
動作例:
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
}
}
r... -
Shell
# directory?(file) -> bool (27607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
# ftype(filename) -> String (27607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.ftype -
Shell
# sticky?(file) -> bool (27607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#sticky? -
Shell
:: CommandProcessor # directory?(file) -> bool (27604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
:: CommandProcessor # ftype(filename) -> String (27604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.ftype -
Shell
:: CommandProcessor # sticky?(file) -> bool (27604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#sticky? -
Shell
:: CommandProcessor . undef _ system _ command(command) -> self (27604.0) -
与えられたコマンドを削除します。
与えられたコマンドを削除します。
@param command 削除したいコマンド名を指定します。 -
Shell
:: Filter # directory?(file) -> bool (27604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
:: Filter # ftype(filename) -> String (27604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.ftype -
Shell
:: Filter # sticky?(file) -> bool (27604.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#sticky? -
Shellwords
. # shelljoin(array) -> String (27604.0) -
配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。
...スケープには、Shellwords.#shellescape と
同じ規則が適用されます。
@param array エスケープ対象の文字列を要素とする配列を指定します。
@return エスケープ結果を連結した文字列を返します。
例:
require 'shellwords'
pattern =......'Jan 15'
file = 'file name with spaces'
puts Shellwords.shelljoin(['grep', pattern, file])
# => grep Jan\ 15 file\ name\ with\ spaces... -
Shell
# find _ system _ command(command) (27307.0) -
@todo
@todo -
Shell
# notify(*opts) { . . . } -> () (27307.0) -
@todo
@todo -
Shell
# system _ path -> Array (27307.0) -
コマンドサーチパスの配列を返す。
...コマンドサーチパスの配列を返す。
@param path コマンドサーチパスの配列を指定します。
使用例
require 'shell'
sh = Shell.new
sh.system_path = [ "./" ]
p sh.system_path #=> ["./"]... -
Shell
# system _ path=(path) (27307.0) -
コマンドサーチパスの配列を返す。
...コマンドサーチパスの配列を返す。
@param path コマンドサーチパスの配列を指定します。
使用例
require 'shell'
sh = Shell.new
sh.system_path = [ "./" ]
p sh.system_path #=> ["./"]... -
Shell
. debug _ output _ synchronize (27307.0) -
@todo
@todo
@see Thread::Mutex#synchronize -
Shell
. notify(*opts) {|message| . . . } -> String (27307.0) -
@todo
@todo -
Array
# shelljoin -> String (27304.0) -
配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。
...スケープを適用し、空白文字を介してそれらを連結したコマンド
ライン文字列を生成します。
array.shelljoin は、Shellwords.shelljoin(array) と等価です。
@return エスケープ結果を連結した文字列を返します。
@see Shellwords.#shelljoin... -
Shell
:: CommandProcessor # find _ system _ command(command) (27304.0) -
@todo
@todo -
Shell
:: CommandProcessor # notify(*opts) { . . . } -> () (27304.0) -
@todo
@todo -
Shell
:: CommandProcessor . def _ system _ command(command , path = command) -> () (27304.0) -
@todo
@todo
与えられたコマンドをメソッドとして定義します。
@param command 定義したいコマンドを指定します。
@param path command のパスを指定します。省略すると環境変数 PATH から command を探します。 -
Shell
:: Filter # find _ system _ command(command) (27304.0) -
@todo
@todo -
Shell
:: Filter # notify(*opts) { . . . } -> () (27304.0) -
@todo
@todo -
Shell
:: SystemCommand # flush -> () (27304.0) -
@todo
@todo -
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
:: Error :: DirStackEmpty (27004.0) -
空のディレクトリスタックから要素を取り出そうとしたときに発生する例外です。
空のディレクトリスタックから要素を取り出そうとしたときに発生する例外です。 -
Shell
:: SystemCommand (27004.0) -
-
Shell
:: ProcessController # active _ jobs -> Array (18304.0) -
実行中のジョブの配列を返します。
実行中のジョブの配列を返します。 -
Shell
:: ProcessController # jobs -> Array (18304.0) -
全てのジョブの配列を返します。
全てのジョブの配列を返します。 -
Shell
:: ProcessController # waiting _ jobs -> Array (18304.0) -
待機中のジョブを返します。
待機中のジョブを返します。 -
Shell
:: SystemCommand # active? -> bool (18304.0) -
@todo
@todo -
Shell
:: SystemCommand # each(rs = nil) {|line| . . . } (18304.0) -
@todo
@todo
@param rs -
Shell
:: SystemCommand # wait? -> bool (18304.0) -
@todo
@todo -
Shell
:: SystemCommand # command -> String (18004.0) -
@todo
@todo
コマンド名を返します。 -
Shell
:: SystemCommand # input=(inp) (18004.0) -
@todo
@todo -
Shell
:: SystemCommand # name -> String (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 # terminate -> () (18004.0) -
@todo
@todo -
Shell
:: SystemCommand . new(sh , command , *opts) (18004.0) -
@todo
@todo
@param sh
@param command
@param opts -
Shell
# jobs -> Array (9307.0) -
スケジューリングされているjobの一覧を返します。
スケジューリングされているjobの一覧を返します。 -
Shell
# mkdir(*path) -> Array (9307.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shell
:: CommandProcessor # mkdir(*path) -> Array (9304.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shell
:: Filter # mkdir(*path) -> Array (9304.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shellwords
. join(array) -> String (9304.0) -
配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。
...を適用し、空白文字を介してそれらを連結したコマンド
ライン文字列を生成します。
このメソッドは、Shellwords.#shelljoin の別名です。
@param array エスケープ対象の文字列を要素とする配列を指定します。
@return エスケープ...