Sha256: eca9e5c02ebf07ff62a25f07e174d951e18c22f06be42b28f8ac213ae2724d49

Contents?: true

Size: 764 Bytes

Versions: 8

Compression:

Stored size: 764 Bytes

Contents

module Packagecloud
  class Package

    attr_reader :file
    attr_accessor :source_files
    attr_reader :filename
    attr_reader :client

    def initialize(options = {})
      if options[:file].nil?
        raise ArgumentError, 'file cannot be nil' if file.nil?
      end
      if options[:file].is_a? String
        options[:file] = File.open(options[:file])
      end
      if options[:file].is_a? File
        options[:filename] = File.basename(options[:file].path)
      end
      if options[:filename].nil?
        raise ArgumentError, 'filename cannot be nil' if file.nil?
      end

      @file = options[:file]
      @filename = options[:filename]
      @source_files = options[:source_files] || {}
      @client = options[:client]
    end

  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
travis-packagecloud-ruby-1.1.0 lib/packagecloud/package.rb
packagecloud-ruby-1.0.8 lib/packagecloud/package.rb
packagecloud-ruby-1.0.6 lib/packagecloud/package.rb
packagecloud-ruby-1.0.5 lib/packagecloud/package.rb
packagecloud-ruby-1.0.4 lib/packagecloud/package.rb
packagecloud-ruby-1.0.3 lib/packagecloud/package.rb
packagecloud-ruby-1.0.2 lib/packagecloud/package.rb
packagecloud-ruby-1.0.1 lib/packagecloud/package.rb