288件ヒット
[1-100件を表示]
(0.171秒)
ライブラリ
- ビルトイン (72)
- bigdecimal (12)
- csv (132)
-
irb
/ context (48) - stringio (24)
クラス
-
ARGF
. class (24) - BigDecimal (12)
- CSV (24)
-
CSV
:: Table (108) -
File
:: Stat (12) - IO (36)
-
IRB
:: Context (48) - StringIO (24)
キーワード
- [] (36)
-
by
_ col _ or _ row (12) -
by
_ col _ or _ row! (12) -
by
_ row (12) -
by
_ row! (12) -
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (12)
-
prompt
_ mode (12) -
prompt
_ mode= (12) - read (12)
- readlines (12)
- reopen (48)
- round (12)
- stat (12)
-
use
_ readline (12) -
use
_ readline? (12)
検索結果
先頭5件
-
File
:: Stat # mode -> Integer (21214.0) -
ファイルモードを返します。
...ファイルモードを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
printf "%o\n", fs.mode
#例
#=> 100644
//}... -
CSV
:: Table # mode -> Symbol (21120.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
//}... -
IRB
:: Context # prompt _ mode=(mode) (12337.0) -
プロンプトモードを mode に設定します。
... mode に設定します。
@param mode プロンプトモードを Symbol で指定します。オリジナルの
プロンプトモードか、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、
:XMP、:NULL のいずれを指定してください。
@see IRB::Context#prompt_mod......e, lib:irb#customize_prompt... -
IRB
:: Context # prompt _ mode -> Symbol (12220.0) -
現在のプロンプトモードを Symbol で返します。
...そうでない場合は、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、:XMP、:NULL
のいずれかを返します。
定義済みのプロンプトモードの内容については、IRB.conf[:PROMPT][mode] を
参照してください。
@see IRB::Context#prompt_mode=, lib:irb#customize_prompt... -
ARGF
. class # inplace _ mode -> String | nil (6244.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) (6238.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...。
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf.......txt
---- argf.rb ----
# 引数のファイル中の各行の最初の "foo" を "bar" で置き換える
ARGF.inplace_mode = '.bak'
ARGF.lines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")' file.t......xt
---- -i オプションを使う場合その2 ----
$ ruby -i.bak -n -e 'print $_.sub("foo","bar")' file.txt
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode... -
IO
# stat -> File :: Stat (6213.0) -
ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。
...:Stat オブジェクトを生成して
返します。
@raise Errno::EXXX ステータスの読み込みに失敗した場合に発生します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two......\n")
File.open("testfile") do |f|
s = f.stat
"%o" % s.mode # => "100644"
s.blksize # => 4096
s.atime # => 2018-03-01 23:19:59 +0900
end
//}
@see File#lstat, File.stat, File.lstat... -
CSV
:: Table # inspect -> String (6113.0) -
モードとサイズを US-ASCII な文字列で返します。
...モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}... -
StringIO
# reopen(str , mode = & # 39;r+& # 39;) -> StringIO (3327.0) -
自身が表す文字列が指定された文字列 str になります。
...str になります。
与えられた str がフリーズされている場合には、mode はデフォルトでは読み取りのみに設定されます。
ブロックを与えた場合は生成した StringIO オブジェクトを引数としてブロックを評価します。
@param str......として使われます。StringIO#write などによって、
str 自身も書き換えられます。
@param mode Kernel.#open 同様文字列か整数で自身のモードを指定します。
@raise Errno::EACCES str がフリーズされていて、mode が書き込み可能に設......定されている場合に発生します。
//emlist[例][ruby]{
require 'stringio'
sio = StringIO.new("hoge", 'r+')
sio.reopen('foo')
p sio.read #=> "foo"
//}...