module Rake
def add_rakelib(*files)
def add_rakelib(*files) application.options.rakelib ||= [] application.options.rakelib.concat(files) end
def application
def application @application ||= Rake::Application.new end
def application=(app)
def application=(app) @application = app end
def each_dir_parent(dir) # :nodoc:
Yield each file or directory component.
def each_dir_parent(dir) # :nodoc: old_length = nil while dir != "." && dir.length != old_length yield(dir) old_length = dir.length dir = File.dirname(dir) end end
def from_pathname(path) # :nodoc:
leave everything else alone
Convert Pathname and Pathname-like objects to strings;
def from_pathname(path) # :nodoc: path = path.to_path if path.respond_to?(:to_path) path = path.to_str if path.respond_to?(:to_str) path end
def load_rakefile(path)
def load_rakefile(path) load(path) end
def original_dir
def original_dir application.original_dir end
def suggested_thread_count # :nodoc:
def suggested_thread_count # :nodoc: @cpu_count ||= Rake::CpuCounter.count @cpu_count + 4 end
def with_application(block_application = Rake::Application.new)
def with_application(block_application = Rake::Application.new) orig_application = Rake.application Rake.application = block_application yield block_application block_application ensure Rake.application = orig_application end