Rakefile in rubygems-update-3.1.0.pre2 vs Rakefile in rubygems-update-3.1.0.pre3
- old
+ new
@@ -18,13 +18,14 @@
task :git_hooks do
sh "git config core.hooksPath .githooks"
end
Rake::TestTask.new do |t|
- t.ruby_opts = %w[--disable-gems -w]
+ t.ruby_opts = %w[-w]
t.ruby_opts << '-rdevkit' if Gem.win_platform?
+ t.libs << "libs"
t.libs << "test"
t.libs << "bundler/lib"
t.test_files = FileList['test/**/test_*.rb']
end
@@ -374,21 +375,39 @@
]
end
# Misc Tasks ---------------------------------------------------------
+module Rubygems
+ class ProjectFiles
+
+ def self.all
+ files = []
+ exclude = %r[\.git|\./bundler/(?!lib|man|exe|[^/]+\.md|bundler.gemspec)]ox
+ tracked_files = `git ls-files --recurse-submodules`.split("\n").map {|f| "./#{f}" }
+
+ tracked_files.each do |path|
+ next unless File.file?(path)
+ next if path =~ exclude
+ files << path[2..-1]
+ end
+
+ files
+ end
+
+ end
+end
+
desc "Update the manifest to reflect what's on disk"
task :update_manifest do
- files = []
- exclude = %r[\.git|\./bundler/(?!lib|man|exe|[^/]+\.md|bundler.gemspec)]ox
- tracked_files = `git ls-files --recurse-submodules`.split("\n").map {|f| "./#{f}" }
+ File.open('Manifest.txt', 'w') {|f| f.puts(Rubygems::ProjectFiles.all.sort) }
+end
- tracked_files.each do |path|
- next unless File.file?(path)
- next if path =~ exclude
- files << path[2..-1]
+desc "Check the manifest is up to date"
+task :check_manifest do
+ if File.read("Manifest.txt").split.sort != Rubygems::ProjectFiles.all.sort
+ abort "Manifest is out of date. Run `rake update_manifest` to sync it"
end
- File.open('Manifest.txt', 'w') {|f| f.puts(files.sort) }
end
namespace :bundler do
desc "Initialize bundler submodule"
task :checkout do