octopolo 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTgyM2U3NzNkMzA5ZmFmYjM2ZjkwNTAzNTU2MDU3MWQzNWVlMzc5Nw==
4
+ Yzk5NjJkNWE2MzhhYTkxOWVhMzFiZGUxMDRhMTgwNTAyY2UzMjQ1ZA==
5
5
  data.tar.gz: !binary |-
6
- NThjZWMxNGIwMjkyMTgxYjVlN2FhZmQ1YjZiMThjZWUyMDY5YzQ4Ng==
6
+ MTVhNTUyNmZhY2NmZGYzZTRkOGJhM2M2MzRmOTE1ZWViNWI3NDJmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTQwNTI2ZThiYzFhNGI1YmJiM2Q0YjUxOTNhM2ViYTBhMmEyNmM1N2M0Y2Jh
10
- YTdiY2Y4ODRhMTJmOGU2MzgyYjQ3MzBiY2NiY2I4NjEwYzIyMjM5NTBkNTk5
11
- MTU0MzEyNDlkNTk0MGFmMmU0ZWVkMjcwOWU5NDAyYzkyMDc3ZTU=
9
+ ZTM0M2VjODQyNGY2YmE1YjQ1YTI1ZTRmNjFiZWZiNDg0NmYyMjNjMmY2MDJk
10
+ ODlkYjYxYzEzZDExNjI0Mzk3M2JlNmYzYjEzNTI1MzQzN2Y3MTM4MGQ2ZjE5
11
+ NDRkZThhMjVkYzcxMTVkMDExZjcwM2Q2MmQ1YzI0NmZhZGUxYWQ=
12
12
  data.tar.gz: !binary |-
13
- ZDk2ZTdlMGExMzg1NTNhNzUzY2RkMzEyZjJiYTI5MzJhNjg3ZWJlOWY4YTY1
14
- ZTg3N2RiOWQ1ZmI5MWM0MWYwNGZlNmZhZDliOTRjNjA3Zjc2NDJmNWRlNWFk
15
- ODUyZDg3MmUzYTcwZDczMDdkNjBlOTBhY2E5YzdlOTM3NDdjZmE=
13
+ YjIwODg3ODA4NGI2MWQ2YTY4YzllZTNlZDY2YzNkMWFmMDgzZmM4NTRiNDUy
14
+ ZDk4NTc5OTNhOWZmMGEwNzM2OGU5NjJhMThjNmVlYTQ4NTY5MzYzMTI0MDA1
15
+ ZmVkNWUyYmExMTEwNDlkMjIzZDAwNzE2NDIwZGZiM2M0NTU2MTQ=
@@ -1,3 +1,9 @@
1
+ #### v0.1.3
2
+
3
+ * Label tweaks
4
+
5
+ > Nick LaMuro: Ian Ehlert: https://github.com/sportngin/octopolo/pull/30
6
+
1
7
  #### v0.1.2
2
8
 
3
9
  * Fixed first_or_create
@@ -72,9 +72,9 @@ module Octopolo
72
72
 
73
73
  # Private: Ask for a label for the pull request
74
74
  def ask_label
75
- labels = Octopolo::GitHub::Label.all
76
- response = cli.ask("Label:", Octopolo::GitHub::Label.get_names(labels).unshift("Don't know yet"))
77
- self.label = Hash[labels.map{|l| [l.name,l]}][response]
75
+ choices = Octopolo::GitHub::Label.get_names(label_choices).concat(["None"])
76
+ response = cli.ask(label_prompt, choices)
77
+ self.label = Hash[label_choices.map{|l| [l.name,l]}][response]
78
78
  end
79
79
  private :ask_label
80
80
 
@@ -119,6 +119,14 @@ module Octopolo
119
119
  end
120
120
  private :open_pull_request
121
121
 
122
+ def label_prompt
123
+ 'Label:'
124
+ end
125
+
126
+ def label_choices
127
+ Octopolo::GitHub::Label.all
128
+ end
129
+
122
130
  def update_pivotal
123
131
  pivotal_ids.each do |story_id|
124
132
  Pivotal::StoryCommenter.new(story_id, pull_request.url).perform
@@ -1,3 +1,3 @@
1
1
  module Octopolo
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -117,11 +117,11 @@ module Octopolo
117
117
  context "#ask_label" do
118
118
  let(:label1) {Octopolo::GitHub::Label.new(name: "low-risk", color: '151515')}
119
119
  let(:label2) {Octopolo::GitHub::Label.new(name: "high-risk", color: '151515')}
120
- let(:choices) {["Don't know yet", "low-risk","high-risk"]}
120
+ let(:choices) {["low-risk","high-risk","None"]}
121
+
121
122
  it "asks for and capture a label" do
122
123
  allow(Octopolo::GitHub::Label).to receive(:all) {[label1,label2]}
123
- allow(Octopolo::GitHub::Label).to receive(:get_names) {choices}
124
- expect(cli).to receive(:ask).with("Label:",choices)
124
+ expect(cli).to receive(:ask).with("Label:", choices)
125
125
  subject.send(:ask_label)
126
126
  end
127
127
 
@@ -192,6 +192,17 @@ module Octopolo
192
192
  end
193
193
  end
194
194
 
195
+ context "#label_choices" do
196
+ let(:label1) { Octopolo::GitHub::Label.new(name: "low-risk", color: '151515') }
197
+ let(:label2) { Octopolo::GitHub::Label.new(name: "high-risk", color: '151515') }
198
+ let(:github_labels) { [label1, label2] }
199
+
200
+ it "returns the labels plus 'None'" do
201
+ allow(Octopolo::GitHub::Label).to receive(:all) { github_labels }
202
+ expect(subject.send(:label_choices)).to eq github_labels
203
+ end
204
+ end
205
+
195
206
  context "#update_pivotal" do
196
207
  before do
197
208
  subject.pivotal_ids = %w(123 234)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-29 00:00:00.000000000 Z
12
+ date: 2014-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake