Browse files

Add Gemfile, handy for CI.

  • Loading branch information...
1 parent 3d19773 commit 41e22c93539f0e92c5edf88d7815de93169241cf @rkh committed Jun 21, 2010
Showing with 23 additions and 2 deletions.
  1. +20 −0 Gemfile
  2. +3 −2 tasks/spec.task
View
20 Gemfile
@@ -0,0 +1,20 @@
+source :rubygems
+
+gem 'rack', '= 1.1.0' # 1.2 has issues
+gem 'haml'
+gem 'compass'
+gem 'rack-test'
+gem 'yard', "~> 0.5.3"
+gem 'sinatra-default_charset', '>= 0.2.0'
+gem 'rack-flash', '>= 0.1.1'
+gem 'rspec', '~> 1.3.0'
+gem 'rake', '>= 0.8.7'
+gem 'bundler', '>= 0.9'
+
+# could have used groups, but this is easier. plays nice with hudson.
+if ENV['SINATRA'] == 'sinatra master' then gem 'sinatra', :git => "git://github.com/sinatra/sinatra.git"
+else gem 'sinatra', '>= 1.0'
+end
+
+ext = ENV['EXT'] || 'backports'
+gem(*ext.split(' '))
View
5 tasks/spec.task
@@ -1,9 +1,10 @@
-def rspec(pattern, format = nil, more_opts = nil, ruby = RUBY)
+def rspec(pattern, format = nil, more_opts = nil, ruby = RUBY, command = 'spec')
format ||= ENV["FORMAT"] || :progress
libs = Dir.glob("{*,.}/lib").join File::PATH_SEPARATOR
files = Dir.glob(pattern).map { |f| f.inspect }.join " "
opts = ["-b -c --format #{format} --loadby mtime --reverse", *more_opts].compact.join " "
- sh "#{ruby} -I#{libs} -S spec #{opts} #{files}"
+ command = "bundle exec #{command}" if ENV['BUNDLER']
+ sh "RUBYLIB=#{libs}:#{ENV['RUBYLIB']} #{ruby} -S #{command} #{opts} #{files}"
end
pattern = "spec/**/*_spec.rb"

0 comments on commit 41e22c9

Please sign in to comment.