60件ヒット
[1-60件を表示]
(0.034秒)
別のキーワード
ライブラリ
- ビルトイン (60)
クラス
-
ARGF
. class (48) - IO (12)
キーワード
-
each
_ codepoint (24) -
inplace
_ mode (12) -
inplace
_ mode= (12)
検索結果
先頭5件
-
IO
# print(*arg) -> nil (18132.0) -
引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。
...場合は、$_ を出力します。
@param arg Kernel.#print と同じです。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]{
$stdout.print("This is ", 100......, " percent.\n") # => This is 100 percent.
//}
@see Kernel.#print... -
ARGF
. class # inplace _ mode -> String | nil (73.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...モードでない場合は nil を返します。
Ruby 起動時の -i オプション や ARGF.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.inpl......ak"
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.clas... -
ARGF
. class # inplace _ mode=(ext) (55.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...。
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf......ines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")' file.txt
---- -i オプションを使う場合その2 ----
$ ruby -i.bak -n -e 'print $_.sub("foo","bar")' file.txt
@see d:spec/rubycmd#cmd_optio... -
ARGF
. class # each _ codepoint -> Enumerator (31.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...numerator を返します。
例:
# $ 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,105,110,101,49,10,10... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (31.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...numerator を返します。
例:
# $ 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,105,110,101,49,10,10...