Sha256: 99da14a638e4948b2d643748f4a0410702fcc51aaba459b2065058ed2b1652a0

Contents?: true

Size: 739 Bytes

Versions: 57

Compression:

Stored size: 739 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'albacore/logging'
require 'albacore/package'

module Albacore
  # a package repository is a location where the nugets or wraps are stored
  class PackageRepo
    include Logging

    # initialize that package repository with a path to all the packages
    def initialize path
      @paths = (path.respond_to?(:map) ? path : [ path ]) || []
    end

    # find the latest package based on the package id
    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
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
albacore-3.0.1 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha.6 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha.5 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha.4 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha.3 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha.2 ./lib/albacore/package_repo.rb
albacore-3.0.0.pre.alpha ./lib/albacore/package_repo.rb
albacore-2.8.0 ./lib/albacore/package_repo.rb
albacore-2.7.0 ./lib/albacore/package_repo.rb
albacore-2.6.8 ./lib/albacore/package_repo.rb
albacore-2.6.7 ./lib/albacore/package_repo.rb
albacore-2.6.6 ./lib/albacore/package_repo.rb
albacore-2.6.4 ./lib/albacore/package_repo.rb
albacore-2.6.3 ./lib/albacore/package_repo.rb
albacore-2.6.2 ./lib/albacore/package_repo.rb
albacore-2.6.1 ./lib/albacore/package_repo.rb
albacore-2.6.0 ./lib/albacore/package_repo.rb
albacore-2.5.14 ./lib/albacore/package_repo.rb
albacore-2.5.13 ./lib/albacore/package_repo.rb
albacore-2.5.11 ./lib/albacore/package_repo.rb