Sha256: ec1b742df587767b282cc1697177c7be2cd602d7f2cfff17be4b009004f0d5ba

Contents?: true

Size: 897 Bytes

Versions: 11

Compression:

Stored size: 897 Bytes

Contents

require 'aptly_cli/version'
require 'aptly_command'
require 'aptly_load'
require 'httmultiparty'

module AptlyCli
  # Uploading file into Aptly
  class AptlyFile < AptlyCommand
    attr_accessor :file_uri, :package, :local_file_path

    def file_dir
      uri = '/files'
      self.class.get uri
    end

    def file_get(file_uri)
      uri = if file_uri == '/'
              '/files'
            else
              '/files/' + file_uri
            end
      self.class.get uri
    end

    def file_delete(file_uri)
      uri = '/files' + file_uri
      self.class.delete uri
    end

    def file_post(post_options = {})
      api_file_uri = '/files' + post_options[:file_uri].to_s
      self.class.post(api_file_uri,
                      query: {
                        package: post_options[:package],
                        file: File.new(post_options[:local_file]) })
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
aptly_cli-0.4.2 lib/aptly_file.rb
aptly_cli-0.4.0 lib/aptly_file.rb
aptly_cli-0.3.10 lib/aptly_file.rb
aptly_cli-0.3.8 lib/aptly_file.rb
aptly_cli-0.3.7 lib/aptly_file.rb
aptly_cli-0.3.6 lib/aptly_file.rb
aptly_cli-0.3.5 lib/aptly_file.rb
aptly_cli-0.3.4 lib/aptly_file.rb
aptly_cli-0.3.3 lib/aptly_file.rb
aptly_cli-0.3.2 lib/aptly_file.rb
aptly_cli-0.3.1 lib/aptly_file.rb