summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-09 14:51:20 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-09 17:17:21 +1300
commitc05b821f0cab7cda7b07b62eb39e21275c56abee (patch)
treee2c75c3a00c89d2bb14bed04b78c1cd5d139884e /Rakefile
parentab66846da493ad3a14e310cd56a1fd72e3b1016d (diff)
downloadrack-c05b821f0cab7cda7b07b62eb39e21275c56abee.tar.gz
Add support for testing external gems.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 237c3f26..430c4456 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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