create_ticket 0.1.0 → 0.1.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: dcbb05b939021e60ff8de0a32545a0d5283943bc
4
- data.tar.gz: 17f6b0052657455254a7e1ab2fcc27874e66267e
3
+ metadata.gz: 3d84978bafbf48d30399598ca2bfd256b9707226
4
+ data.tar.gz: 9f45cf6775cfa23244fc627ee3ade885d4374275
5
5
  SHA512:
6
- metadata.gz: d70a001d7b62d9c3c0001fb5c3f4c95af767043ca68c19451f4cfefa63dcf06dd4eac1b7bd85bf7033d643035c24d2b4e288bd96689b06b9f07d23989d8f7952
7
- data.tar.gz: 155cbc466b64957e2e9ceef2b65201cd5a3b21717824f21904160ba77fc6b124eed3a00a2bf68d3bf960cd63ffe73b8e4a4fd3ba59763d52f63661cb518308f2
6
+ metadata.gz: 120c7d694a88676bdd31f6d13dea3272c254a9c9e6872c7f28dd2d43527dd45420f78deac6bd45077df2c4cdaff5e0bd52a4f926ce3cc16da03edde9ee470116
7
+ data.tar.gz: 91eaeae759e02cc00e29af9ca8293deb518ca18e1ce4aa57f776abec03f07ece03f4a5f3bc765d2c8e3607889a987e66b2906f9093c7b04d8235eedfe1d2e7f9
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/lib/create_ticket.rb CHANGED
@@ -65,9 +65,17 @@ module CreateTicket
65
65
  }.to_json
66
66
  end
67
67
 
68
+ def content
69
+ ERB.new(template).result(binding)
70
+ rescue KeyError => e
71
+ puts "Please set all required ENV variables for your template: #{ENV['TEMPLATE_FILENAME']}"
72
+ puts e.message
73
+ exit 1
74
+ end
75
+
68
76
  def summary
69
77
  # TODO: Assumes Markdown with an h1 at the top.
70
- template.lines.first[2..-1].strip
78
+ content.lines.first[2..-1].strip
71
79
  end
72
80
 
73
81
  def kramdown_options
@@ -82,11 +90,9 @@ module CreateTicket
82
90
  end
83
91
 
84
92
  def description
85
- markdown = ERB.new(template).result(binding)
86
-
87
93
  # TODO: Assumes Markdown with an h1 at the top.
88
- markdown.sub!(/# .*\n/, '')
89
-
94
+ markdown = content.sub(/# .*\n/, '')
95
+
90
96
  Kramdown::Document.new(markdown, kramdown_options).to_confluence
91
97
  end
92
98
  end
@@ -1,3 +1,3 @@
1
1
  module CreateTicket
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
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.1.0
4
+ version: 0.1.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-09-20 00:00:00.000000000 Z
11
+ date: 2017-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,6 +119,7 @@ files:
119
119
  - ".gitignore"
120
120
  - ".rubocop.yml"
121
121
  - ".rubocop_todo.yml"
122
+ - ".ruby-version"
122
123
  - ".travis.yml"
123
124
  - CODE_OF_CONDUCT.md
124
125
  - Gemfile
@@ -151,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
152
  version: '0'
152
153
  requirements: []
153
154
  rubyforge_project:
154
- rubygems_version: 2.6.11
155
+ rubygems_version: 2.5.1
155
156
  signing_key:
156
157
  specification_version: 4
157
158
  summary: Create JIRA tickets