class Librarian::Action::Install

Public Instance Methods

run() click to toggle source
# File lib/librarian/action/install.rb, line 9
def run
  check_preconditions

  perform_installation
end

Private Instance Methods

check_consistent() click to toggle source
# File lib/librarian/action/install.rb, line 31
def check_consistent
  raise Error, "#{specfile_name} and #{lockfile_name} are out of sync!" unless spec_consistent_with_lock?
end
check_lockfile() click to toggle source
# File lib/librarian/action/install.rb, line 27
def check_lockfile
  raise Error, "#{lockfile_name} missing!" unless lockfile_path.exist?
end
check_preconditions() click to toggle source
# File lib/librarian/action/install.rb, line 17
def check_preconditions
  check_specfile
  check_lockfile
  check_consistent
end
check_specfile() click to toggle source
# File lib/librarian/action/install.rb, line 23
def check_specfile
  raise Error, "#{specfile_name} missing!" unless specfile_path.exist?
end
create_install_path() click to toggle source
# File lib/librarian/action/install.rb, line 42
def create_install_path
  install_path.rmtree if install_path.exist?
  install_path.mkpath
end
install_manifests(manifests) click to toggle source
# File lib/librarian/action/install.rb, line 47
def install_manifests(manifests)
  manifests.each do |manifest|
    manifest.install!
  end
end
install_path() click to toggle source
# File lib/librarian/action/install.rb, line 89
def install_path
  environment.install_path
end
lock() click to toggle source
# File lib/librarian/action/install.rb, line 77
def lock
  environment.lock
end
lockfile_name() click to toggle source
# File lib/librarian/action/install.rb, line 65
def lockfile_name
  environment.lockfile_name
end
lockfile_path() click to toggle source
# File lib/librarian/action/install.rb, line 69
def lockfile_path
  environment.lockfile_path
end
perform_installation() click to toggle source
# File lib/librarian/action/install.rb, line 35
def perform_installation
  manifests = sorted_manifests

  create_install_path
  install_manifests(manifests)
end
sorted_manifests() click to toggle source
# File lib/librarian/action/install.rb, line 53
def sorted_manifests
  ManifestSet.sort(lock.manifests)
end
spec() click to toggle source
# File lib/librarian/action/install.rb, line 73
def spec
  environment.spec
end
spec_change_set(spec, lock) click to toggle source
# File lib/librarian/action/install.rb, line 81
def spec_change_set(spec, lock)
  SpecChangeSet.new(environment, spec, lock)
end
spec_consistent_with_lock?() click to toggle source
# File lib/librarian/action/install.rb, line 85
def spec_consistent_with_lock?
  spec_change_set(spec, lock).same?
end
specfile_name() click to toggle source
# File lib/librarian/action/install.rb, line 57
def specfile_name
  environment.specfile_name
end
specfile_path() click to toggle source
# File lib/librarian/action/install.rb, line 61
def specfile_path
  environment.specfile_path
end