44件ヒット
[1-44件を表示]
(0.028秒)
種類
- インスタンスメソッド (22)
- 文書 (11)
- クラス (11)
クラス
-
Rake
:: FileList (22)
キーワード
- CSV (11)
- existing! (11)
-
ruby 1
. 8 . 4 feature (11)
検索結果
先頭4件
-
Rake
:: FileList # existing -> Rake :: FileList (21231.0) -
自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含む Rake::FileList を返します。
...む Rake::FileList を返します。
//emlist[][ruby]{
# Rakefile での記載例とする
IO.write("test1.rb", "test")
IO.write("test2.rb", "test")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.existing # => ["test... -
Rake
:: FileList # existing! -> self (9137.0) -
自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含むように自身を変更して返します。
...ist[][ruby]{
# Rakefile での記載例とする
IO.write("test1.rb", "test")
IO.write("test2.rb", "test")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.existing! # => ["test1.rb", "test2.rb"]
file_list #... -
ruby 1
. 8 . 4 feature (324.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...ture/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8.4 feature/File.dirname [change]>))
* ((<ruby 1.8.4 featu......re/File::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_missing [bug]>))
* ((<ruby 1.8.4 feature/IO [......23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * lib/find.rb (Find::find): should not ignore symbolic links to
# non-existing files. [ruby-talk:165866]
broken symbolic link(存在しないファイルに対するシンボリックリン
ク)も返すようにな... -
CSV (36.0)
-
このクラスは 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") do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2......)
# => [["Ruby", "1995"], ["Rust", "2010"]]
//}
=== 書き込み
//emlist[][ruby]{
require 'csv'
# ファイルへ書き込み
CSV.open("path/to/file.csv", "wb") do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end
# 文字列へ書き込み
csv_string = CSV.gen......ethods that allow you to open IO objects (CSV::foreach(), CSV::open(),
CSV::read(), and CSV::readlines()) do allow you to specify the Encoding.
One minor exception comes when generating CSV into a String with an Encoding
that is not ASCII compatible. There's no existing data for CSV to use to
prep...