lib/warbler/traits/bundler.rb
def add_bundler_files(jar)
        gemfile  = relative_from_pwd(config.bundler[:gemfile])
        lockfile = relative_from_pwd(config.bundler[:lockfile])
        jar.files[apply_pathmaps(config, gemfile, :application)] = config.bundler[:gemfile].to_s
        if File.exist?(lockfile)
          jar.files[apply_pathmaps(config, lockfile, :application)] = config.bundler[:lockfile].to_s
        end
        if config.bundler[:git_specs]
          pathmap = "#{config.relative_gem_path}/bundler/gems/%p"
          pathmap.sub!(%r{^/+}, '')
          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}/**/#{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 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
        end
      end
# Add Bundler Gemfiles and git repositories to the archive.
Add Bundler Gemfiles and git repositories to the archive.
Add Bundler Gemfiles and git repositories to the archive .
def add_bundler_files(jar)
        gemfile  = relative_from_pwd(config.bundler[:gemfile])
        lockfile = relative_from_pwd(config.bundler[:lockfile])
        jar.files[apply_pathmaps(config, gemfile, :application)] = config.bundler[:gemfile].to_s
        if File.exist?(lockfile)
          jar.files[apply_pathmaps(config, lockfile, :application)] = config.bundler[:lockfile].to_s
        end
        if config.bundler[:git_specs]
          pathmap = "#{config.relative_gem_path}/bundler/gems/%p"
          pathmap.sub!(%r{^/+}, '')
          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}/**/#{spec.name}.gemspec" 
            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 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
        end
      end
def add_bundler_files ( jar ) gemfile = relative_from_pwd ( config . bundler [ :gemfile ] ) lockfile = relative_from_pwd ( config . bundler [ :lockfile ] ) jar . files [ apply_pathmaps ( config , gemfile , :application ) ] = config . bundler [ :gemfile ] . to_s if File . exist? ( lockfile ) jar . files [ apply_pathmaps ( config , lockfile , :application ) ] = config . bundler [ :lockfile ] . to_s end if config . bundler [ :git_specs ] pathmap = "#{config.relative_gem_path}/bundler/gems/%p" pathmap . sub! ( %r{ ^/+ } , '' ) 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}/**/#{spec.name}.gemspec" 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 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 end end
Add Bundler Gemfiles and git repositories to the archive.
Add Bundler Gemfiles and git repositories to the archive .
# #42: gemspec only to avert Bundler error
jar