るりまサーチ

最速Rubyリファレンスマニュアル検索!
77件ヒット [1-77件を表示] (0.050秒)
トップページ > クエリ:io[x] > クエリ:ask[x] > クエリ:new[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io readlines
  4. io each_line
  5. io each

ライブラリ

キーワード

検索結果

Rake::PackageTask.new(name = nil, version = nil) {|t| ... } -> Rake::PackageTask (21307.0)

自身を初期化してタスクを定義します。

...@param version パッケージのバージョンを指定します。
':noversion' というシンボルを指定するとバージョン情報をセットしません。

//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'

Rake::PackageTask.new("sample",...
..."1.0.0") do |package_task|
package_task.package_dir = "./pkg"
package_task.package_files.include("lib/**/*")
end

# rake -T を実行すると以下になる
# => rake clobber_package # Remove package products
# rake package # Build all the packages
# rake repackage # For...

Rake::InvocationChain.new(task_name, tail) (21213.0)

与えられたタスク名と一つ前の Rake::InvocationChain を用いて自身を初期化します。

...の Rake::InvocationChain を用いて自身を初期化します。

@param task_name タスク名を指定します。

@param tail 一つ前の Rake::InvocationChain を指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do...
...tail = Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
tail.to_s # => "TOP => task_a"
b = Rake::InvocationChain.new("task_b", tail)
b.to_s # => "TOP => task_a => task_b"
end
//}...

Rake::InvocationChain#append(task_name) -> Rake::InvocationChain (3206.0)

与えられたタスク名を追加して新しい Rake::InvocationChain を返します。

...e::InvocationChain を返します。

@param task_name 追加するタスク名を指定します。

@raise RuntimeError 循環したタスクの呼び出しを検出した場合に発生します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_ra...
...ke_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.append("task_b") # => LL("task_b", "task_a")
end
//}...

Rake::InvocationChain#member?(task_name) -> bool (3106.0)

与えられたタスク名が自身に含まれる場合は真を返します。 そうでない場合は偽を返します。

...task_name タスク名を指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
invocation_chain = Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.member?("task_a") # => true
invocation_...
...chain.member?("task_b") # => false
end
//}...

Rake::PackageTask#package_files=(file_list) (3024.0)

パッケージに含むファイルリストを設定します。

...する
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....

絞り込み条件を変える

Rake::PackageTask#package_files -> Rake::FileList (3018.0)

パッケージに含むファイルリストを返します。

...載例とする
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.include("*.rb")
package_task.package_files # => ["test1.rb", "test2.rb...

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...
...V と文字エンコーディング (M17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed...
...the target Encoding to avoid the translation.

It's also important to note that while all of CSV's core parser is now
Encoding agnostic, some features are not. For example, the built-in
converters will try to transcode data to UTF-8 before making conversions.
Again, you can provide custom converte...