lib/octopolo/scripts/pull_request.rb in octopolo-0.1.2 vs lib/octopolo/scripts/pull_request.rb in octopolo-0.1.3

- old
+ new

@@ -70,13 +70,13 @@ end private :ask_title # Private: Ask for a label for the pull request def ask_label - labels = Octopolo::GitHub::Label.all - response = cli.ask("Label:", Octopolo::GitHub::Label.get_names(labels).unshift("Don't know yet")) - self.label = Hash[labels.map{|l| [l.name,l]}][response] + choices = Octopolo::GitHub::Label.get_names(label_choices).concat(["None"]) + response = cli.ask(label_prompt, choices) + self.label = Hash[label_choices.map{|l| [l.name,l]}][response] end private :ask_label # Private: Ask for a Pivotal Tracker story IDs def ask_pivotal_ids @@ -116,9 +116,17 @@ def open_pull_request cli.copy_to_clipboard pull_request.url cli.open pull_request.url end private :open_pull_request + + def label_prompt + 'Label:' + end + + def label_choices + Octopolo::GitHub::Label.all + end def update_pivotal pivotal_ids.each do |story_id| Pivotal::StoryCommenter.new(story_id, pull_request.url).perform end if pivotal_ids