create_ticket 0.3.0 → 0.3.1

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: b0b70a06a98627c5931b90389ac2b5651ffd6a9e
4
- data.tar.gz: f5b8363d2791be53cce0449130c6ae2169670102
3
+ metadata.gz: 82a50ea4b4c273abc499fce01d3556f87b9f1c85
4
+ data.tar.gz: 7df404627ee109b49a5a62f992a8226d70dfcbf9
5
5
  SHA512:
6
- metadata.gz: e0c2c94c5960be16abc3beb7d2d4fe56f55127547bbb760067e3b9b1cbf26d27f4bb0953c4976c23e77d606f6427e471ed71c677dbced9790b8c1a4e80469b34
7
- data.tar.gz: a5404444e86549be7a2239eac9bb95e7abd3fe500774351bf68d7da726866f1ca60ab0c668692a409b7f02c701d565d9dce4bb67856f72e8964b660be46f69a2
6
+ metadata.gz: ae40a531514e2e1f60aefe48dfd7001ab04f8b85ba69b73b80504d0f4ade0e098932ed3fb156ca823411c714817c36552e49d7da96f99817451c8f8a5dee2f3a
7
+ data.tar.gz: 7fdffd00e88eb132184ac69199fe070767f6fa9024ceb6341566689c1bd67c095e445327de87b29b0b095436a4a2502c30696fea6181954d833fad29623faa3d
@@ -38,7 +38,11 @@ class CreateTicket
38
38
  end
39
39
 
40
40
  def run!
41
- CreateTicket.new(self).create_ticket!
41
+ ticket_url = CreateTicket.new(self).create_ticket!
42
+ puts ticket_url
43
+ rescue KeyError, JSON::ParserError => e
44
+ puts e.message
45
+ exit 1
42
46
  end
43
47
  end
44
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class CreateTicket
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
data/lib/create_ticket.rb CHANGED
@@ -37,15 +37,9 @@ class CreateTicket
37
37
  req.url '/rest/api/2/issue'
38
38
  req.body = jira_ticket_json
39
39
  end
40
- begin
41
- key = JSON.parse(response.body).fetch('key')
42
- puts "#{jira_url}/browse/#{key}"
43
- rescue KeyError, JSON::ParserError
44
- puts 'Could not create a JIRA ticket.'
45
- puts 'Response from server:'
46
- puts response.body
47
- exit 1
48
- end
40
+
41
+ key = JSON.parse(response.body).fetch('key')
42
+ "#{jira_url}/browse/#{key}"
49
43
  end
50
44
 
51
45
  def fields
@@ -68,10 +62,6 @@ class CreateTicket
68
62
 
69
63
  def content
70
64
  ERB.new(template).result(binding)
71
- rescue KeyError => e
72
- puts "Please set all required ENV variables for your template: #{ENV['TEMPLATE_FILENAME']}"
73
- puts e.message
74
- exit 1
75
65
  end
76
66
 
77
67
  def summary
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_ticket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Marek-Spartz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.6.13
156
+ rubygems_version: 2.5.1
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Create JIRA tickets