Rakefile in haml-3.1.8 vs Rakefile in haml-3.2.0.alpha.2
- old
+ new
@@ -67,11 +67,11 @@
sh %{chmod a+rx #{file}}
end
end
task :revision_file do
- require scope('lib/haml')
+ require 'lib/haml'
release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
if Haml.version[:rev] && !release
File.open(scope('REVISION'), 'w') { |f| f.puts Haml.version[:rev] }
elsif release
@@ -302,13 +302,11 @@
rescue LoadError; end
# ----- Testing Multiple Rails Versions -----
rails_versions = [
- "v3.1.0",
- "v3.0.10",
- "v2.3.14",
+ "v2.3.5",
"v2.2.3",
"v2.1.2",
]
rails_versions << "v2.0.5" if RUBY_VERSION =~ /^1\.8/
@@ -319,48 +317,25 @@
puts "Testing Rails #{version}"
Rake::Task['test'].reenable
Rake::Task['test'].execute
end
-def gemfiles
- @gemfiles ||=
+namespace :test do
+ desc "Test all supported versions of rails. This takes a while."
+ task :rails_compatibility do
+ sh %{rm -rf test/rails}
+ puts "Checking out rails. Please wait."
+ sh %{git clone git://github.com/rails/rails.git test/rails}
begin
- raise 'Must install bundler to run Rails compatibility tests' if `which bundle`.empty?
- Dir[File.dirname(__FILE__) + '/test/gemfiles/Gemfile.*'].
- reject {|f| f =~ /\.lock$/}.
- reject {|f| RUBY_VERSION !~ /^1\.8/ && f =~ /Gemfile\.rails-2\.[0-2]/}
- end
-end
+ rails_versions.each {|version| test_rails_version version}
-def with_each_gemfile
- old_env = ENV['BUNDLE_GEMFILE']
- gemfiles.each do |gemfile|
- puts "Using gemfile: #{gemfile}"
- ENV['BUNDLE_GEMFILE'] = gemfile
- yield
- end
-ensure
- ENV['BUNDLE_GEMFILE'] = old_env
-end
-
-namespace :test do
- namespace :bundles do
- desc "Install all dependencies necessary to test Haml."
- task :install do
- with_each_gemfile {sh "bundle install"}
+ puts "Checking out rails_xss. Please wait."
+ sh %{git clone git://github.com/NZKoz/rails_xss.git test/plugins/rails_xss}
+ test_rails_version(rails_versions.find {|s| s =~ /^v2\.3/})
+ ensure
+ `rm -rf test/rails`
+ `rm -rf test/plugins`
end
-
- desc "Update all dependencies for testing Haml."
- task :update do
- with_each_gemfile {sh "bundle update"}
- end
- end
-
- desc "Test all supported versions of rails. This takes a while."
- task :rails_compatibility => 'test:bundles:install' do
- `rm -rf test/rails`
- `rm -rf test/plugins`
- with_each_gemfile {sh "bundle exec rake test"}
end
end
# ----- Handling Updates -----