268件ヒット
[201-268件を表示]
(0.124秒)
別のキーワード
ライブラリ
クラス
- Array (4)
- CSV (24)
-
CSV
:: Table (24) - IO (12)
-
Net
:: HTTPResponse (24) - OptionParser (12)
- Pathname (36)
-
REXML
:: DocType (12) -
Rake
:: Application (12) -
Rake
:: PackageTask (24) - Socket (12)
- StringIO (48)
-
Zlib
:: GzipWriter (24)
キーワード
-
add
_ loader (12) - close (12)
- closed? (12)
- connect (12)
- ctime (12)
-
each
_ line (24) - fcntl (12)
- finish (12)
- load (12)
-
package
_ files (12) -
package
_ files= (12) - puts (12)
-
read
_ body (24) - reopen (24)
-
to
_ csv (16) -
to
_ s (12) -
write
_ headers? (12)
検索結果
先頭5件
-
Rake
:: PackageTask # package _ files=(file _ list) (3125.0) -
パッケージに含むファイルリストを設定します。
...list ファイルリストを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'
IO.write("test1.rb", "test")
IO.write("test2.rb", "test")
Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.package_files # => []
package_task.......package_files = FileList.new("test1.rb", "test2.rb")
package_task.package_files # => ["test1.rb", "test2.rb"]
end
//}... -
Rake
:: Application # add _ loader(ext , loader) (3119.0) -
与えられた拡張子で終わるファイル名のファイルをロードするためのローダーを 自身に追加します。
...@param ext 拡張子を指定します。
@param loader ローダーを指定します。
//emlist[例][ruby]{
require "rake/loaders/makefile"
# Rakefile での記載例とする
task default: :test
task :test
makefile =<<-EOS
<< <<-'SAMPLE_MF'
# Comments
a: a1 a2 a3 a4
EOS
IO.write("sample.m......f", makefile)
Rake.application.add_loader("mf", Rake::MakefileLoader.new)
Rake.application.add_import("sample.mf")
Rake::Task.task_defined?("a") # => false
Rake.application.load_imports
Rake::Task.task_defined?("a") # => true
//}... -
StringIO
# reopen(sio) -> StringIO (3116.0) -
自身が表す文字列が指定された StringIO と同じものになります。
...自身が表す文字列が指定された StringIO と同じものになります。
@param sio 自身が表したい StringIO を指定します。
//emlist[例][ruby]{
require 'stringio'
sio = StringIO.new("hoge", 'r+')
sio2 = StringIO.new("foo", 'r+')
sio.reopen(sio2)
p sio.read... -
Pathname
# each _ line(*args) {|line| . . . } -> nil (3073.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...ch(self.to_s, *args, &block) と同じです。
//emlist[例][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile",......"line1\nline2,\nline3\n")
Pathname("testfile").each_line {|f| p f }
# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}
//emlist[例 limit を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }
# => "line"
# => "1\n"
# => "l......ine"
# => "2,\n"
# => "line"
# => "3\n"
//}
//emlist[例 sep を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }
# => "line1\nline2,"
# => "\nline3\n"
//}
@see IO.foreach... -
OptionParser
# load(filename = nil) -> bool (3019.0) -
指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
...指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
パースが成功した場合に true を返します。
ファイルが存在しなかった場合に false を返します。
@param filename 各行をパースしたい......options/ に
プログラムのサフィックスを付けた '~/.options/コマンド名' というファイルをパースします。
//emlist[例][ruby]{
require "optparse"
IO.write("options.txt", %w(-a --b).join("\n"))
options = { a: false, b: false }
OptionParser.new do |opt|......opt.on('-a') { |v| options[:a] = v }
opt.on('--b') {|v| options[:b] = v }
opt.load("options.txt") # => true
opt.load("not_exist.txt") # => false
end
p options # => {:a=>true, :b=>true}
//}... -
StringIO
# closed? -> bool (3019.0) -
自身が既に close されていた場合に true を返します。そうでない場合は、false を返します。
...身が既に close されていた場合に true を返します。そうでない場合は、false を返します。
//emlist[例][ruby]{
require "stringio"
sio = StringIO.open("hoge")
p sio.closed? # => false
sio.close_read
p sio.closed? # => false
sio.close_write
p sio.closed? # => true
//}...