class Albacore::PackageRepo

a package repository is a location where the nugets or wraps are stored

Public Class Methods

new(path) click to toggle source

initialize that package repository with a path to all the packages

# File lib/albacore/package_repo.rb, line 10
def initialize path
  @paths = (path.respond_to?(:map) ? path : [ path ]) || []
end

Public Instance Methods

find_latest(pkg_id) click to toggle source

find the latest package based on the package id

# File lib/albacore/package_repo.rb, line 15
def find_latest pkg_id
  @paths.map do |path|
    trace "finding latest from #{path}, id: #{pkg_id}"
    sorted = Dir.glob(File.join(path, "#{pkg_id}*/**/*.dll")) # find the latest
    path = sorted.first
    Package.new pkg_id, path
  end.compact.first
end