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 17:17:21 +1300 |
commit | c05b821f0cab7cda7b07b62eb39e21275c56abee (patch) | |
tree | e2c75c3a00c89d2bb14bed04b78c1cd5d139884e /Rakefile | |
parent | ab66846da493ad3a14e310cd56a1fd72e3b1016d (diff) | |
download | rack-c05b821f0cab7cda7b07b62eb39e21275c56abee.tar.gz |
Add support for testing external gems.
Diffstat (limited to 'Rakefile')
-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 |