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?
|