summaryrefslogtreecommitdiff
path: root/lib/rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake')
-rw-r--r--lib/rake/loaders/makefile.rb23
-rw-r--r--lib/rake/packagetask.rb1
-rw-r--r--lib/rake/rdoctask.rb14
-rw-r--r--lib/rake/tasklib.rb11
-rw-r--r--lib/rake/testtask.rb7
5 files changed, 31 insertions, 25 deletions
diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb
index f66eb3b35f7..9ade098a1bf 100644
--- a/lib/rake/loaders/makefile.rb
+++ b/lib/rake/loaders/makefile.rb
@@ -7,31 +7,26 @@ module Rake
# Load the makefile dependencies in +fn+.
def load(fn)
- buffer = ''
open(fn) do |mf|
- mf.each do |line|
- next if line =~ /^\s*#/
- buffer << line
- if buffer =~ /\\$/
- buffer.sub!(/\\\n/, ' ')
- state = :append
- else
- process_line(buffer)
- buffer = ''
- end
+ lines = mf.read
+ lines.gsub!(/#[^\n]*\n/m, "")
+ lines.gsub!(/\\\n/, ' ')
+ lines.split("\n").each do |line|
+ process_line(line)
end
end
- process_line(buffer) if buffer != ''
end
private
# Process one logical line of makefile data.
def process_line(line)
- file_task, args = line.split(':')
+ file_tasks, args = line.split(':')
return if args.nil?
dependents = args.split
- file file_task => dependents
+ file_tasks.strip.split.each do |file_task|
+ file file_task => dependents
+ end
end
end
diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb
index 71b66a64811..4b0775d09c4 100644
--- a/lib/rake/packagetask.rb
+++ b/lib/rake/packagetask.rb
@@ -122,6 +122,7 @@ module Rake
task :package => ["#{package_dir}/#{file}"]
file "#{package_dir}/#{file}" => [package_dir_path] + package_files do
chdir(package_dir) do
+ sh %{env}
sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}}
end
end
diff --git a/lib/rake/rdoctask.rb b/lib/rake/rdoctask.rb
index 54adc6feb5f..6cfbda1d6a0 100644
--- a/lib/rake/rdoctask.rb
+++ b/lib/rake/rdoctask.rb
@@ -55,7 +55,7 @@ module Rake
# RDoc. (default is none)
attr_accessor :main
- # Name of template to be used by rdoc. (default is 'html')
+ # Name of template to be used by rdoc. (defaults to rdoc's default)
attr_accessor :template
# List of files to be included in the rdoc generation. (default is [])
@@ -74,7 +74,7 @@ module Rake
@rdoc_dir = 'html'
@main = nil
@title = nil
- @template = 'html'
+ @template = nil
@external = false
@options = []
yield self if block_given?
@@ -91,18 +91,18 @@ module Rake
task name
desc "Force a rebuild of the RDOC files"
- task paste("re", name) => [paste("clobber_", name), name]
+ task "re#{name}" => ["clobber_#{name}", name]
desc "Remove rdoc products"
- task paste("clobber_", name) do
+ task "clobber_#{name}" do
rm_r rdoc_dir rescue nil
end
-
- task :clobber => [paste("clobber_", name)]
+
+ task :clobber => ["clobber_#{name}"]
directory @rdoc_dir
task name => [rdoc_target]
- file rdoc_target => @rdoc_files + [$rakefile] do
+ file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
rm_r @rdoc_dir rescue nil
args = option_list + @rdoc_files
if @external
diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb
index 465a58a0c7e..c7fd98133c7 100644
--- a/lib/rake/tasklib.rb
+++ b/lib/rake/tasklib.rb
@@ -6,11 +6,16 @@ module Rake
# Base class for Task Libraries.
class TaskLib
-
include Cloneable
- # Make a symbol by pasting two strings together.
- def paste(a,b)
+ # Make a symbol by pasting two strings together.
+ #
+ # NOTE: DEPRECATED! This method is kinda stupid. I don't know why
+ # I didn't just use string interpolation. But now other task
+ # libraries depend on this so I can't remove it without breaking
+ # other people's code. So for now it stays for backwards
+ # compatibility. BUT DON'T USE IT.
+ def paste(a,b) # :nodoc:
(a.to_s + b.to_s).intern
end
end
diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb
index f5b77e5957a..79154e422b6 100644
--- a/lib/rake/testtask.rb
+++ b/lib/rake/testtask.rb
@@ -136,7 +136,12 @@ module Rake
end
def fix # :nodoc:
- ''
+ case RUBY_VERSION
+ when '1.8.2'
+ find_file 'rake/ruby182_test_unit_fix'
+ else
+ nil
+ end || ''
end
def rake_loader # :nodoc: