Class: AtlassianAppVersions::Plugin

Inherits:
AbstractProduct show all
Defined in:
lib/atlassian_app_versions.rb

Overview

Represents a plugin, with information taken from marketplace.atlassian.com

Constant Summary

Constants inherited from AbstractProduct

AbstractProduct::JAC_URL

Instance Attribute Summary

Attributes inherited from AbstractProduct

#key

Instance Method Summary collapse

Methods inherited from AbstractProduct

#allissuesJQL, #allissuesURL, #bugsJQL, #bugsURL, #featuresJQL, #featuresURL, #initialize, #jacKey, #jacVersions, #keys, #latest, #marketplaceJSON, #method_missing, #projectJQL, #recentbugsJQL, #recentbugsURL, #respond_to_missing?, #templateJQL, #version, #versions, #versionsListJQL

Constructor Details

This class inherits a constructor from AtlassianAppVersions::AbstractProduct

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AtlassianAppVersions::AbstractProduct

Instance Method Details

#allissueJQL(fromVer = nil, toVer = nil) ⇒ Object

A few plugins are tracked on JAC, so if asked for JQL, return their issue-tracker link.



211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/atlassian_app_versions.rb', line 211

def allissueJQL(fromVer=nil, toVer=nil)
    links = versionsJSON.first["links"] 
    if links then
	tracker = links.find { |l| l["rel"] == "issue-tracker" }
	if tracker then
	    if tracker["href"] =~ /jira\.atlassian\.com/ then
		templateJQL(fromVer, toVer)
	    else
		nil
	    end
	end
    end
end

#allVersionsObject



206
207
208
# File 'lib/atlassian_app_versions.rb', line 206

def allVersions
    versionsJSON.collect { |v| PluginVersion.new(v["version"], self) }
end

#product_typeObject



202
203
204
# File 'lib/atlassian_app_versions.rb', line 202

def product_type
    "plugins"
end

#versionsJSONObject



199
200
201
# File 'lib/atlassian_app_versions.rb', line 199

def versionsJSON
    marketplaceJSON["versions"]["versions"]
end