Module: LockDiff::Gem::Spec

Defined in:
lib/lock_diff/gem/spec.rb

Overview

wrapper of lazy_specification

Defined Under Namespace

Classes: Base, GitSpec, PathSpec, RubyGemSpec, UnSupportSource

Class Method Summary collapse

Class Method Details

.new(lockfile) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lock_diff/gem/spec.rb', line 7

def self.new(lockfile)
  Bundler::LockfileParser.new(lockfile).specs.map do |lazy_specification|
    case lazy_specification.source
    when Bundler::Source::Rubygems
      RubyGemSpec.new(lazy_specification)
    when Bundler::Source::Git
      GitSpec.new(lazy_specification)
    when Bundler::Source::Path
      PathSpec.new(lazy_specification)
    else
      raise UnSupportSource, "#{lazy_specification.source.class} source by #{lazy_specification.name} is not supported"
    end
  end
end