Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/warbler/traits/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ def add_bundler_gems
# bundler gemspec from bundler/source.rb
if spec.name == "bundler"
full_gem_path = Pathname.new(spec.full_gem_path)
tries = 2
(full_gem_path = full_gem_path.dirname; tries -= 1) while tries > 0 && !full_gem_path.join('bundler.gemspec').exist?

while !full_gem_path.join('bundler.gemspec').exist?
full_gem_path = full_gem_path.dirname
# if at top of the path, meaning we cannot find bundler.gemspec, abort.
if full_gem_path.to_s=~/^[\.\/]$/
$stderr.puts("warning: Unable to detect bundler spec under '#{spec.full_gem_path}'' and is sub-dirs")
exit
end
end

spec.loaded_from = full_gem_path.join('bundler.gemspec').to_s
# RubyGems 1.8.x: @full_gem_path is cached, so we have to set it
def spec.full_gem_path=(p); @full_gem_path = p; end
Expand Down