class Librarian::Action::Resolve

Public Instance Methods

run() click to toggle source
# 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

Private Instance Methods

force?() click to toggle source
# File lib/librarian/action/resolve.rb, line 32
def force?
  options[:force]
end
resolver() click to toggle source
# File lib/librarian/action/resolve.rb, line 36
def resolver
  Resolver.new(environment)
end
spec_change_set(spec, lock) click to toggle source
# File lib/librarian/action/resolve.rb, line 40
def spec_change_set(spec, lock)
  SpecChangeSet.new(environment, spec, lock)
end