Sha256: 5c28f9874c4b52e3186f6bdacfa594f1b8ca209238b6f866d21574c6225d2451

Contents?: true

Size: 662 Bytes

Versions: 4

Compression:

Stored size: 662 Bytes

Contents

require "aptly_cli/version"
require "aptly_load"
require "httmultiparty"
require "json"

module AptlyCli
  class AptlyPackage

    include HTTMultiParty

    # Load aptly-cli.conf and establish base_uri
    config = AptlyCli::AptlyLoad.new.configure_with("/etc/aptly-cli.conf")
    base_uri "http://#{config[:server]}:#{config[:port]}/api"

    if config[:username]
      if config[:password]
        basic_auth "#{config[:username]}", "#{config[:password]}"
      end
    end

    if config[:debug] == true
      debug_output $stdout
    end

    def package_show(package_key)
      uri = "/packages/#{package_key}"
      self.class.get(uri)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aptly_cli-0.2.5 lib/aptly_package.rb
aptly_cli-0.2.4 lib/aptly_package.rb
aptly_cli-0.2.3 lib/aptly_package.rb
aptly_cli-0.2.2 lib/aptly_package.rb