別のキーワード
ライブラリ
クラス
- CSV (36)
-
CSV
:: FieldInfo (12) -
RDoc
:: Markdown (12) -
Rake
:: FileList (12) -
RubyVM
:: InstructionSequence (24)
キーワード
-
$ DEFAULT _ INPUT (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ LAST _ PAREN _ MATCH (12) -
$ RS (12) - ARGF (12)
- Monitor (12)
- MonitorMixin (12)
- NKF (12)
- SizedQueue (12)
- bigdecimal (12)
-
break
_ on _ newline= (12) - caller (36)
- compile (12)
- convert (36)
- egrep (12)
- file (12)
- loop (24)
- new (12)
- timeout (21)
検索結果
先頭5件
-
CSV
:: FieldInfo # line=(val) (18100.0) -
行番号をセットします。
行番号をセットします。
@param val 行番号を指定します。 -
RDoc
:: Markdown # break _ on _ newline=(val) (6100.0) -
改行を保持した状態で出力するかどうかを設定します。
改行を保持した状態で出力するかどうかを設定します。 -
Rake
:: FileList # egrep(pattern) {|filename , count , line| . . . } (48.0) -
与えられたパターンをファイルリストから grep のように検索します。
...#{count}, line = #{line}"
end
end
# => "filename = sample1, count = 1, line = line1\n"
# => "filename = sample1, count = 2, line = line2\n"
# => "filename = sample1, count = 3, line = line3\n"
# => "filename = sample2, count = 1, line = line1\n"
# => "filename = sample2, count = 2, line = line2\n......"
# => "filename = sample2, count = 3, line = line3\n"
# => "filename = sample2, count = 4, line = line4\n"
//}... -
ARGF (12.0)
-
スクリプトに指定した引数 (Object::ARGV を参照) をファイル名とみなして、 それらのファイルを連結した 1 つの仮想ファイルを表すオブジェクトです。 ARGV が空なら標準入力を対象とします。 ARGV を変更すればこのオブジェクトの動作に影響します。
...ばこのオブジェクトの動作に影響します。
//emlist[][ruby]{
while line = ARGF.gets
# do something
end
//}
は、
//emlist[][ruby]{
while argv = ARGV.shift
File.open(argv) {|file|
while line = file.gets
# do something
end
}
end
//}
のように動作します... -
CSV
# convert {|field , field _ info| . . . } (12.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...p field_info
Date.parse(field)
end
p csv.first
# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Da... -
CSV
# convert {|field| . . . } (12.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...p field_info
Date.parse(field)
end
p csv.first
# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Da... -
CSV
# convert(name) (12.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...p field_info
Date.parse(field)
end
p csv.first
# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Da... -
bigdecimal (12.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...igdecimal"
File::open("digits.txt", "r") do |file|
s = BigDecimal("0")
while line = file.gets
s = s + BigDecimal(line)
end
puts s # => 0.3e0
end
File::open("digits.txt", "r") do |file|
s = 0
while line = file.gets
s = s + line.to_f
end
puts s # => 0.30000000000000004
end
/... -
Kernel
# file(*args) { . . . } -> Rake :: FileTask (6.0) -
ファイルタスクを定義します。
...ル名を指定します。
例:
file "config.cfg" => ["config.template"] do
open("config.cfg", "w") do |outfile|
open("config.template") do |infile|
while line = infile.gets
outfile.puts line
end
end
end
end
@see Rake::Task.define_task...