4件ヒット
[1-4件を表示]
(0.120秒)
キーワード
-
each
_ codepoint (2) -
inplace
_ mode (1) -
inplace
_ mode= (1)
検索結果
先頭4件
-
ARGF
. class # inplace _ mode -> String | nil (18418.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"
# $ c......ine {|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 # inplace _ mode=(ext) (18382.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...e.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_option, ARGF.class#inplace_mode... -
ARGF
. class # each _ codepoint -> Enumerator (18364.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
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
. class # each _ codepoint { |c| . . . } -> self (18364.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
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>
...