robopigeon 0.3.1 → 0.3.2

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: e79ffa789106a62a231ad2f47d77a0a4f40d6f10f402a5d850854a8d6fc28e6b
4
- data.tar.gz: 68cf7d61408fae7074e0866a0ed8617206d6298d89d0efd840576dd436eed43c
3
+ metadata.gz: 91e1ccc4296715bb7bd0149e152fdcef8d6eda1ca5bcf20df02b595ce9a1062e
4
+ data.tar.gz: d55644ed2e656858402b41595c29e7d2b0bdedaed10568c5eb45f969d5a2532b
5
5
  SHA512:
6
- metadata.gz: 71ed0f3218d805e49954f88257b29a218c5c1e28983e57e403e8c8576c375074b732eda9b548b8aa408be2fc22b25a9c3fcce9bc46491782d631c9707eb15f28
7
- data.tar.gz: e1721290eba3a076d1801c4ef14d3806e48a932d7fd7cd0d89dc2317b0cefc5e9adcb2155199d6ae0129678f6be9bc4c286b2e1301d1bcbc170eb828cd34a8cd
6
+ metadata.gz: 3f16c85664bc1731725440fc54fb1dba9f8899718b55e1064b5694a28cc20ce4b1df4da961ca004abf5fd3f97e801d916f0672df9c87c326e860ad920188c92d
7
+ data.tar.gz: bba778a3dde275f25af054e94c2c63c7a5ed0f63d44b8fbb3e9eff06cfc7750935f3f7c97856eed49c5422fb650f3b4622b64c379fdfb47c3aa11c1556bb670a
data/.version CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.2 (2019-04-10)
2
+
3
+ ### Added
4
+
5
+ - Allow configuration for how long to wait for designated jira state
6
+
1
7
  ## 0.3.1 (2019-04-8)
2
8
 
3
9
  ### Added
data/lib/robopigeon.rb CHANGED
@@ -4,9 +4,9 @@ require 'robopigeon/extend'
4
4
  require 'robopigeon/git'
5
5
  require 'robopigeon/gitlab'
6
6
  require 'robopigeon/jenkins'
7
+ require 'robopigeon/slack'
7
8
  require 'robopigeon/jira'
8
9
  require 'robopigeon/markdown'
9
- require 'robopigeon/slack'
10
10
  require 'robopigeon/version'
11
11
 
12
12
  module RoboPigeon
@@ -3,9 +3,10 @@ module RoboPigeon::Jira
3
3
  @enabled = true
4
4
  @api_key = ENV['JIRA_TOKEN']
5
5
  @last_created_ticket = File.read('last_created_jira_ticket') if File.exist?('last_created_jira_ticket')
6
+ @wait_for_state_timeout = 10.minutes
6
7
 
7
8
  class << self
8
- attr_accessor :api_key, :api_url, :enabled, :last_created_ticket
9
+ attr_accessor :api_key, :api_url, :enabled, :last_created_ticket, :wait_for_state_timeout
9
10
  def jira_request
10
11
  Faraday.new(url: RoboPigeon::Jira::Client.api_url) do |faraday|
11
12
  faraday.adapter Faraday.default_adapter
@@ -35,6 +35,18 @@ module RoboPigeon::Dsl
35
35
  def api_url(key)
36
36
  RoboPigeon::Jira::Client.api_url = key
37
37
  end
38
+
39
+ RoboPigeon::Documentarian.add_command(
40
+ 'wait_for_state_timeout',
41
+ block: ['jira'],
42
+ params: [
43
+ { name: 'time', type: 'String', desc: 'how long to wait for a state before you time out', example: '1.hour', default: '10.minutes' }
44
+ ],
45
+ desc: 'set timeout for how long RoboPigeon will wait for designated state'
46
+ )
47
+ def wait_for_state_timeout(time)
48
+ RoboPigeon::Jira::Client.wait_for_state_timeout = time
49
+ end
38
50
  end
39
51
 
40
52
  class Jira < JiraRoot
@@ -147,7 +147,7 @@ module RoboPigeon::Jira
147
147
  JSON.parse(get.body)['fields']['status']['name']
148
148
  end
149
149
 
150
- def wait_for_state!(state, timeout=10.minutes, time=Time.now, sleep_time=15)
150
+ def wait_for_state!(state, timeout=RoboPigeon::Jira::Client.wait_for_state_timeout, time=Time.now, sleep_time=15)
151
151
  require_ticket
152
152
  waited = (Time.now - time).to_i
153
153
  minutes = waited / 60
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.1
4
+ version: 0.3.2
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-09 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab