Class: AtlassianAppVersions::App
Overview
Represents an application on jira.atlassian.com / my.atlassian.com
Constant Summary
collapse
- VALID_PRODUCTS =
["jira-core", "jira-software", "confluence", "bitbucket", "stash", "fisheye", "crowd"]
AtlassianAppVersions::AbstractProduct::JAC_URL
Instance Attribute Summary
#key
Instance Method Summary
collapse
#allissuesJQL, #allissuesURL, #bugsJQL, #bugsURL, #featuresJQL, #featuresURL, #jacKey, #jacVersions, #keys, #latest, #marketplaceJSON, #method_missing, #projectJQL, #recentbugsJQL, #recentbugsURL, #respond_to_missing?, #templateJQL, #version, #versions, #versionsListJQL
Constructor Details
#initialize(key) ⇒ App
Returns a new instance of App.
229
230
231
232
233
234
235
|
# File 'lib/atlassian_app_versions.rb', line 229
def initialize(key)
if !VALID_PRODUCTS.member? key then
raise "Unknown product: #{key}. Use one of #{VALID_PRODUCTS.join(", ")}"
end
if key=="stash" then key="bitbucket"; end
super
end
|
Instance Method Details
#allVersions ⇒ Object
266
267
268
269
270
271
272
273
274
275
276
|
# File 'lib/atlassian_app_versions.rb', line 266
def allVersions
first=true
versionsJSON.collect { |v|
if first then
first=false
LatestAppVersion.new(v["version"], self)
else
ArchivedAppVersion.new(v["version"], self)
end
}
end
|
#archivedReleaseJSON ⇒ Object
252
253
254
255
256
257
258
259
260
|
# File 'lib/atlassian_app_versions.rb', line 252
def archivedReleaseJSON
if !@archivedReleaseJSON then
macKey = @key == "bitbucket" ? "stash" : @key url="https://my.atlassian.com/download/feeds/archived/#{macKey}.json"
jsonStr = getjson(url)
@archivedReleaseJSON = JSON.parse( jsonStr )
end
@archivedReleaseJSON
end
|
#getjson(url) ⇒ Object
237
238
239
|
# File 'lib/atlassian_app_versions.rb', line 237
def getjson(url)
open(url).read.gsub(/^downloads\(/, '').gsub(/\)$/, '')
end
|
#latestReleaseJSON ⇒ Object
241
242
243
244
245
246
247
248
249
250
|
# File 'lib/atlassian_app_versions.rb', line 241
def latestReleaseJSON
if !@latestReleaseJSON then
macKey = @key == "bitbucket" ? "stash" : @key url="https://my.atlassian.com/download/feeds/current/#{macKey}.json"
jsonStr = getjson(url)
@latestReleaseJSON = JSON.parse(jsonStr)
end
@latestReleaseJSON
end
|
#product_type ⇒ Object
278
279
280
|
# File 'lib/atlassian_app_versions.rb', line 278
def product_type
"applications"
end
|
#versionsJSON ⇒ Object
262
263
264
|
# File 'lib/atlassian_app_versions.rb', line 262
def versionsJSON
marketplaceJSON["versions"]
end
|