Class: CreateTicket::CLI
- Inherits:
-
Object
- Object
- CreateTicket::CLI
- Defined in:
- lib/create_ticket/cli.rb
Instance Method Summary collapse
- #assignee ⇒ Object
- #custom_fields ⇒ Object
- #duedate ⇒ Object
- #issue_type ⇒ Object
- #jira_token ⇒ Object
- #jira_url ⇒ Object
- #project ⇒ Object
- #run! ⇒ Object
- #template_filename ⇒ Object
Instance Method Details
#assignee ⇒ Object
23 24 25 |
# File 'lib/create_ticket/cli.rb', line 23 def assignee ENV.fetch('JIRA_ASSIGNEE') end |
#custom_fields ⇒ Object
31 32 33 34 |
# File 'lib/create_ticket/cli.rb', line 31 def custom_fields ENV.select { |k, _| k.start_with? 'JIRA_CUSTOMFIELD' }.to_a .map { |k, v| [k.downcase.sub(/^jira_/, ''), v] }.to_h end |
#duedate ⇒ Object
36 37 38 |
# File 'lib/create_ticket/cli.rb', line 36 def duedate ENV['JIRA_DUEDATE'] end |
#issue_type ⇒ Object
27 28 29 |
# File 'lib/create_ticket/cli.rb', line 27 def issue_type ENV.fetch('JIRA_ISSUE_TYPE') end |
#jira_token ⇒ Object
15 16 17 |
# File 'lib/create_ticket/cli.rb', line 15 def jira_token ENV.fetch('JIRA_TOKEN') end |
#jira_url ⇒ Object
7 8 9 |
# File 'lib/create_ticket/cli.rb', line 7 def jira_url ENV.fetch('JIRA_URL') end |
#project ⇒ Object
11 12 13 |
# File 'lib/create_ticket/cli.rb', line 11 def project ENV.fetch('JIRA_PROJECT') end |
#run! ⇒ Object
40 41 42 |
# File 'lib/create_ticket/cli.rb', line 40 def run! CreateTicket.new(self).create_ticket! end |
#template_filename ⇒ Object
19 20 21 |
# File 'lib/create_ticket/cli.rb', line 19 def template_filename ENV.fetch('TEMPLATE_FILENAME') end |