cloudmunch_sdk 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a21708ad4782f267d13bdb138f4e627808f0f545
4
- data.tar.gz: 0822ee56a8e42ab241a09ef8111d42e3fe043e18
3
+ metadata.gz: 422a71f1a5784d024aa789c3f83458d54f58051c
4
+ data.tar.gz: a880c6049200a89eae0e9cfc0ad5f9a45f730b56
5
5
  SHA512:
6
- metadata.gz: c1445d6ebeaf09463c6d658cbc5475b4a0d72f02f1b67246a8174e1c8e642dcbe651db734e000432c6d96f919a2798b3d922264d1a01af92a3248a33820bf824
7
- data.tar.gz: 7750cf72828d7537a4f0f5342304bdfa865e9fc7e624a57c0d95564218271e94fbb53da3128d0c0d4046c20a79c80b2bba8bd60bb55a954a7e996539c36598ca
6
+ metadata.gz: d4817f045cac0bd17896c5b65daeb70489ce65933aa629a71e206de4687fb4867db45c92e17be8b8b8f95cd6d97c0ab6288d4bb8b09862ac1176338b479fc778
7
+ data.tar.gz: ac9697def25f69b5dd8b50f998cbff98f19118b62a32653a1d0e29c3ee0a7822b47cfb32c916688aaf67b32f93ece9a4e2efb25fc2e44f1046c4e405a40c65f2
@@ -18,16 +18,16 @@ class AppAbstract
18
18
  end
19
19
 
20
20
 
21
- def logInit(log_level = "DEBUG")
21
+ def logInit(log_level)
22
22
  @logger = @logger ? @logger : Util.logInit()
23
23
  @log_level = log_level
24
24
  end
25
25
 
26
26
  def log(level,logString)
27
- if !@logger.nil?
27
+ if @logger.nil?
28
28
  logInit("DEBUG")
29
29
  end
30
- Util.logIt(@logger, @log_level, level, logString)
30
+ Util.logIt(@logger, @log_level, level.to_s.downcase, logString)
31
31
  end
32
32
 
33
33
 
@@ -86,35 +86,6 @@ class AppAbstract
86
86
  end
87
87
 
88
88
 
89
- # def getActiveSprint(param)
90
- # params = {
91
- # "username" => @@config['username']
92
- # }
93
-
94
- # params = param.merge(params)
95
- # Util.getActiveSprint(@@config['master_url'], @@config['endpoint'], params)
96
- # end
97
- #
98
- # def getSortedSprints(param)
99
- # params = {
100
- # "username" => @@config['username']
101
- # }
102
- #
103
- # params = param.merge(params)
104
- #
105
- # Util.getSortedSprints(@@config['master_url'], @@config['endpoint'], params)
106
- # end
107
- #
108
- # def getUrlForViewCards(param)
109
- # params = {
110
- # "username" => @@config['username']
111
- # }
112
- #
113
- # params = param.merge(params)
114
- #
115
- # Util.getUrlForViewCards(@@config['master_url'], @@config['endpoint'], params)
116
- # end
117
-
118
89
  def getCMContext(context)
119
90
  begin
120
91
  return @@config[context+"_context"]
@@ -128,15 +99,16 @@ class AppAbstract
128
99
  end
129
100
 
130
101
  def initializeApp()
131
- puts "initializeApp from AppAbstract"
102
+ #puts "initializeApp from AppAbstract"
132
103
  end
133
104
 
134
105
  def process()
135
- puts "process func from AppAbstract"
106
+ #puts "process func from AppAbstract"
136
107
  end
137
108
 
138
109
  def cleanupApp()
139
- puts "cleanupApp from AppAbstract"
110
+ log("INFO", "\nExiting app")
111
+ #puts "cleanupApp from AppAbstract"
140
112
  end
141
113
 
142
114
  def start()
@@ -11,7 +11,7 @@ module CloudmunchService
11
11
 
12
12
  def self.putCustomDataContext(server, endpoint, param)
13
13
  result = self.http_post(server, endpoint, param)
14
- p result.code.to_s
14
+ #p result.code.to_s
15
15
  if result.code.to_s == "200"
16
16
  return true
17
17
  else
@@ -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
@@ -54,4 +54,4 @@ module CloudmunchService
54
54
  def self.updateDataContext(server, endpoint, param)
55
55
  putCustomDataContext(server, endpoint, param)
56
56
  end
57
- end
57
+ end
@@ -7,6 +7,9 @@ require 'json'
7
7
  module Util
8
8
  def Util.logInit()
9
9
  logger = Logger.new(STDOUT)
10
+ logger.formatter = proc do |severity, datetime, progname, msg|
11
+ "#{severity}: #{msg}\n"
12
+ end
10
13
  return logger
11
14
  end
12
15
 
@@ -28,7 +31,7 @@ module Util
28
31
  end
29
32
 
30
33
  def Util.logIt(logger, log_level, log_level_string, messageString)
31
- case log_level
34
+ case log_level.downcase
32
35
  when "debug"
33
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
34
37
  log(logger, "debug", messageString)
@@ -91,55 +94,6 @@ module Util
91
94
  end
92
95
  end
93
96
 
94
- # def Util.getSortedSprints(server, endpoint, params)
95
- # sprints = []
96
- # sname_by_sequence = {}
97
- # tseq = []
98
-
99
- # newParam = {
100
- # :action => 'listcustomcontext',
101
- # :fields => 'sequence, sprint_id',
102
- # :group_by => 'sequence',
103
- # :count => '*'
104
- # }
105
-
106
- # newParam = params.merge(newParam)
107
- # cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam)
108
- # cqlQuery = JSON.parse(cqlQuery)
109
- # cqlQuery.each do |v|
110
- # # puts v[1]
111
- # tseq << v[1]['sequence'].to_i
112
- # sname_by_sequence[v[1]['sequence'].to_i] = v[1]['sprint_id']
113
- # end
114
-
115
- # tseq.sort!.each do |y|
116
- # sprints << sname_by_sequence[y]
117
- # end
118
-
119
- # return sprints
120
- # end
121
-
122
- # def Util.getActiveSprint(server, endpoint, params)
123
- # sprints = []
124
-
125
- # newParam = {
126
- # :action => "listcustomcontext",
127
- # :fields => "sprint_id,sprint_status",
128
- # :sort_by => "sprint_status",
129
- # :count => "*",
130
- # }
131
-
132
- # newParam = params.merge(newParam)
133
- # cqlQuery = CloudmunchService.getDataContext(server, endpoint, newParam)
134
- # cqlQuery = JSON.parse(cqlQuery)
135
- # sprint = nil
136
- # cqlQuery.each do |x|
137
- # if(x['sprint_status'] == 'ACTIVE')
138
- # sprint = x['sprint_id']
139
- # end
140
- # end
141
- # return sprint
142
- # end
143
97
  def Util.getUrlForViewCards(server, endpoint, params)
144
98
  newParam = {
145
99
  :action => "listcustomcontext",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmunch_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - syamk