Permalink
Browse files

allow setting rack dependency with env var (for CI)

  • Loading branch information...
rkh committed May 3, 2011
1 parent 482cd9e commit 9ca16a87ec0aeb4aa0879fff674ceb57df907662
Showing with 7 additions and 6 deletions.
  1. +7 −6 Gemfile
View
13 Gemfile
@@ -7,7 +7,6 @@
# If you have issues with a gem: `bundle install --without-coffee-script`.
RUBY_ENGINE = 'ruby' unless defined? RUBY_ENGINE
-TILT_REPO = "git://github.com/rtomayko/tilt.git"
source :rubygems unless ENV['QUICK']
gemspec
@@ -17,11 +16,13 @@ gem 'rack-test', '>= 0.5.6'
# Allows stuff like `tilt=1.2.2 bundle install` or `tilt=master ...`.
# Used by the CI.
-tilt = (ENV['tilt'] || 'stable').dup
-tilt.sub! 'tilt-', ''
-if tilt != 'stable'
- tilt = {:git => TILT_REPO, :branch => tilt} unless tilt =~ /(\d+\.)+\d+/
- gem 'tilt', tilt
+github = "git://github.com/%s.git"
+repos = { 'tilt' => github % "rtomayko/tilt", 'rack' => github % "rack/rack" }
+%w[tilt rack].each do |lib|
+ dep = (ENV[lib] || 'stable').sub "#{lib}-", ''
+ next if dep == 'stable'
+ dep = {:git => repos[lib], :branch => dep} unless dep =~ /(\d+\.)+\d+/
+ gem lib, dep
end
gem 'haml', '>= 3.0', :group => 'haml'

0 comments on commit 9ca16a8

Please sign in to comment.