293件ヒット
[1-100件を表示]
(0.225秒)
ライブラリ
- ビルトイン (228)
-
irb
/ context (11) - shell (12)
-
shell
/ builtin-command (6) -
shell
/ command-processor (24) -
shell
/ filter (12)
クラス
-
ARGF
. class (187) - Array (19)
-
IRB
:: Context (11) - Shell (12)
-
Shell
:: CommandProcessor (24) -
Shell
:: Echo (6) -
Shell
:: Filter (12) - String (22)
検索結果
先頭5件
-
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (24220.0) -
実行すると, それらを内容とする 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") >> "all.tee"
}
}
}... -
Shell
# echo(*strings) -> Shell :: Filter (18220.0) -
実行すると, それらを内容とする 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") >> "all.tee"
}
}
}... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (18220.0) -
実行すると, それらを内容とする 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") >> "all.tee"
}
}
}... -
String
# unpack(template) -> Array (12981.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...
Array#pack で生成された文字列を
テンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるもの......は、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」
を表すこともできます。
長さの意味はテ......字のシステム依存性
各テンプレート文字の説明の中で、
short や long はシステムによらずそれぞれ 2, 4バイトサ
イズの数値(32ビットマシンで一般的なshort, longのサイズ)を意味していま
す。s, S, l, L に対しては直後に _ または......は、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」
を表すこともできます。
長さ... -
ARGF
. class # each _ codepoint -> Enumerator (12225.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...た場合には、Enumerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,1... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (12225.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...た場合には、Enumerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,1... -
ARGF
. class # filename -> String (12219.0) -
現在開いている処理対象のファイル名を返します。
...は - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark"... -
ARGF
. class # inplace _ mode -> String | nil (12213.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...:ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や AR......GF.class#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"
# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|e|print e.upcase} # => "TEST"
例:......# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"
# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=... -
ARGF
. class # each _ char -> Enumerator (9249.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...に含まれる文字を一文字ずつブロックに渡して評価します。
このメソッドはスクリプトに指定した引数(Object::ARGV を参照) をファ
イル名とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオ
ブジェクトで......は
ARGF.class#filename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_char......# => #<Enumerator: ARGF:each_char>
ARGF.each_char{|e|p e}
# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"
@see IO#each_char... -
ARGF
. class # path -> String (9219.0) -
現在開いている処理対象のファイル名を返します。
...は - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark"... -
IRB
:: Context # echo=(val) (9214.0) -
irb のプロンプトでの評価結果を表示するかどうかを設定します。
...す。
.irbrc ファイル中で IRB.conf[:ECHO] を設定する事でも同様の操作が行えま
す。
@param val true を指定した場合、irb のプロンプトでの評価結果を表示しま
す。false を指定した場合は表示しません。
@see IRB::Context#echo...