ライブラリ
- ビルトイン (127)
- coverage (6)
- csv (44)
-
irb
/ input-method (11) - pp (11)
- prettyprint (44)
- psych (47)
- readline (275)
- ripper (22)
-
ripper
/ filter (11) -
ripper
/ lexer (22) -
ripper
/ sexp (22) -
rubygems
/ installer (11) - shellwords (11)
- tracer (22)
クラス
- CSV (44)
- Coverage (6)
-
Gem
:: Installer (11) - IO (88)
-
IRB
:: ReadlineInputMethod (11) - PP (11)
- PrettyPrint (44)
- Ripper (66)
-
Ripper
:: Filter (11) -
RubyVM
:: InstructionSequence (22) - TracePoint (11)
- Tracer (22)
モジュール
- Psych (47)
- Readline (132)
-
RubyVM
:: AbstractSyntaxTree (6) - Shellwords (11)
オブジェクト
-
Readline
:: HISTORY (143)
キーワード
- << (11)
- [] (11)
- []= (11)
-
add
_ filter (22) -
basic
_ quote _ characters (11) -
basic
_ word _ break _ characters (11) - binread (11)
- clear (11)
- compile (11)
-
completer
_ quote _ characters (11) -
completer
_ word _ break _ characters (11) -
completion
_ append _ character (11) -
completion
_ case _ fold (11) -
completion
_ proc (11) -
delete
_ at (11) - dump (22)
- each (11)
-
emacs
_ editing _ mode (11) - empty? (11)
-
filename
_ quote _ characters (11) - foreach (22)
- format (11)
-
generate
_ line (11) -
get
_ screen _ size (11) - length (11)
- lex (11)
-
line
_ stub (6) - load (14)
- new (99)
- of (2)
- parse (24)
-
parse
_ file (2) -
parse
_ line (11) - pop (11)
- push (11)
- readlines (44)
-
set
_ screen _ size (11) - sexp (11)
-
sexp
_ raw (11) - shift (11)
-
singleline
_ format (11) -
singleline
_ pp (11) - size (11)
- split (11)
-
to
_ s (11) - tokenize (11)
-
vi
_ editing _ mode (11) - write (22)
検索結果
先頭5件
- CSV
. parse _ line(line , options = Hash . new) -> Array - PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object - IO
. readlines(path , limit , chomp: false , opts={}) -> [String] - IO
. readlines(path , rs = $ / , chomp: false , opts={}) -> [String] - IO
. readlines(path , rs , limit , chomp: false , opts={}) -> [String]
-
CSV
. parse _ line(line , options = Hash . new) -> Array (6327.0) -
このメソッドは一行の CSV 文字列を配列に変換するためのショートカットです。
...です。
@param line 文字列を指定します。複数行の文字列を指定した場合は、一行目以外は無視します。
@param options CSV.new のオプションと同じオプションを指定できます。
//emlist[例][ruby]{
require 'csv'
p CSV.parse_line("1,taro,tanaka,20......naka", "20"]
p CSV.parse_line("1|taro|tanaka|20", col_sep: '|')
# => ["1", "taro", "tanaka", "20"]
# 列をダブルクオートで囲むとその中にカンマや改行を含める事もできる。
# 他の仕様も含め詳しくはRFC4180を参照。
p CSV.parse_line("1,\"ta,ro\",\"tana\nka\"... -
PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (6301.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 PrettyPrint.format に似ていますが、改行しません。
...、それを引数としてブロックを実行します。
PrettyPrint.format に似ていますが、改行しません。
引数 maxwidth, newline と genspace は無視されます。ブロック中の breakable の実行は、
改行せずに text の実行であるかのように扱います......。
@param output 出力先を指定します。output は << メソッドを持っていなければなりません。
@param maxwidth 無視されます。
@param newline 無視されます。
@param genspace 無視されます。... -
IO
. readlines(path , limit , chomp: false , opts={}) -> [String] (6261.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...tfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
I......O.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , rs = $ / , chomp: false , opts={}) -> [String] (6261.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...tfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
I......O.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , rs , limit , chomp: false , opts={}) -> [String] (6261.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...tfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
I......O.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , limit , opts={}) -> [String] (6231.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...、ファイルの読み込みに失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}... -
IO
. readlines(path , rs = $ / , opts={}) -> [String] (6231.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...、ファイルの読み込みに失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}... -
IO
. readlines(path , rs , limit , opts={}) -> [String] (6231.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...、ファイルの読み込みに失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}... -
Coverage
. line _ stub(file) -> Array (6214.0) -
行カバレッジの配列のスタブを返します。
...do |x|
s += x
end
if s == 45
p :ok
else
p :ng
end
//}
このファイルに対して line_stub を実行すると、次のようになります。
//emlist[][ruby]{
require "coverage"
p Coverage.line_stub("foo.rb") #=> [0, 0, 0, nil, nil, 0, 0, nil, 0, nil]
//}
この例において、空... -
CSV
. generate _ line(row , options = Hash . new) -> String (6208.0) -
このメソッドは一つの Array オブジェクトを CSV 文字列に変換するためのショートカットです。 複数行のCSVを扱う際はCSV#<<を使うとより高速です。
...コーディングを指定することができます。
:row_sep というキーの値には $/ がセットされます。
//emlist[例][ruby]{
require "csv"
taro = ['1', 'taro', 'tanaka', '20']
CSV.generate_line(taro, col_sep: '|') # => "1|taro|tanaka|20\n"
//}
@see CSV.new... -
PP
. singleline _ pp(obj , out= $ >) -> object (6201.0) -
指定されたオブジェクト obj を出力先 out に出力します。 ただし、インデントも改行もしません。 出力先 out を返します。
指定されたオブジェクト obj を出力先 out に出力します。
ただし、インデントも改行もしません。
出力先 out を返します。
@param obj 表示したいオブジェクトを指定します。
@param out 出力先を指定します。<< メソッドが定義されている必要があります。 -
CSV
. readlines(path , options = Hash . new) -> [Array] | CSV :: Table (3201.0) -
CSV ファイルを配列の配列にするために使います。 headers オプションに偽でない値を指定した場合は CSV::Table オブジェクトを返します。
CSV ファイルを配列の配列にするために使います。
headers オプションに偽でない値を指定した場合は CSV::Table オブジェクトを返します。
@param path CSV ファイルのパスを指定します。
@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると入力のエンコーディングを指定することができます。
入力のエンコーディングか Encoding.default_external と異なる場合は
必ず指定... -
IRB
:: ReadlineInputMethod . new -> IRB :: ReadlineInputMethod (3201.0) -
自身を初期化します。
自身を初期化します。