Permalink
Browse files

Merge branch 'master' of git://github.com/phanle/cucumber-tmbundle

  • Loading branch information...
2 parents 65ff59e + cacfefe commit 51a6ebef0526a970349c8cef2285a0a9eeaae398 @aslakhellesoy aslakhellesoy committed Apr 10, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 Support/lib/cucumber/mate.rb
@@ -4,8 +4,11 @@
if ENV['TM_PROJECT_DIRECTORY']
rspec_rails_plugin = File.join(ENV['TM_PROJECT_DIRECTORY'],'vendor','plugins','rspec','lib')
rspec_merb_gem = (merb_dir = (Dir["#{ENV['TM_PROJECT_DIRECTORY']}/gems/gems/rspec*"].first || '')) && File.join(merb_dir, "lib")
-
- if File.directory?(rspec_rails_plugin)
+ bundler_gemfile = File.join(ENV['TM_PROJECT_DIRECTORY'], 'Gemfile')
+ if File.exists?(bundler_gemfile)
+ bundle_path = (File.read(bundler_gemfile) =~ (/bundle_path[ (]+['"](.*?)['"]/) && $1) || ".bundle"
+ require File.join(ENV['TM_PROJECT_DIRECTORY'], bundle_path, "environment")
+ elsif File.directory?(rspec_rails_plugin)
$LOAD_PATH.unshift(rspec_rails_plugin)
elsif File.directory?(rspec_merb_gem)
$LOAD_PATH.unshift(rspec_merb_gem)

0 comments on commit 51a6ebe

Please sign in to comment.