forked from clbustos/haml-i18n-extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (45 loc) · 1.18 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env rake
require "bundler/gem_tasks"
require 'rake/testtask'
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
def silence_warnings
the_real_stderr, $stderr = $stderr, StringIO.new
yield
ensure
$stderr = the_real_stderr
end
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
t.test_files = Dir["test/**/*_test.rb"]
end
task :default => :test
namespace :test do
namespace :bundles do
desc "Install all dependencies necessary to test."
task :install do
with_each_gemfile {sh "bundle"}
end
desc "Update all dependencies for testing."
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
with_each_gemfile {sh "bundle exec rake test"}
end
task :rc => :rails_compatibility
end
# FIXME, jsut run this
task :force_build_and_install do
%{ gem uninstall -x haml-i18n-extractor; rm *gem; gem build *gemspec; gem install --local *gem }
end