108件ヒット
[1-100件を表示]
(0.033秒)
種類
- 変数 (48)
- インスタンスメソッド (24)
- ライブラリ (12)
- 文書 (12)
- 特異メソッド (12)
クラス
- CSV (12)
- OptionParser (12)
モジュール
- Enumerable (12)
- Kernel (48)
キーワード
-
$ INPUT _ RECORD _ SEPARATOR (12) -
$ ORS (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
$ RS (12) - chunk (12)
- find (12)
- new (12)
-
ruby 1
. 6 feature (12)
検索結果
先頭5件
-
OptionParser
# separator(sep) -> () (18137.0) -
サマリにオプションを区切るための文字列 sep を挿入します。 オプションにいくつかの種類がある場合に、サマリがわかりやすくなります。
...= "Usage: example.rb [options]"
opts.separator ""
opts.separator "Specific options:"
opts.on("-r", "--require LIBRARY") do |lib|
options.library << lib
end
opts.separator ""
opts.separator "Common options:"
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
//}... -
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (6119.0) -
$/ の別名
...$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
Kernel
$ $ OUTPUT _ RECORD _ SEPARATOR -> String | nil (3113.0) -
$\ の別名
...$\ の別名
require "English"
print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb
ruby sample.rb
hoge
huga
fuge
ugo... -
Kernel
$ $ RS -> String | nil (3019.0) -
$/ の別名
...$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
ruby 1
. 6 feature (348.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...以前までは $; が有効にな
るのは引数省略時だけでした。
$; = ":"
p "a:b:c".split(nil)
=> -:2:in `split': bad separator (ArgumentError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby 1.6.7 (2002-07-30) [i586-linux]
["a", "b",......ーになっていました。
((<ruby-dev:17155>))
open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex IO for writing (IOError)
from -:3......トで 2 回シグナルを送らないと終了しない不具合が修正さ
れました。((<ruby-bugs-ja:PR#223>))
trap(:TERM, "EXIT")
END{
puts "exit"
}
Thread.start { Thread.stop }
sleep
: 2002-04-17: Regexp#inspect
((<ruby-bugs-ja:PR#222>))
p %r{\/}... -
find (24.0)
-
ディレクトリ配下のファイルを探索するためのモジュールです。
...人が書き込み可能な危険なコマンドを探す
for dir in ENV['PATH'].split(File::PATH_SEPARATOR)
Find.find(dir) do |fpath|
if File.file?(fpath) and (File.stat(fpath).mode & 022) != 0
printf("file %s is writable from other users\n", fpath)
end
end
end... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (18.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...", 10896]
# ...
//}
さらにこのメソッドは以下の値を特別扱いします。
* ブロックの評価値が nil もしくは :_separator であった場合、
その要素を捨てます。チャンクはこの前後で区切られます。
* ブロックの評価値 :_alone......symbols beginning with an underscore are reserved
# 「.to_a」無しだと Enumerator を返すのみで例外は発生しない
//}
nil、 :_separator はある要素を無視したい場合に用います。
例として svn log の出力のハイフンの所で区切りたい場合を考え......A[A-Z][A-Za-z0-9_]+\#/
open(filename) {|f|
f.chunk {|line| pat =~ line ? $& : :_alone }.each {|key, lines|
if key != :_alone
print lines.sort.join('')
else
print lines.join('')
end
}
}
//}
@raise RuntimeError 予約されている値を用いた場合に発生します... -
Kernel
$ $ ORS -> String | nil (13.0) -
$\ の別名
...$\ の別名
require "English"
print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb
ruby sample.rb
hoge
huga
fuge
ugo... -
CSV
. new(data , options = Hash . new) -> CSV (12.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...d, assuming that you
would have the same line endings there. If none of those sequences is
found, +data+ is ARGF, Object::STDIN, Object::STDOUT, or
Object::STDERR, or the stream is only available for output, the default
$INPUT_RECORD_SEPARATOR ($/) is used. Obviously,
discovery takes a......manually if speed is important. Also
note that IO objects should be opened in binary mode on Windows if this
feature will be used as the line-ending translation can cause
problems with resetting the document position to where it was before the
read ahead. This String will be transcoded......:field_size_limit
This is a maximum size CSV will read ahead looking for the closing quote
for a field. (In truth, it reads to the first line ending beyond this
size.) If a quote cannot be found within the limit CSV will raise a
MalformedCSVError, assuming the data is faulty. You can...