ライブラリ
-
rexml
/ document (2) -
ripper
/ filter (6) - shell (3)
-
shell
/ builtin-command (2) -
shell
/ command-processor (5) -
shell
/ filter (52) -
shell
/ system-command (1) - uri (1)
クラス
-
REXML
:: Text (2) -
Ripper
:: Filter (6) - Shell (3)
-
Shell
:: AppendFile (1) -
Shell
:: AppendIO (1) -
Shell
:: CommandProcessor (5) -
Shell
:: Filter (52) -
Shell
:: SystemCommand (1) -
URI
:: LDAP (1)
キーワード
- < (1)
- > (1)
- >> (1)
- [] (1)
- append (3)
- atime (1)
- basename (1)
- cat (1)
-
check
_ point (1) - chmod (1)
- chown (1)
- column (1)
- concat (1)
- ctime (1)
- delete (1)
- dirname (1)
- each (1)
- echo (3)
- filename (1)
-
find
_ system _ command (1) -
finish
_ all _ jobs (1) - foreach (1)
- ftype (1)
- glob (3)
- grpowned? (1)
- identical? (1)
- input (1)
- input= (3)
- inspect (1)
- join (1)
- lineno (1)
- link (1)
- lstat (1)
- mtime (1)
- notify (1)
-
on
_ XXX (1) -
on
_ default (1) - open (1)
- out (1)
- owned? (1)
- parse (1)
- readlink (1)
- rename (1)
- rm (1)
- size (1)
- size? (1)
- split (1)
- stat (1)
-
super
_ each (1) - symlink (1)
- symlink? (1)
- system (1)
- tee (1)
- test (1)
-
to
_ a (1) -
to
_ s (2) - transact (1)
- truncate (1)
- unlink (1)
- utime (1)
- value (1)
- | (1)
検索結果
先頭5件
-
URI
:: LDAP # filter -> String (54655.0) -
自身の filter を文字列で返します。
自身の filter を文字列で返します。 -
Shell
:: Filter # find _ system _ command(command) (45904.0) -
@todo
@todo -
Shell
:: CommandProcessor # append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (28243.0) -
@todo
@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。 -
Shell
:: Filter # append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (28243.0) -
@todo
@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。 -
Shell
:: Filter # input=(filter) (27625.0) -
フィルターを設定します。
フィルターを設定します。
@param filter フィルターを指定します。 -
Shell
:: Filter # input -> Shell :: Filter | nil (27607.0) -
現在のフィルターを返します。
現在のフィルターを返します。 -
Shell
:: Filter # basename(filename , suffix = "") -> String (27604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。
@see File.basename -
Shell
:: Filter # concat(*jobs) -> Shell :: Concat (27604.0) -
@todo
@todo -
Shell
:: Filter # dirname(filename) -> String (27604.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.dirname -
Ripper
:: Filter # on _ XXX(token , data) -> object (27358.0) -
各種スキャナイベントを実行します。
各種スキャナイベントを実行します。
実際には on_XXX というメソッドは存在しません。「XXX」の部分を
Ripper::SCANNER_EVENTS にあるスキャナイベントに読み替えてください。
@param token 現在のトークンが指定されます。
@param data 前のイベントハンドラの戻り値です。最初のイベントの場合は
Ripper::Filter#parse の引数になります。
オーバライドしなかった場合は on_default が実行されます。
このメソッドの戻り値は次のイベントハンドラの data 引数に渡されます。
@see R... -
Ripper
:: Filter # on _ default(event , token , data) -> object (27358.0) -
イベントハンドラが未定義のイベントが実行された場合に実行されるイベント ハンドラです。
イベントハンドラが未定義のイベントが実行された場合に実行されるイベント
ハンドラです。
@param event 実行されたイベントを :on_XXX 形式のシンボルで指定されます。
@param token 現在のトークンが指定されます。
@param data 前のイベントハンドラの戻り値です。最初のイベントの場合は
Ripper::Filter#parse の引数になります。
このメソッドの戻り値は次のイベントハンドラの data 引数に渡されます。
on_default をオーバライドしなかった場合は data 引数をそのまま返します。
@see R... -
Ripper
:: Filter # column -> Integer | nil (27304.0) -
現在のトークンの桁番号を 0 から始まる数値で返します。
現在のトークンの桁番号を 0 から始まる数値で返します。
このメソッドはイベントハンドラの中でのみ意味のある値を返します。イベン
トハンドラの中で self.column を実行してください。 -
Ripper
:: Filter # filename -> String (27304.0) -
Ruby プログラムのファイル名を文字列で返します。
Ruby プログラムのファイル名を文字列で返します。 -
Ripper
:: Filter # lineno -> Integer | nil (27304.0) -
現在のトークンの行番号を 1 から始まる数値で返します。
現在のトークンの行番号を 1 から始まる数値で返します。
このメソッドはイベントハンドラの中でのみ意味のある値を返します。イベン
トハンドラの中で self.lineno を実行してください。 -
Shell
:: Filter # check _ point (27304.0) -
@todo
@todo -
Shell
:: Filter # chown(owner , group , *filename) -> Integer (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param owner chown(2) と同様に数値で指定します。nil または -1 を指定することで、オーナーを現在のままにすることができます。
@param group chown(2) と同様に数値で指定します。nil または -1 を指定することで、グループを現在のままにすることができます。
@param filename ファイル名を表す文字列を指定します。
@see File.chown -
Shell
:: Filter # finish _ all _ jobs (27304.0) -
@todo
@todo -
Shell
:: Filter # grpowned?(file) -> bool (27304.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#grpowned? -
Shell
:: Filter # identical? (27304.0) -
@todo
@todo -
Shell
:: Filter # inspect -> String (27304.0) -
オブジェクトを人間が読める形式に変換した文字列を返します。
オブジェクトを人間が読める形式に変換した文字列を返します。
@see Object#inspect -
Shell
:: Filter # join(*item) -> String (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join -
Shell
:: Filter # link(old , new) -> 0 (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param old ファイル名を表す文字列を指定します。
@param new ファイル名を表す文字列を指定します。
@see File.link -
Shell
:: Filter # notify(*opts) { . . . } -> () (27304.0) -
@todo
@todo -
Shell
:: Filter # open(path , mode) -> File | Dir (27304.0) -
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
@param path 開きたいパスを指定します。
@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。
@see File.open, Dir.open -
Shell
:: Filter # owned?(file) -> bool (27304.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#owned? -
Shell
:: Filter # readlink(path) -> String (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path シンボリックリンクを表す文字列を指定します。
@see File.readlink -
Shell
:: Filter # rename(from , to) -> 0 (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param from ファイルの名前を文字列で与えます。
@param to 新しいファイル名を文字列で与えます。
@see File.rename -
Shell
:: Filter # symlink(old , new) -> 0 (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param old ファイル名を表す文字列を指定します。
@param new シンボリックリンクを表す文字列を指定します。
@see File.symlink -
Shell
:: Filter # symlink?(file) -> bool (27304.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#symlink? -
Shell
:: Filter # transact { . . . } -> object (27304.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 # truncate(path , length) -> 0 (27304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Shell
:: Filter # unlink(path) -> self (27304.0) -
path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。
path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。
@param path 削除したいパスを指定します。
@see File.unlink, Dir.unlink -
Shell
# append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (19243.0) -
@todo
@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。 -
Shell
:: AppendFile # input=(filter) (18607.0) -
@todo
@todo -
Shell
:: AppendIO # input=(filter) (18607.0) -
@todo
@todo -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (9655.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 (9655.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 (9655.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 (9655.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|
... -
Ripper
:: Filter # parse(init = nil) -> object (9640.0) -
自身の持つ Ruby プログラムの解析を開始します。各種イベントハンドラで処 理を行った結果を返します。
自身の持つ Ruby プログラムの解析を開始します。各種イベントハンドラで処
理を行った結果を返します。
@param init 任意の値を指定できます。この値がイベントハンドラに渡されていきます。
引数 init を初期値としてイベントハンドラに渡されていきます。各種イベン
トハンドラの戻り値は次のイベントハンドラに渡されます。
Enumerable#inject のように、最終的な結果を戻り値として返します。
@see Ripper::Filter#on_default, Ripper::Filter#on_XXX -
Shell
:: Filter # system(command , *opts) -> Shell :: SystemCommand (9622.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 # |(filter) -> object (9445.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
:: CommandProcessor # cat(*files) -> Shell :: Filter (9355.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 (9355.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... -
Shell
:: Filter # [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (9304.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param file1 文字列でファイルへのパスを指定します。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.m... -
Shell
:: Filter # atime(filename) -> Time (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@see File.atime -
Shell
:: Filter # chmod(mode , *filename) -> Integer (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param mode chmod(2) と同様に整数で指定します。
@see File.chmod -
Shell
:: Filter # ctime(filename) -> Time (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@see File.ctime -
Shell
:: Filter # delete(*filename) -> Integer (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Shell
:: Filter # each(rs = nil) -> () (9304.0) -
フィルタの一行ずつをblockに渡します。
フィルタの一行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
} -
Shell
:: Filter # foreach(path = nil , &block) -> () (9304.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"){|f|
puts f
} -
Shell
:: Filter # ftype(filename) -> String (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.ftype -
Shell
:: Filter # lstat(filename) -> File :: Stat (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.lstat -
Shell
:: Filter # mtime(filename) -> Time (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@see File.mtime -
Shell
:: Filter # rm(*filename) -> Integer (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Shell
:: Filter # size(file) -> Integer (9304.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#size FileTest.#size? -
Shell
:: Filter # size?(file) -> Integer | nil (9304.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#size FileTest.#size? -
Shell
:: Filter # split(pathname) -> [String] (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param pathname パス名を表す文字列を指定します。
@see File.split -
Shell
:: Filter # stat(filename) -> File :: Stat (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.stat -
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (9304.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param file1 文字列でファイルへのパスを指定します。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.m... -
Shell
:: Filter # to _ a -> [String] (9304.0) -
実行結果を文字列の配列で返します。
実行結果を文字列の配列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a -
Shell
:: Filter # to _ s -> String (9304.0) -
実行結果を文字列で返します。
実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
} -
Shell
:: Filter # utime(atime , mtime , *filename) -> Integer (9304.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param utime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@see File.utime -
Shell
:: Filter # >(to) -> self (9040.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 (9040.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 # <(src) -> self (9022.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"
} -
Shell
:: Filter # out(dev = STDOUT , &block) -> () (9022.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
:: SystemCommand # super _ each -> () (9022.0) -
@todo
@todo
Shell::Filter#each です。 -
Shell
# echo(*strings) -> Shell :: Filter (655.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 (655.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|
... -
REXML
:: Text # to _ s -> String (322.0) -
テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。
テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。
つまり返り値は XML のテキストとして妥当です。
結果は REXML::Text.new で指定した entity_filter を反映しています。
@see REXML::Text#value
//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "< & foobar"
t.value # => "< & foobar"
//} -
REXML
:: Text # value -> String (322.0) -
テキストの内容を非正規化(すべての実体をアンエスケープ)された状態で返します。
テキストの内容を非正規化(すべての実体をアンエスケープ)された状態で返します。
このメソッドの返り値では raw モードや entity_filter は無視されます。
@see REXML::Text#raw, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "< & foobar"
t.value # => "< & foobar"
//}