Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check each local gem's gemspec to see if any dependencies need to be …

…made local
  • Loading branch information...
commit 0d5d197f4f026a659a8630ab261f3a6ef8746bf9 1 parent 5567ca5
Nathan Broadbent authored
12 lib/bundler/local_development.rb
View
@@ -26,12 +26,24 @@ def gem_with_development(name, *args)
gem_dev_dir = ENV['GEM_DEV_DIR'] || "#{`echo $HOME`.strip}/code/gems"
path = File.join(gem_dev_dir, name)
if File.exist?(path)
+ # Check each local gem's gemspec to see if any dependencies need to be made local
+ gemspec_path = File.join(gem_dev_dir, name, "#{name}.gemspec")
+ process_gemspec_dependencies(gemspec_path, gem_dev_dir) if File.exist?(gemspec_path)
return gem_without_development name, :path => path
end
end
gem_without_development(name, *args)
end
alias :gem :gem_with_development
+
+ private
+ def process_gemspec_dependencies(gemspec_path, gem_dev_dir)
+ spec = Bundler.load_gemspec(gemspec_path)
+ spec.runtime_dependencies.each do |dep|
+ path = File.join(gem_dev_dir, dep.name)
+ gem_without_development(dep.name, :path => path) if File.exist?(path)
+ end
+ end
end
class Definition
2  lib/bundler_local_development/version.rb
View
@@ -1,3 +1,3 @@
module BundlerLocalDevelopment
- VERSION = "0.1.0"
+ VERSION = "0.2.0"
end
Please sign in to comment.
Something went wrong with that request. Please try again.