cloudmunch_sdk 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 422a71f1a5784d024aa789c3f83458d54f58051c
4
- data.tar.gz: a880c6049200a89eae0e9cfc0ad5f9a45f730b56
3
+ metadata.gz: 21a4d5ec6906e62c37fd14b8917a8789ab4928a0
4
+ data.tar.gz: 3e7df444f8bcd1d2e51beb6437b7ddddcbd065c5
5
5
  SHA512:
6
- metadata.gz: d4817f045cac0bd17896c5b65daeb70489ce65933aa629a71e206de4687fb4867db45c92e17be8b8b8f95cd6d97c0ab6288d4bb8b09862ac1176338b479fc778
7
- data.tar.gz: ac9697def25f69b5dd8b50f998cbff98f19118b62a32653a1d0e29c3ee0a7822b47cfb32c916688aaf67b32f93ece9a4e2efb25fc2e44f1046c4e405a40c65f2
6
+ metadata.gz: 99752b5ada2f392832c834ff309d53982ddab553359ebbec0937c8309002eab013669f4395c5c3c1a8367f0f7a5d6e782ab8198c543973784c0146b1423f06eb
7
+ data.tar.gz: efdba318f37b010b9286978b7f7bc3f101711c2fe547e6ab6e217fe9dee53bf7924eab8d0bad530cdc97c8060a7a9153a1a48ac74b63d9f4fdea6ad95bb746ef
@@ -94,6 +94,14 @@ class AppAbstract
94
94
  end
95
95
  end
96
96
 
97
+ def getTemplate(template_name)
98
+ begin
99
+ Util.getTemplate(template_name)
100
+ rescue
101
+ return false
102
+ end
103
+ end
104
+
97
105
  def load_config()
98
106
  @@config = openJSONFile(@@config_path)
99
107
  end
File without changes
@@ -29,7 +29,7 @@ module CloudmunchService
29
29
  return Net::HTTP.get(server, path)
30
30
  else
31
31
  queryStr = "#{path}?".concat(params.collect { |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join('&'))
32
- #puts ("SDKDEBUG: Calling URL " + server+queryStr)
32
+ puts ("SDKDEBUG: Calling URL " + server+queryStr)
33
33
  uri = URI(server + "/" + queryStr)
34
34
  return Net::HTTP.get(uri)
35
35
  end
@@ -37,7 +37,7 @@ module CloudmunchService
37
37
 
38
38
  def self.http_post(server,path,params)
39
39
  queryStr = "#{path}?".concat(params.collect { |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join('&'))
40
- #puts ("SDKDEBUG: Calling URL " + server+queryStr)
40
+ puts ("SDKDEBUG: Calling URL " + server+queryStr)
41
41
  if params.nil?
42
42
  return Net::HTTP.post(server, path)
43
43
  else
File without changes
@@ -15,39 +15,43 @@ module Util
15
15
 
16
16
  def Util.log(logger, level, logString)
17
17
  case level
18
+ when "debug"
19
+ logger.debug(logString)
18
20
  when "fatal"
19
21
  logger.fatal(logString)
20
- when "errror"
22
+ when "error"
21
23
  logger.error(logString)
22
24
  when "warn"
23
25
  logger.warn(logString)
24
26
  when "info"
25
- logger.info(logString)
26
- when "debug"
27
- logger.debug(logString)
27
+ logger.info(logString)
28
28
  else
29
29
  logger.unknown(logString)
30
30
  end
31
31
  end
32
32
 
33
- def Util.logIt(logger, log_level, log_level_string, messageString)
33
+ def Util.logIt(logger, log_level, log_level_string, messageString)
34
34
  case log_level.downcase
35
35
  when "debug"
36
- if "warning".eql? log_level_string or "info".eql? log_level_string or "error".eql? log_level_string or "debug".eql? log_level_string
36
+ if "debug".eql? log_level_string or "fatal".eql? log_level_string or "error".eql? log_level_string or "warn".eql? log_level_string or "info".eql? log_level_string
37
37
  log(logger, "debug", messageString)
38
38
  end
39
+ when "fatal"
40
+ if "fatal".eql? log_level_string
41
+ log(logger, "fatal", messageString)
42
+ end
39
43
  when "error"
40
- if "warning".eql? log_level_string or "info".eql? log_level_string or "error".eql? log_level_string
44
+ if "error".eql? log_level_string
41
45
  log(logger, "error", messageString)
42
- end
43
- when "info"
44
- if "warning".eql? log_level_string or "info".eql? log_level_string
45
- log(logger, "info", messageString)
46
- end
46
+ end
47
47
  when "warn"
48
48
  if "warn".eql? log_level_string
49
49
  log(logger, "warn", messageString)
50
50
  end
51
+ when "info"
52
+ if "info".eql? log_level_string
53
+ log(logger, "info", messageString)
54
+ end
51
55
  else
52
56
  log(logger, "unknown", messageString)
53
57
  end
@@ -88,7 +92,7 @@ module Util
88
92
  fp.close
89
93
  return true
90
94
  rescue
91
- log("DEBUG", "Could not open output file #{input_json['reporthtml']} Check that the files exists and you have permissions to open the file!")
95
+ puts("ERROR: Could not open output file. Framework error!")
92
96
  # exit 1
93
97
  return false
94
98
  end
@@ -111,6 +115,10 @@ module Util
111
115
 
112
116
  return url
113
117
  end
118
+
119
+ def Util.getTemplate(template_name)
120
+ openJSONFile(File.dirname(__FILE__) +"/templates/#{template_name}.json")
121
+ end
114
122
 
115
123
  end
116
124
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Cloudmunch
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmunch_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - syamk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -73,11 +73,12 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - lib/cloudmunch_sdk.rb
76
77
  - lib/cloudmunch_sdk/AppAbstract.rb
77
78
  - lib/cloudmunch_sdk/AppContext.rb
78
79
  - lib/cloudmunch_sdk/CloudmunchService.rb
79
- - lib/cloudmunch_sdk/README.md
80
80
  - lib/cloudmunch_sdk/ServiceProvider.rb
81
+ - lib/cloudmunch_sdk/Util.rb
81
82
  - lib/cloudmunch_sdk/templates/costview_meta.json
82
83
  - lib/cloudmunch_sdk/templates/coverageview_meta.json
83
84
  - lib/cloudmunch_sdk/templates/defecttrendview_meta.json
@@ -87,10 +88,7 @@ files:
87
88
  - lib/cloudmunch_sdk/templates/scopeview_meta.json
88
89
  - lib/cloudmunch_sdk/templates/timeview_meta.json
89
90
  - lib/cloudmunch_sdk/templates/velocityview_meta.json
90
- - lib/cloudmunch_sdk/Util.rb
91
- - lib/cloudmunch_sdk/UtilJira.rb
92
91
  - lib/cloudmunch_sdk/version.rb
93
- - lib/cloudmunch_sdk.rb
94
92
  homepage: https://rubygems.org/gems/cloudmunch_sdk
95
93
  licenses:
96
94
  - MIT
@@ -112,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
110
  version: '0'
113
111
  requirements: []
114
112
  rubyforge_project:
115
- rubygems_version: 2.0.14
113
+ rubygems_version: 2.4.8
116
114
  signing_key:
117
115
  specification_version: 4
118
116
  summary: Cloudmunch Ruby SDK.
@@ -1,2 +0,0 @@
1
- # cloudmunch-Ruby-SDK
2
- Repository for cloudmunch Ruby SDK
@@ -1,58 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'json'
3
- require 'CloudmunchService'
4
-
5
- module UtilJira
6
-
7
- def UtilJira.getSortedSprints(server, endpoint, params)
8
- sprints = []
9
- sname_by_sequence = {}
10
- tseq = []
11
-
12
- newParam = {
13
- :action => 'listcustomcontext',
14
- :fields => 'sequence, sprint_id',
15
- :group_by => 'sequence',
16
- :count => '*'
17
- }
18
-
19
- newParam = params.merge(newParam)
20
- cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam)
21
- cqlQuery = JSON.parse(cqlQuery)
22
- cqlQuery.each do |v|
23
- # puts v[1]
24
- tseq << v[1]['sequence'].to_i
25
- sname_by_sequence[v[1]['sequence'].to_i] = v[1]['sprint_id']
26
- end
27
-
28
- tseq.sort!.each do |y|
29
- sprints << sname_by_sequence[y]
30
- end
31
-
32
- return sprints
33
- end
34
-
35
- def UtilJira.getActiveSprint(server, endpoint, params)
36
- sprints = []
37
-
38
- newParam = {
39
- :action => "listcustomcontext",
40
- :fields => "sprint_id,sprint_status",
41
- :sort_by => "sprint_status",
42
- :count => "*",
43
- }
44
-
45
- newParam = params.merge(newParam)
46
- cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam)
47
- cqlQuery = JSON.parse(cqlQuery)
48
- sprint = nil
49
- cqlQuery.each do |x|
50
- if(x['sprint_status'] == 'ACTIVE')
51
- sprint = x['sprint_id']
52
- end
53
- end
54
- return sprint
55
- end
56
-
57
-
58
- end