Class: ManifestGeneric

Inherits:
Manifest show all
Defined in:
lib/manifest.rb

Instance Attribute Summary

Attributes inherited from Manifest

#filename, #libraryname, #schema_version

Attributes inherited from JsonObject

#schema_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Manifest

descendants, for_schema_id, parse_file, parse_schema_version, #path, #schema_name

Methods inherited from JsonObject

all_keys, attribute, #from_hash, #from_json, keys, #to_hash, #to_json, #valid?

Constructor Details

#initializeManifestGeneric

Returns a new instance of ManifestGeneric.



102
103
104
# File 'lib/manifest.rb', line 102

def initialize
  super(ManifestGeneric.schema_id)
end

Class Method Details

.schema_idObject



98
99
100
# File 'lib/manifest.rb', line 98

def self.schema_id
  "http://inqlude.org/schema/generic-manifest-v1#"
end

Instance Method Details

#create_release_manifest(release_date, version) ⇒ Object



125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/manifest.rb', line 125

def create_release_manifest(release_date, version)
  m = ManifestRelease.new
  ManifestGeneric.all_keys.each do |key, type|
    value = send("#{key}")
    if value
      m.send("#{key}=", value)
    end
  end

  m.release_date = release_date
  m.version = version
  m
end

#expected_filenameObject



106
107
108
# File 'lib/manifest.rb', line 106

def expected_filename
  "#{name}.manifest"
end

#has_version?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/manifest.rb', line 121

def has_version?
  false
end

#is_released?Boolean

Returns:

  • (Boolean)


110
111
112
113
114
115
116
117
118
119
# File 'lib/manifest.rb', line 110

def is_released?
  # Purely commercial libraries often don't have release information publicly
  # available, so we treat them as released, even, if the manifest only has
  # generic data.
  if licenses == ["Commercial"]
    return true
  else
    return false
  end
end