Skip to content

Commit

Permalink
Merge pull request #78 from patcheng/master-issue77
Browse files Browse the repository at this point in the history
fixes #77.
  • Loading branch information
nicksieger committed Feb 28, 2012
2 parents 75b9571 + 2b37218 commit beebfe2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/warbler/traits/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,26 @@ def add_bundler_files(jar)
config.pathmaps.git = [pathmap]
config.bundler[:git_specs].each do |spec|
full_gem_path = Pathname.new(spec.full_gem_path)

gem_relative_path = full_gem_path.relative_path_from(::Bundler.install_path)
filenames = []
gem_relative_path.each_filename { |f| filenames << f }

exclude_gems = true
unless filenames.empty?
full_gem_path = Pathname.new(::Bundler.install_path) + filenames.first
exclude_gems = false
end

if spec.groups.include?(:warbler_excluded)
pattern = "#{full_gem_path.to_s}/*.gemspec" # #42: gemspec only to avert Bundler error
pattern = "#{full_gem_path.to_s}/**/#{spec.name}.gemspec" # #42: gemspec only to avert Bundler error
else
pattern = "#{full_gem_path.to_s}/**/*"
end

FileList[pattern].each do |src|
f = Pathname.new(src).relative_path_from(full_gem_path).to_s
next if config.gem_excludes && config.gem_excludes.any? {|rx| f =~ rx }
next if exclude_gems && config.gem_excludes && config.gem_excludes.any? {|rx| f =~ rx }
jar.files[apply_pathmaps(config, File.join(full_gem_path.basename, f), :git)] = src
end
end
Expand Down

0 comments on commit beebfe2

Please sign in to comment.