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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91e1ccc4296715bb7bd0149e152fdcef8d6eda1ca5bcf20df02b595ce9a1062e
4
- data.tar.gz: d55644ed2e656858402b41595c29e7d2b0bdedaed10568c5eb45f969d5a2532b
3
+ metadata.gz: 495702532ec10da40ade27869b140a3e08818b3e526cf6facc9f3383ac3343b0
4
+ data.tar.gz: 0114d17376193afeb45e156ec2e422a6d76f1045cae6b69d7b1c536c741bbe25
5
5
  SHA512:
6
- metadata.gz: 3f16c85664bc1731725440fc54fb1dba9f8899718b55e1064b5694a28cc20ce4b1df4da961ca004abf5fd3f97e801d916f0672df9c87c326e860ad920188c92d
7
- data.tar.gz: bba778a3dde275f25af054e94c2c63c7a5ed0f63d44b8fbb3e9eff06cfc7750935f3f7c97856eed49c5422fb650f3b4622b64c379fdfb47c3aa11c1556bb670a
6
+ metadata.gz: 74b208a5c0567aaea87fab2873674e6f49644611094a4d00cbc459b58d1d01bb4479c90513919ed1d92b87a2581d7b8b0fe720f78b858dbb8d24be2c49547815
7
+ data.tar.gz: edb6b068175cab4d768f62d9da5a63f862cca508538db22fbed96cdb8fc257d82ed180e1cba16f9b5b903a693c1c010d568f7ef0aededf3f7f2865a8ec28278e
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- /.bundle/
2
1
  /.yardoc
3
2
  /_yardoc/
4
3
  /coverage/
@@ -7,6 +6,10 @@
7
6
  /spec/reports/
8
7
  /tmp/
9
8
 
9
+ # Ruby library management
10
+ /.bundle/
11
+ /vendor/
12
+
10
13
  # rspec failure tracking
11
14
  .rspec_status
12
15
 
data/.version CHANGED
@@ -1 +1 @@
1
- 0.3.2
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]['allowedValues'].nil?
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.3.2
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-10 00:00:00.000000000 Z
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
- rubygems_version: 3.0.2
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