File: run_all.rb

package info (click to toggle)
ruby-i18n 1.14.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 764 kB
  • sloc: ruby: 6,560; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 510 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def bundle_check
  `bundle check` == "Resolving dependencies...\nThe Gemfile's dependencies are satisfied\n"
end

def execute(command)
  puts command
  system command
end

gemfiles = %w(Gemfile) + Dir['gemfiles/Gemfile*'].reject { |f| f.end_with?('.lock') }

results = gemfiles.map do |gemfile|
  puts "\nBUNDLE_GEMFILE=#{gemfile}"
  ENV['BUNDLE_GEMFILE'] = File.expand_path("../../#{gemfile}", __FILE__)

  execute 'bundle install' unless bundle_check
  execute 'bundle exec rake test'
end

exit results.all?