create_ticket 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -4
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/create_ticket.gemspec +2 -0
- data/exe/create_ticket +1 -1
- data/lib/create_ticket.rb +12 -25
- data/lib/create_ticket/cli.rb +20 -0
- data/lib/create_ticket/version.rb +4 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73ab251a7382b54198e7c1830125e6cc7167b1d7
|
4
|
+
data.tar.gz: c98af4da77d50084804ec1d4e64703d8f89916c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997a48983c059a4bfe8edbda17963abcee4a192d58aa777f650071a179da59b5f62600e99dd958105371609ea499a0782ad27ffb16ae5e33197c5c79f1eb3fee
|
7
|
+
data.tar.gz: 82336605d4282b272f7f8bfe677a08bba2936245dc173ad320e5cc0058c6701cec8d5dd334765b1449a142c0e37018530b3780f9304449da40019af0ee978f0e
|
data/.rubocop_todo.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/create_ticket.gemspec
CHANGED
data/exe/create_ticket
CHANGED
data/lib/create_ticket.rb
CHANGED
@@ -1,34 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'create_ticket/version'
|
2
4
|
require 'markdown2confluence'
|
3
5
|
require 'faraday'
|
4
6
|
require 'json'
|
5
7
|
require 'erb'
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def jira_url
|
11
|
-
ENV.fetch('JIRA_URL')
|
12
|
-
end
|
13
|
-
|
14
|
-
def project
|
15
|
-
ENV.fetch('JIRA_PROJECT')
|
16
|
-
end
|
17
|
-
|
18
|
-
def jira_token
|
19
|
-
ENV.fetch('JIRA_TOKEN')
|
20
|
-
end
|
21
|
-
|
22
|
-
def template_filename
|
23
|
-
ENV.fetch('TEMPLATE_FILENAME')
|
24
|
-
end
|
9
|
+
class CreateTicket
|
10
|
+
attr_reader *%i[jira_url project jira_token template_filename assignee issue_type]
|
25
11
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
12
|
+
def initialize(conf)
|
13
|
+
@jira_url = conf.fetch(:jira_url)
|
14
|
+
@project = conf.fetch(:project)
|
15
|
+
@jira_token = conf.fetch(:jira_token)
|
16
|
+
@template_filename = conf.fetch(:template_filename)
|
17
|
+
@assignee = conf.fetch(:assignee)
|
18
|
+
@issue_type = conf.fetch(:issue_type)
|
32
19
|
end
|
33
20
|
|
34
21
|
def template
|
@@ -92,7 +79,7 @@ module CreateTicket
|
|
92
79
|
def description
|
93
80
|
# TODO: Assumes Markdown with an h1 at the top.
|
94
81
|
markdown = content.sub(/# .*\n/, '')
|
95
|
-
|
82
|
+
|
96
83
|
Kramdown::Document.new(markdown, kramdown_options).to_confluence
|
97
84
|
end
|
98
85
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateTicket
|
4
|
+
class Cli
|
5
|
+
def conf
|
6
|
+
{
|
7
|
+
jira_url: ENV.fetch('JIRA_URL'),
|
8
|
+
project: ENV.fetch('JIRA_PROJECT'),
|
9
|
+
jira_token: ENV.fetch('JIRA_TOKEN'),
|
10
|
+
template_filename: ENV.fetch('TEMPLATE_FILENAME'),
|
11
|
+
assignee: ENV.fetch('JIRA_ASSIGNEE'),
|
12
|
+
issue_type: ENV.fetch('JIRA_ISSUE_TYPE')
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def run!
|
17
|
+
CreateTicket.new(conf).create_ticket!
|
18
|
+
end
|
19
|
+
end
|
20
|
+
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.
|
4
|
+
version: 0.2.0
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- create_ticket.gemspec
|
132
132
|
- exe/create_ticket
|
133
133
|
- lib/create_ticket.rb
|
134
|
+
- lib/create_ticket/cli.rb
|
134
135
|
- lib/create_ticket/version.rb
|
135
136
|
homepage: https://github.com/govdelivery/create_ticket
|
136
137
|
licenses:
|