robopigeon 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.version +1 -1
- data/lib/robopigeon/jira/ticket.rb +17 -5
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 495702532ec10da40ade27869b140a3e08818b3e526cf6facc9f3383ac3343b0
|
4
|
+
data.tar.gz: 0114d17376193afeb45e156ec2e422a6d76f1045cae6b69d7b1c536c741bbe25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b208a5c0567aaea87fab2873674e6f49644611094a4d00cbc459b58d1d01bb4479c90513919ed1d92b87a2581d7b8b0fe720f78b858dbb8d24be2c49547815
|
7
|
+
data.tar.gz: edb6b068175cab4d768f62d9da5a63f862cca508538db22fbed96cdb8fc257d82ed180e1cba16f9b5b903a693c1c010d568f7ef0aededf3f7f2865a8ec28278e
|
data/.gitignore
CHANGED
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
@@ -40,7 +40,6 @@ module RoboPigeon::Jira
|
|
40
40
|
project: { key: project },
|
41
41
|
issuetype: { name: issue_type },
|
42
42
|
summary: summary,
|
43
|
-
duedate: duedate,
|
44
43
|
description: description,
|
45
44
|
assignee: { name: reporter }
|
46
45
|
}.merge(fields)
|
@@ -96,10 +95,10 @@ module RoboPigeon::Jira
|
|
96
95
|
|
97
96
|
raise "Field #{name} was not found" unless field
|
98
97
|
|
99
|
-
self.fields[field] = if fields[field]['
|
98
|
+
self.fields[field] = if fields[field]['schema']['type'] == 'array'
|
99
|
+
array_of(value, fields[field])
|
100
|
+
elsif fields[field]['allowedValues'].nil?
|
100
101
|
value
|
101
|
-
elsif fields[field]['schema']['type'] == 'array'
|
102
|
-
[{ name: value }]
|
103
102
|
else
|
104
103
|
{ value: value }
|
105
104
|
end
|
@@ -147,7 +146,7 @@ module RoboPigeon::Jira
|
|
147
146
|
JSON.parse(get.body)['fields']['status']['name']
|
148
147
|
end
|
149
148
|
|
150
|
-
def wait_for_state!(state, timeout=RoboPigeon::Jira::Client.wait_for_state_timeout, time=Time.now, sleep_time=15)
|
149
|
+
def wait_for_state!(state, timeout = RoboPigeon::Jira::Client.wait_for_state_timeout, time = Time.now, sleep_time = 15)
|
151
150
|
require_ticket
|
152
151
|
waited = (Time.now - time).to_i
|
153
152
|
minutes = waited / 60
|
@@ -182,5 +181,18 @@ module RoboPigeon::Jira
|
|
182
181
|
def require_field(field)
|
183
182
|
raise RoboPigeon::Jira::RequiredFieldNotSet, "You must set a #{field}" if send(field).nil?
|
184
183
|
end
|
184
|
+
|
185
|
+
def array_of(values, field_metadata)
|
186
|
+
raise TypeError('provided Jira field must be an array') unless field_metadata['schema']['type'] == 'array'
|
187
|
+
|
188
|
+
values.split(',').map do |value|
|
189
|
+
value.strip!
|
190
|
+
if field_metadata['schema']['items'] == 'string'
|
191
|
+
value
|
192
|
+
else
|
193
|
+
{ name: value }
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
185
197
|
end
|
186
198
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robopigeon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Ives
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -332,7 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
332
|
- !ruby/object:Gem::Version
|
333
333
|
version: '0'
|
334
334
|
requirements: []
|
335
|
-
|
335
|
+
rubyforge_project:
|
336
|
+
rubygems_version: 2.7.6
|
336
337
|
signing_key:
|
337
338
|
specification_version: 4
|
338
339
|
summary: A set of tools for gitlab and other ci piplines
|