github-pivotal-flow 1.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9b610ee742c48034c61dea914dda07d41e01ad3
4
- data.tar.gz: 036cd8c69558626b705bc11fbf8eca6112a31862
3
+ metadata.gz: 1f48c6c6681d452bc95ae8070df768f9eb197630
4
+ data.tar.gz: 3477460091811610ce0bb27b5f37586955be40d6
5
5
  SHA512:
6
- metadata.gz: 32a04dadb71f5408229e4fba7067283d7181438ca298c2e6fe070669db7d45c0b1f5eb2588af45f7f59c07f754001f37a48ed6744acfe027e11e31e8f4e276fd
7
- data.tar.gz: 98b3862a4c10d87e2dac080b62eff22e52df789ff5e70fd18640db09d86b39f5225ebeea03b848c053935b7c6ae71bb9097e7b804e5952eae69d075caee22b2e
6
+ metadata.gz: b575b85c76b662a4c5507ea1f6a6c161bc6c0e441c53c7d8b413ee8720329208df7a5022a99a28f6af6ff70db8be80831f78f82c87764fb52ae07dfb6ef18efb
7
+ data.tar.gz: 495535b82f4a6d85989a07e8b80594f5cce8fde4c41e54ec0243c5ab7b718309071d868dd8f85ccc14ee078a69b47727c4467519af72a6dbd34f3f89a6b0113a
data/README.md CHANGED
@@ -24,7 +24,7 @@ $ gem install github-pivotal-flow
24
24
  The typical workflow looks something like the following:
25
25
 
26
26
  ```plain
27
- $ git start # Creates branch, opens a pull request on Github and starts story
27
+ $ git start # Creates branch from your [development] branch and starts story
28
28
  $ git commit ...
29
29
  $ git commit ... # Your existing development process
30
30
  $ git commit ...
@@ -46,7 +46,6 @@ In order to use `github-pivotal-flow`, a few Git client configuration properties
46
46
  | `gitflow.branch.development` | The Git-flow development branch name. The branch that is commonly used for your development.
47
47
  | `gitflow.prefix.feature` | Git-flow feature branch name prefix.
48
48
  | `gitflow.prefix.hotfix` | Git-flow hotfix branch name prefix.
49
- | `gitflow.prefix.feature` | Git-flow feature branch name prefix.
50
49
  | `gitflow.prefix.release` | Git-flow release branch name prefix.
51
50
 
52
51
  [profile]: https://www.pivotaltracker.com/profile
@@ -171,9 +171,9 @@ module GithubPivotalFlow
171
171
  end
172
172
 
173
173
  def self.clean_working_tree?
174
- exec("git diff --no-ext-diff --ignore-submodules --quiet --exit-code", false)
174
+ system("git diff --no-ext-diff --ignore-submodules --quiet --exit-code")
175
175
  fail("fatal: Working tree contains unstaged changes. Aborting.") if $?.exitstatus != 0
176
- exec("git diff-index --cached --quiet --ignore-submodules HEAD --", false)
176
+ system("git diff-index --cached --quiet --ignore-submodules HEAD --")
177
177
  fail("fatal: Index contains uncommited changes. Aborting.") if $?.exitstatus != 0
178
178
  return true
179
179
  end
@@ -12,7 +12,7 @@ module GithubPivotalFlow
12
12
  instance_variable_set("@#{k}", v) unless v.nil?
13
13
  end
14
14
  url = Git.get_config("remote.#{Git.get_remote}.url")
15
- if (matchdata = /^git@([a-z0-9\._-]+):([a-z0-9_-]+)\/([a-z0-9_-]+)(\.git)?$/.match(url.strip))
15
+ if (matchdata = /^git@([a-z0-9\._-]+):([a-z0-9_-]+)\/([a-z0-9_-]+)(\.git)?$/i.match(url.strip))
16
16
  self.host ||= matchdata[1]
17
17
  self.owner ||= matchdata[2]
18
18
  self.name ||= matchdata[3]
@@ -45,4 +45,4 @@ module GithubPivotalFlow
45
45
  return pivotal_project.send(m, *args, &block)
46
46
  end
47
47
  end
48
- end
48
+ end
@@ -9,6 +9,8 @@ module GithubPivotalFlow
9
9
  # @param [PivotalTracker::Story] story the story to pretty print
10
10
  # @return [void]
11
11
  def self.pretty_print(story)
12
+ print_label LABEL_ID
13
+ print_value story.id
12
14
  print_label LABEL_TITLE
13
15
  print_value story.name
14
16
 
@@ -217,6 +219,7 @@ module GithubPivotalFlow
217
219
  private
218
220
  CANDIDATE_STATES = %w(rejected unstarted unscheduled).freeze
219
221
  LABEL_DESCRIPTION = 'Description'.freeze
222
+ LABEL_ID = 'ID'.freeze
220
223
  LABEL_TITLE = 'Title'.freeze
221
224
  LABEL_WIDTH = (LABEL_DESCRIPTION.length + 2).freeze
222
225
  CONTENT_WIDTH = (HighLine.new.output_cols - LABEL_WIDTH).freeze
@@ -226,10 +229,10 @@ module GithubPivotalFlow
226
229
  end
227
230
 
228
231
  def self.print_value(value)
229
- if value.nil? || value.empty?
232
+ if value.blank?
230
233
  puts ''
231
234
  else
232
- value.scan(/\S.{0,#{CONTENT_WIDTH - 2}}\S(?=\s|$)|\S+/).each_with_index do |line, index|
235
+ value.to_s.scan(/\S.{0,#{CONTENT_WIDTH - 2}}\S(?=\s|$)|\S+/).each_with_index do |line, index|
233
236
  if index == 0
234
237
  puts line
235
238
  else
@@ -1,3 +1,3 @@
1
1
  module GithubPivotalFlow
2
- VERSION = '1.2'
2
+ VERSION = '1.3'
3
3
  end
@@ -119,6 +119,14 @@ module GithubPivotalFlow
119
119
  expect(project.owner).to eq('roomorama')
120
120
  expect(project.name).to eq('github-pivotal-flow')
121
121
  end
122
+
123
+ it 'supports working with git urls with uppercase letters from the configuration' do
124
+ expect(Git).to receive(:get_remote).and_return('origin')
125
+ expect(Git).to receive(:get_config).with('remote.origin.url').and_return('git@github.com:Roomorama/Github-Pivotal-Flow.git')
126
+ project = @configuration.project
127
+ expect(project.owner).to eq('Roomorama')
128
+ expect(project.name).to eq('Github-Pivotal-Flow')
129
+ end
122
130
  end
123
131
  end
124
132
  end
@@ -20,42 +20,45 @@ module GithubPivotalFlow
20
20
  describe '.pretty_print' do
21
21
  it 'pretty-prints story information' do
22
22
  story = double('story')
23
+ expect(story).to receive(:id).and_return(135468)
23
24
  expect(story).to receive(:name)
24
25
  expect(story).to receive(:description).and_return("description-1\ndescription-2")
25
26
  expect(PivotalTracker::Note).to receive(:all).and_return([PivotalTracker::Note.new(:noted_at => Date.new, :text => 'note-1')])
26
27
 
27
28
  Story.pretty_print story
28
29
 
29
- expect($stdout.string).to eq(
30
+ expect($stdout.string).to eq( " ID: 135468\n" +
30
31
  " Title: \n" +
31
- "Description: description-1\n" +
32
- " description-2\n" +
33
- " Note 1: note-1\n" +
34
- "\n")
32
+ "Description: description-1\n" +
33
+ " description-2\n" +
34
+ " Note 1: note-1\n" +
35
+ "\n")
35
36
  end
36
37
 
37
38
  it 'does not pretty print description or notes if there are none (empty)' do
38
39
  story = double('story')
40
+ expect(story).to receive(:id).and_return(135468)
39
41
  expect(story).to receive(:name)
40
42
  expect(story).to receive(:description)
41
43
  expect(PivotalTracker::Note).to receive(:all).and_return([])
42
44
 
43
45
  Story.pretty_print story
44
46
 
45
- expect($stdout.string).to eq(
47
+ expect($stdout.string).to eq( " ID: 135468\n" +
46
48
  " Title: \n" +
47
49
  "\n")
48
50
  end
49
51
 
50
52
  it 'does not pretty print description or notes if there are none (nil)' do
51
53
  story = double('story')
54
+ expect(story).to receive(:id).and_return(135468)
52
55
  expect(story).to receive(:name)
53
56
  expect(story).to receive(:description).and_return('')
54
57
  expect(PivotalTracker::Note).to receive(:all).and_return([])
55
58
 
56
59
  Story.pretty_print story
57
60
 
58
- expect($stdout.string).to eq(
61
+ expect($stdout.string).to eq( " ID: 135468\n" +
59
62
  " Title: \n" +
60
63
  "\n")
61
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pivotal-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donald Piret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  version: '0'
208
208
  requirements: []
209
209
  rubyforge_project:
210
- rubygems_version: 2.2.2
210
+ rubygems_version: 2.4.5.1
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: Git commands for integration with Pivotal Tracker and Github pull requests
@@ -220,4 +220,3 @@ test_files:
220
220
  - spec/github_pivotal_flow/shell_spec.rb
221
221
  - spec/github_pivotal_flow/start_spec.rb
222
222
  - spec/github_pivotal_flow/story_spec.rb
223
- has_rdoc: