るりまサーチ

最速Rubyリファレンスマニュアル検索!
372件ヒット [1-100件を表示] (0.045秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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
//}...
<< 1 2 3 ... > >>