Class: Wooget::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/wooget/nuget.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(package_id, url, properties) ⇒ Package

Returns a new instance of Package.



61
62
63
64
65
66
67
# File 'lib/wooget/nuget.rb', line 61

def initialize package_id, url, properties
  @package_id = package_id
  @url = url
  @properties = properties || {}

  apply_properties
end

Instance Attribute Details

#authorsObject (readonly)

Returns the value of attribute authors.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def authors
  @authors
end

Returns the value of attribute copyright.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def copyright
  @copyright
end

#createdObject (readonly)

Returns the value of attribute created.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def created
  @created
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def dependencies
  @dependencies
end

#descriptionObject (readonly)

Returns the value of attribute description.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def description
  @description
end

#download_countObject (readonly)

Returns the value of attribute download_count.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def download_count
  @download_count
end

Returns the value of attribute gallery_details_url.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def gallery_details_url
  @gallery_details_url
end

#has_binaryObject

Returns the value of attribute has_binary.



59
60
61
# File 'lib/wooget/nuget.rb', line 59

def has_binary
  @has_binary
end

#icon_urlObject (readonly)

Returns the value of attribute icon_url.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def icon_url
  @icon_url
end

#idObject (readonly)

Returns the value of attribute id.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def id
  @id
end

#is_absolute_latest_versionObject (readonly)

Returns the value of attribute is_absolute_latest_version.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def is_absolute_latest_version
  @is_absolute_latest_version
end

#is_binaryObject

Returns the value of attribute is_binary.



59
60
61
# File 'lib/wooget/nuget.rb', line 59

def is_binary
  @is_binary
end

#is_latest_versionObject (readonly)

Returns the value of attribute is_latest_version.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def is_latest_version
  @is_latest_version
end

#is_prereleaseObject (readonly)

Returns the value of attribute is_prerelease.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def is_prerelease
  @is_prerelease
end

#languageObject (readonly)

Returns the value of attribute language.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def language
  @language
end

#last_updatedObject (readonly)

Returns the value of attribute last_updated.



55
56
57
# File 'lib/wooget/nuget.rb', line 55

def last_updated
  @last_updated
end

#license_urlObject (readonly)

Returns the value of attribute license_url.



57
58
59
# File 'lib/wooget/nuget.rb', line 57

def license_url
  @license_url
end

#normalized_versionObject (readonly)

Returns the value of attribute normalized_version.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def normalized_version
  @normalized_version
end

#package_hashObject (readonly)

Returns the value of attribute package_hash.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def package_hash
  @package_hash
end

#package_hash_algorithmObject (readonly)

Returns the value of attribute package_hash_algorithm.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def package_hash_algorithm
  @package_hash_algorithm
end

#package_idObject (readonly)

Returns the value of attribute package_id.



52
53
54
# File 'lib/wooget/nuget.rb', line 52

def package_id
  @package_id
end

#package_sizeObject (readonly)

Returns the value of attribute package_size.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def package_size
  @package_size
end

#project_urlObject (readonly)

Returns the value of attribute project_url.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def project_url
  @project_url
end

#propertiesObject (readonly)

Returns the value of attribute properties.



52
53
54
# File 'lib/wooget/nuget.rb', line 52

def properties
  @properties
end

#publishedObject (readonly)

Returns the value of attribute published.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def published
  @published
end

#release_notesObject (readonly)

Returns the value of attribute release_notes.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def release_notes
  @release_notes
end

#report_abuse_urlObject (readonly)

Returns the value of attribute report_abuse_url.



56
57
58
# File 'lib/wooget/nuget.rb', line 56

def report_abuse_url
  @report_abuse_url
end

#require_license_acceptanceObject (readonly)

Returns the value of attribute require_license_acceptance.



57
58
59
# File 'lib/wooget/nuget.rb', line 57

def require_license_acceptance
  @require_license_acceptance
end

#summaryObject (readonly)

Returns the value of attribute summary.



57
58
59
# File 'lib/wooget/nuget.rb', line 57

def summary
  @summary
end

#tagsObject (readonly)

Returns the value of attribute tags.



57
58
59
# File 'lib/wooget/nuget.rb', line 57

def tags
  @tags
end

#urlObject (readonly)

Returns the value of attribute url.



52
53
54
# File 'lib/wooget/nuget.rb', line 52

def url
  @url
end

#versionObject (readonly)

Returns the value of attribute version.



54
55
56
# File 'lib/wooget/nuget.rb', line 54

def version
  @version
end

Class Method Details

.process_binary_packages(packages) ⇒ Object

discern between source and binary packages



71
72
73
74
75
76
77
78
79
# File 'lib/wooget/nuget.rb', line 71

def self.process_binary_packages(packages)
  packages.each do |package|
    package.is_binary = (package.package_id =~ /Binary/ or packages.any? { |p| p.package_id == package.package_id + ".Source" })
    package.has_binary = packages.any? do |p|
      (p.package_id != package.package_id and p.package_id == package.package_id.chomp(".Source"))\
        or p.package_id == package.package_id + ".Binary"
    end
  end
end