るりまサーチ

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

別のキーワード

  1. _builtin take_while
  2. _builtin take
  3. tuple take
  4. lazy take_while
  5. array take_while

種類

ライブラリ

検索結果

CSV (38394.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

... CSV ファイルやデータに対する完全なインターフェイスを提供します。

=== 読み込み

//emlist[][ruby]{
require "csv"

csv
_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV
_TEXT

IO.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV
.foreach("sample.csv")...
...010"]

# ファイルから一度に
p CSV.read("sample.csv")
# => [["Ruby", "1995"], ["Rust", "2010"]]

# 文字列から一行ずつ
CSV
.parse(csv_text) do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2010"]

# 文字列から一度に
p CSV.parse(csv_text)
# => [["Ruby", "1995"], ["Rust...
...u) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
Encoding of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of course, to accomplish this multiencoding
support....

NEWS for Ruby 3.0.0 (36.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a RuntimeError is now raised (previously,
it only issued a warning in verbose mode)....
...ray#slice / Array#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*
* Can be sliced with Enumerator::ArithmeticSequence

//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1"...
...is Ractor compatible.
* Bundler
* Update to Bundler 2.2.3
* CGI
* Update to 0.2.0
* This version is Ractor compatible.
* CSV
* Update to CSV 3.1.9
* Date
* Update to Date 3.1.1
* This version is Ractor compatible.
* Digest
* Update to Digest 3.0.0
* This ver...

NEWS for Ruby 2.7.0 (18.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...#=> ["FOO!?", "BAR!?", "BAZ!?"]
//}
//emlist[Enumerator::Lazy#with_index][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}

* Fiber
* 新規メソッド
* Fiber#raiseメソッドが追加され、Fiber#resumeのよう...
...れた文字があるときに2~5倍速くなりました。
https://github.com/ruby/ruby/pull/2226

* CSV
* 3.1.2に更新されました。
https://github.com/ruby/csv/blob/master/NEWS.md

* Date
* Date.jisx0301, Date#jisx0301, Date.parseが新しい日本の年号を...

NEWS for Ruby 3.1.0 (12.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...&)
end
//}

* ピン演算子に式を書けるようになりました。 17411

//emlist{
Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a
#=> [[3, 5], [5, 7], [11, 13]]
//}

* ピン演算子がインスタンス変数、クラス変数、グローバル変数をサポート...
...新されました。
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb 2.2.3
* error_highlight 0.3.0
* etc 1.3.0...