Sha256: 8d539437286e76089ea608a2d0fb4431371c4d2159ee49cdf6273b948deccecf

Contents?: true

Size: 648 Bytes

Versions: 7

Compression:

Stored size: 648 Bytes

Contents

module Bibliothecary
  module MultiParsers
    module BundlerLikeManifest
      # this takes parsed Bundler and Bundler-like (CocoaPods)
      # manifests and turns them into a list of dependencies.
      def parse_ruby_manifest(manifest)
        manifest.dependencies.inject([]) do |deps, dep|
          deps.push(Dependency.new(
            name: dep.name,
            requirement: dep
              .requirement
              .requirements
              .sort_by(&:last)
              .map { |op, version| "#{op} #{version}" }
              .join(", "),
            type: dep.type.to_s,
          ))
        end.uniq
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bibliothecary-11.0.0 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.2.4 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.2.3 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.2.2 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.2.0 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.1.0 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb
bibliothecary-10.0.0 lib/bibliothecary/multi_parsers/bundler_like_manifest.rb