bundler_local_development 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,8 @@ module Bundler
26
26
  end
27
27
 
28
28
  class Dsl
29
+ @@loaded_gemfiles = []
30
+
29
31
  alias :gem_without_development :gem
30
32
  def gem_with_development(name, *args)
31
33
  if ENV['GEM_DEV']
@@ -36,14 +38,19 @@ module Bundler
36
38
  # Check each local gem's gemspec to see if any dependencies need to be made local
37
39
  gemspec_path = File.join(dir, name, "#{name}.gemspec")
38
40
  process_gemspec_dependencies(gemspec_path) if File.exist?(gemspec_path)
41
+
39
42
  # Evaluate local gem's Gemfile, if present
40
43
  gemfile_path = File.join(dir, name, "Gemfile")
41
- if File.exist?(gemfile_path)
42
- gemfile = File.read(gemfile_path).
43
- gsub(/^(source|gemspec).*\s+/, ''). # Strip sources and gemspecs
44
- gsub(/^\s*gem ['"]rake['"].*/, '') # Strip rake
45
- eval gemfile
44
+ if File.exist?(gemfile_path) && !@@loaded_gemfiles.include?(gemfile_path)
45
+ gemfile_body = File.read(gemfile_path).
46
+ gsub(/^(source|gemspec).*\s+/, ''). # Strip sources and gemspecs
47
+ gsub(/^\s*gem ['"]rake['"].*/, '') # Strip rake
48
+ # Evaluate stripped Gemfile
49
+ eval gemfile_body
50
+ # Try to avoid infinite loops
51
+ @@loaded_gemfiles << gemfile_path
46
52
  end
53
+
47
54
  return gem_without_development name, :path => path
48
55
  end
49
56
  end
@@ -1,3 +1,3 @@
1
1
  module BundlerLocalDevelopment
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler_local_development
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: 3271112619999596464
60
+ hash: -1711414268459016600
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: 3271112619999596464
69
+ hash: -1711414268459016600
70
70
  requirements: []
71
71
  rubyforge_project:
72
72
  rubygems_version: 1.8.24