Sha256: b7cabf85656b6aa6a4309a3f5a7376efe3d61bfaa2318ff41408c6fe840e003f

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

# -*- encoding: utf-8 -*-
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
      @path = path
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-2.0.0.rc.9 lib/albacore/package_repo.rb
albacore-2.0.0.rc.8 lib/albacore/package_repo.rb