lib/rake/rake_module.rb in rake-10.1.1 vs lib/rake/rake_module.rb in rake-10.2.0
- old
+ new
@@ -1,11 +1,9 @@
require 'rake/application'
module Rake
- # Rake module singleton methods.
- #
class << self
# Current Rake Application
def application
@application ||= Rake::Application.new
end
@@ -13,10 +11,15 @@
# Set the current Rake application object.
def application=(app)
@application = app
end
+ def suggested_thread_count # :nodoc:
+ @cpu_count ||= Rake::CpuCounter.count
+ @cpu_count + 4
+ end
+
# Return the original directory where the Rake application was started.
def original_dir
application.original_dir
end
@@ -26,12 +29,10 @@
end
# Add files to the rakelib list
def add_rakelib(*files)
application.options.rakelib ||= []
- files.each do |file|
- application.options.rakelib << file
- end
+ application.options.rakelib.concat(files)
end
end
end