-
Notifications
You must be signed in to change notification settings - Fork 436
/
Rakefile
54 lines (46 loc) · 1.36 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
53
54
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "better_errors/error_page_style"
RSpec::Core::RakeTask.new(:test)
task :default => :test
def gemfiles
@gemfiles ||= Dir[File.dirname(__FILE__) + '/gemfiles/*.gemfile']
end
def with_each_gemfile
gemfiles.each do |gemfile|
Bundler.with_clean_env do
puts "\n=========== Using gemfile: #{gemfile}"
ENV['BUNDLE_GEMFILE'] = gemfile
yield
end
end
end
namespace :test do
namespace :bundles do
desc "Install all dependencies necessary to test"
task :install do
with_each_gemfile { sh "bundle install" }
end
desc "Update all dependencies for tests"
task :update do
with_each_gemfile { sh "bundle update" }
end
end
desc "Test all supported sets of dependencies."
task :all => 'test:bundles:install' do
with_each_gemfile { sh "bundle exec rspec" rescue nil }
end
end
namespace :style do
desc "Build main.css from the SASS sources"
task :build do
css = BetterErrors::ErrorPageStyle.compiled_css(true)
File.open(File.expand_path("lib/better_errors/templates/main.css", File.dirname(__FILE__)), "w") do |f|
f.write(css)
end
end
desc "Remove main.css so that the SASS sources will be used directly"
task :develop do
File.unlink File.expand_path("lib/better_errors/templates/main.css", File.dirname(__FILE__))
end
end