Permalink
Browse files

Evaluate local gem's Gemfile, if present

  • Loading branch information...
1 parent 1e60d65 commit 200e03801bbf4716cfecbdafd332609ed701c6d3 @ndbroadbent committed Nov 10, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/bundler/local_development.rb
@@ -36,6 +36,14 @@ def gem_with_development(name, *args)
# Check each local gem's gemspec to see if any dependencies need to be made local
gemspec_path = File.join(dir, name, "#{name}.gemspec")
process_gemspec_dependencies(gemspec_path) if File.exist?(gemspec_path)
+ # Evaluate local gem's Gemfile, if present
+ gemfile_path = File.join(dir, name, "Gemfile")
+ if File.exist?(gemfile_path)
+ gemfile = File.read(gemfile_path).
+ gsub(/^(source|gemspec).*\s+/, ''). # Strip sources and gemspecs
+ gsub(/^\s*gem ['"]rake['"].*/, '') # Strip rake
+ eval gemfile
+ end
return gem_without_development name, :path => path
end
end

0 comments on commit 200e038

Please sign in to comment.