Class: Octopolo::Scripts::Issue
- Inherits:
-
Object
- Object
- Octopolo::Scripts::Issue
- Includes:
- CLIWrapper, ConfigWrapper, GitWrapper
- Defined in:
- lib/octopolo/scripts/issue.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#issue ⇒ Object
Returns the value of attribute issue.
-
#jira_ids ⇒ Object
Returns the value of attribute jira_ids.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#options ⇒ Object
Returns the value of attribute options.
-
#pivotal_ids ⇒ Object
Returns the value of attribute pivotal_ids.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes included from GitWrapper
Attributes included from ConfigWrapper
Attributes included from CLIWrapper
Class Method Summary collapse
Instance Method Summary collapse
-
#ask_jira_ids ⇒ Object
Protected: Ask for a Jira Tracker story IDs.
- #execute ⇒ Object
- #generate_generic_label_choices ⇒ Object
-
#initialize(options = {}) ⇒ Issue
constructor
A new instance of Issue.
- #label_choices ⇒ Object
- #label_hash ⇒ Object
- #label_prompt ⇒ Object
- #label_questions ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Issue
Returns a new instance of Issue.
27 28 29 |
# File 'lib/octopolo/scripts/issue.rb', line 27 def initialize(={}) @options = end |
Instance Attribute Details
#issue ⇒ Object
Returns the value of attribute issue.
17 18 19 |
# File 'lib/octopolo/scripts/issue.rb', line 17 def issue @issue end |
#jira_ids ⇒ Object
Returns the value of attribute jira_ids.
19 20 21 |
# File 'lib/octopolo/scripts/issue.rb', line 19 def jira_ids @jira_ids end |
#labels ⇒ Object
Returns the value of attribute labels.
20 21 22 |
# File 'lib/octopolo/scripts/issue.rb', line 20 def labels @labels end |
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/octopolo/scripts/issue.rb', line 21 def @options end |
#pivotal_ids ⇒ Object
Returns the value of attribute pivotal_ids.
18 19 20 |
# File 'lib/octopolo/scripts/issue.rb', line 18 def pivotal_ids @pivotal_ids end |
#title ⇒ Object
Returns the value of attribute title.
16 17 18 |
# File 'lib/octopolo/scripts/issue.rb', line 16 def title @title end |
Class Method Details
.execute(options = {}) ⇒ Object
23 24 25 |
# File 'lib/octopolo/scripts/issue.rb', line 23 def self.execute(={}) new().execute end |
Instance Method Details
#ask_jira_ids ⇒ Object
Protected: Ask for a Jira Tracker story IDs
87 88 89 90 |
# File 'lib/octopolo/scripts/issue.rb', line 87 def ask_jira_ids response = Octopolo::Question.new(prompt: "Jira story ID(s):").prompt self.jira_ids = response.split(/[\s,]+/) end |
#execute ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/octopolo/scripts/issue.rb', line 31 def execute GitHub.connect do ask_questionaire create_issue update_pivotal update_jira update_labels open_in_browser end end |
#generate_generic_label_choices ⇒ Object
135 136 137 |
# File 'lib/octopolo/scripts/issue.rb', line 135 def generate_generic_label_choices Octopolo::GitHub::Label.get_names(label_choices).concat(["None"]) end |
#label_choices ⇒ Object
139 140 141 |
# File 'lib/octopolo/scripts/issue.rb', line 139 def label_choices Octopolo::GitHub::Label.all end |
#label_hash ⇒ Object
143 144 145 |
# File 'lib/octopolo/scripts/issue.rb', line 143 def label_hash Hash[label_choices.map{ |l| [l.name, l] }] end |
#label_prompt ⇒ Object
131 132 133 |
# File 'lib/octopolo/scripts/issue.rb', line 131 def label_prompt "Label:" end |