diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-02-09 14:51:20 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-02-09 14:53:34 +1300 |
commit | 1a0e151114d574b9cad8dc91e37587fcf1cd7c00 (patch) | |
tree | db60bbdd3dea147ae60cf661b3dfe8d90bf71737 | |
parent | 2949dc732428f1b1c57122286ded5190166d89ae (diff) | |
download | rack-external-gems.tar.gz |
Add support for testing external gems.external-gems
-rw-r--r-- | Rakefile | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -128,3 +128,25 @@ task pushsite: :pushdoc do sh "rsync -avz site/ rack.rubyforge.org:/var/www/gforge-projects/rack/" sh "cd site && git push" end + +def clone_and_test(url, name, command) + path = "external/#{name}" + FileUtils.rm_rf path + FileUtils.mkdir_p path + + sh("git clone #{url} #{path}") + + # I tried using `bundle config --local local.async ../` but it simply doesn't work. + File.open("#{path}/Gemfile", "a") do |file| + file.puts("gem 'rack', path: '../../'") + end + + sh("cd #{path} && bundle install && #{command}") +end + +task :external do + Bundler.with_clean_env do + clone_and_test("https://github.com/kickstarter/rack-attack", "rack-attack", "bundle exec rake") + clone_and_test("https://github.com/socketry/falcon", "falcon", "bundle exec rspec") + end +end |