Class: Librarian::Action::Resolve

Inherits:
Base
  • Object
show all
Includes:
PersistResolutionMixin
Defined in:
lib/librarian/action/resolve.rb

Instance Attribute Summary

Attributes inherited from Base

#environment, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Librarian::Action::Base

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/librarian/action/resolve.rb', line 11

def run
  if force? || !lockfile_path.exist?
    spec = specfile.read
    manifests = []
  else
    lock = lockfile.read
    spec = specfile.read(lock.sources)
    changes = spec_change_set(spec, lock)
    if changes.same?
      debug { "The specfile is unchanged: nothing to do." }
      return
    end
    manifests = changes.analyze
  end

  resolution = resolver.resolve(spec, manifests)
  persist_resolution(resolution)
end