Sha256: 360f77af43c00eb96257ae225c15ec01bae4698f3908f58a155aa16de682aba2
Contents?: true
Size: 569 Bytes
Versions: 5
Compression:
Stored size: 569 Bytes
Contents
require 'bundler' module Pessimize class GemfileLockVersionParser attr_reader :versions def initialize self.versions = {} end def call(gemfile_lock_file) parser = Bundler::LockfileParser.new(gemfile_lock_file.read) self.versions = collect_names_and_versions(parser.specs) self end protected attr_writer :versions def collect_names_and_versions(specs) Hash[specs. reject { |s| s.source.is_a?(Bundler::Source::Git) }. collect { |s| [s.name, s.version.to_s] }] end end end
Version data entries
5 entries across 5 versions & 2 rubygems