372件ヒット
[1-100件を表示]
(0.045秒)
別のキーワード
ライブラリ
- ビルトイン (120)
- bigdecimal (36)
- csv (132)
-
irb
/ context (48) - stringio (24)
- un (12)
クラス
-
ARGF
. class (36) - BigDecimal (36)
- CSV (24)
-
CSV
:: Table (108) - File (12)
-
File
:: Stat (12) - IO (60)
-
IRB
:: Context (48) - StringIO (24)
モジュール
- Kernel (12)
キーワード
- [] (36)
- binmode (24)
-
by
_ col _ or _ row (12) -
by
_ col _ or _ row! (12) -
by
_ row (12) -
by
_ row! (12) - chmod (24)
-
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (12)
-
prompt
_ mode (12) -
prompt
_ mode= (12) - read (12)
- readlines (12)
- reopen (60)
- round (36)
- stat (12)
-
use
_ readline (12) -
use
_ readline? (12)
検索結果
先頭5件
-
CSV
:: Table # mode -> Symbol (18126.0) -
現在のアクセスモードを返します。
...現在のアクセスモードを返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
table = CSV::Table.new([row])
table.mode # => :col_or_row
table.by_col!
table.mode # => :col
//}... -
File
:: Stat # mode -> Integer (18120.0) -
ファイルモードを返します。
...ファイルモードを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
printf "%o\n", fs.mode
#例
#=> 100644
//}... -
IRB
:: Context # prompt _ mode=(mode) (6243.0) -
プロンプトモードを mode に設定します。
...プロンプトモードを mode に設定します。
@param mode プロンプトモードを Symbol で指定します。オリジナルの
プロンプトモードか、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、
:XMP、:NULL のいずれを指定してください。... -
ARGF
. class # inplace _ mode -> String | nil (6162.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...il を返します。
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.inplace_mode #......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) (6162.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...。
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf......き換える
ARGF.inplace_mode = '.bak'
ARGF.lines 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("fo......o","bar")' file.txt
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode... -
IRB
:: Context # prompt _ mode -> Symbol (6126.0) -
現在のプロンプトモードを Symbol で返します。
...そうでない場合は、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、:XMP、:NULL
のいずれかを返します。
定義済みのプロンプトモードの内容については、IRB.conf[:PROMPT][mode] を
参照してください。
@see IRB::Context#prompt_mode=, lib:irb#customize_prompt... -
ARGF
. class # binmode -> self (6125.0) -
self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。
...test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.binmode
ARGF.read.size # => 292
例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B
# $ ruby test.rb test1.png test2.png
ARGF.read.size # => 290
@see IO#binmode, ARGF.class#binmode?... -
IO
# binmode -> self (6113.0) -
ストリームをバイナリモードにします。MSDOS などバイナリモードの存在 する OS でのみ有効です。そうでない場合このメソッドは何もしません。
...ンしかありません。
@raise Errno::EXXX モードの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.open(IO.sysopen("testfile", "w+")) do |io|
io.binmode? # => false
io.binmode # => #<IO:fd 8>
io.binmode? # => true
end
//}
@see c:IO#io_binmode, IO#binmode?... -
File
# chmod(mode) -> 0 (136.0) -
ファイルのモードを指定された mode に変更します。
...ファイルのモードを指定された mode に変更します。
モードの変更に成功した場合は 0 を返します。失敗した場合は例外 Errno::EXXX が発生し
ます。
@param mode chmod(2) と同様に整数で指定します。
@raise IOError 自身が close され......ている場合に発生します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
f = File.new("out", "w");
f.chmod(0644) #=> 0
//}...