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 +4 -4
- data/.ruby-version +1 -0
- data/lib/create_ticket.rb +11 -5
- data/lib/create_ticket/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d84978bafbf48d30399598ca2bfd256b9707226
|
4
|
+
data.tar.gz: 9f45cf6775cfa23244fc627ee3ade885d4374275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
89
|
-
|
94
|
+
markdown = content.sub(/# .*\n/, '')
|
95
|
+
|
90
96
|
Kramdown::Document.new(markdown, kramdown_options).to_confluence
|
91
97
|
end
|
92
98
|
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.
|
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-
|
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.
|
155
|
+
rubygems_version: 2.5.1
|
155
156
|
signing_key:
|
156
157
|
specification_version: 4
|
157
158
|
summary: Create JIRA tickets
|