This repository was archived by the owner on Mar 5, 2025. It is now read-only.
forked from makandra/angular_xss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
70 lines (55 loc) · 1.63 KB
/
Rakefile
File metadata and controls
70 lines (55 loc) · 1.63 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require 'rake'
require 'bundler/gem_tasks'
desc 'Default: Run all specs.'
task :default => 'all:spec'
namespace :travis do
desc 'Run tests on Travis CI'
task :run => ['slimgems', 'all:bundle:install', 'all:spec']
desc 'Install slimgems'
task :slimgems do
if RUBY_VERSION == '1.8.7'
system('gem install slimgems')
end
end
end
namespace :all do
desc "Run specs on all spec apps"
task :spec do
success = true
for_each_directory_of('spec/**/Rakefile') do |directory|
env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
success &= system("cd #{directory} && #{env} bundle exec rake spec")
end
fail "Tests failed" unless success
end
namespace :bundle do
desc "Bundle all spec apps"
task :install do
for_each_directory_of('spec/**/Gemfile') do |directory|
Bundler.with_clean_env do
system("cd #{directory} && bundle install")
end
end
end
desc "Update all gems, or a list of gem given by the GEM environment variable"
task :update do
for_each_directory_of('spec/**/Gemfile') do |directory|
Bundler.with_clean_env do
system("cd #{directory} && bundle update #{ENV['GEM']}")
end
end
end
end
end
def for_each_directory_of(path, &block)
Dir[path].sort.each do |rakefile|
directory = File.dirname(rakefile)
puts '', "\033[44m#{directory}\033[0m", ''
if (RUBY_VERSION == '1.8.7' && directory =~ /-4\.2$/) ||
(RUBY_VERSION != '1.8.7' && directory =~ /-2\.3$/)
puts "Skipping tests for Ruby #{RUBY_VERSION} since it is unsupported"
else
block.call(directory)
end
end
end