pivotal-brancher 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZmYzNTI1YjU5NzM2YzhiMmRjMjI0ZjUzOTkzMTI4ODIzMjNmM2FlMA==
5
+ data.tar.gz: !binary |-
6
+ MWE5MjY3ODIyN2RjMjk3NGE3NzgyNGIwOWZhNjNkMTEwNDhlMTU3Zg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzlkY2ZmMDgwOGRiMmQwMGE1ODdjYWY2Y2E1YTA5ZmNkZWViYzQ0ZjNiODU0
10
+ NTE2YzUwMzNmMTE5ZTU1ZjM2ZGQxOTAwM2NlODVhM2IyZDE3NmNhODNjMGJk
11
+ NzdkYjcwNWE0MTAxYmNmNjljNTViMTVmODlmODNkNjNiMDA1YjQ=
12
+ data.tar.gz: !binary |-
13
+ MGYwNmJhODFkNjA3ODYxZWVkNTVkNWU1YzBkODhhNWMzYmJiY2RjZTcxN2Vj
14
+ M2JjYmVjMmI5NWU3OTc5MWY1Y2QxNWYyZDY2YWU1ZWVjNjhlY2U0NzNmZTVi
15
+ MjVkNWE1NDI5ZjZkZWE2ZDgzMmQzYjBhNmMyNDVjNTUwZWRkY2I=
@@ -40,15 +40,28 @@ module PivotalBrancher
40
40
  say "Switching to branch for:"
41
41
  say "#{story.id}: #{story.name}"
42
42
  story_branch_name(story)
43
- when (2..4)
43
+ when (2..6)
44
44
  say "There are #{stories.length} stories started"
45
- stories.each do |story|
46
- say " #{story.id}: #{story.name}"
47
- end
48
- say
49
- branchname = story_branch_name(stories.first, stories.map(&:id))
50
- unless yes?("Start branch named #{branchname}?")
51
- exit 1
45
+ branchname = nil
46
+ indexes = (1..stories.length).to_a
47
+ loop do
48
+ stories.each_with_index do |story, index|
49
+ say "#{indexes.include?(index + 1) ? "*" : " "} #{story.id}: #{story.name}"
50
+ end
51
+ say
52
+ chosen_stories = stories.each_with_index.find_all do |story, index|
53
+ indexes.include? index + 1
54
+ end.map{|story,_| story}
55
+ branchname = story_branch_name(chosen_stories.first, chosen_stories.map(&:id))
56
+
57
+ answer = ask("Start branch named #{branchname}? (or numbers to filter)")
58
+ if /y|yes/ =~ answer
59
+ break
60
+ elsif /\d+(?:\s+\d+)*/ =~ answer
61
+ indexes = answer.split(/\s+/).map(&:to_i)
62
+ else
63
+ exit 1
64
+ end
52
65
  end
53
66
  branchname
54
67
  else
data/spec/start.rb CHANGED
@@ -29,12 +29,17 @@ describe PivotalBrancher::Cli do
29
29
  ]
30
30
  end
31
31
 
32
- before :each do
33
- cli.stub(:yes? => true)
32
+ it "should build branch name for all stories" do
33
+ cli.stub(:ask => "yes")
34
+ cli.should_receive(:run).with("git checkout -b is_a_story_123456_123457")
35
+ capture_stdout do
36
+ cli.start
37
+ end
34
38
  end
35
39
 
36
- it "should build branch name" do
37
- cli.should_receive(:run).with("git checkout -b is_a_story_123456_123457")
40
+ it "should build a branch name for filtered stories" do
41
+ cli.stub(:ask).and_return("2", "y")
42
+ cli.should_receive(:run).with("git checkout -b a_tale_123457")
38
43
  capture_stdout do
39
44
  cli.start
40
45
  end
data/spec_support/all.rb CHANGED
@@ -1,4 +1,3 @@
1
- support_dir = File::dirname(__FILE__)
2
1
  Dir[File::expand_path("../**/*.rb", __FILE__)].each do |file|
3
2
  require file
4
3
  end
metadata CHANGED
@@ -1,84 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-brancher
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.4
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Judson Lester
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-11 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: 0.5.1
15
19
  prerelease: false
16
- type: :runtime
17
20
  name: pivotal-tracker
18
21
  version_requirements: !ruby/object:Gem::Requirement
19
22
  requirements:
20
23
  - - ~>
21
24
  - !ruby/object:Gem::Version
22
- segments:
23
- - 0
24
- - 5
25
- - 1
26
25
  version: 0.5.1
27
- none: false
26
+ type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- segments:
33
- - 0
34
- - 5
35
- - 1
36
- version: 0.5.1
37
- none: false
38
- - !ruby/object:Gem::Dependency
32
+ version: '1.0'
39
33
  prerelease: false
40
- type: :runtime
41
34
  name: valise
42
35
  version_requirements: !ruby/object:Gem::Requirement
43
36
  requirements:
44
37
  - - ~>
45
38
  - !ruby/object:Gem::Version
46
- segments:
47
- - 1
48
- - 0
49
39
  version: '1.0'
50
- none: false
40
+ type: :runtime
41
+ - !ruby/object:Gem::Dependency
51
42
  requirement: !ruby/object:Gem::Requirement
52
43
  requirements:
53
44
  - - ~>
54
45
  - !ruby/object:Gem::Version
55
- segments:
56
- - 1
57
- - 0
58
- version: '1.0'
59
- none: false
60
- - !ruby/object:Gem::Dependency
46
+ version: '0.18'
61
47
  prerelease: false
62
- type: :runtime
63
48
  name: thor
64
49
  version_requirements: !ruby/object:Gem::Requirement
65
50
  requirements:
66
51
  - - ~>
67
52
  - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- - 18
71
53
  version: '0.18'
72
- none: false
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- - 18
80
- version: '0.18'
81
- none: false
54
+ type: :runtime
82
55
  description: ! " Some command line tools to be used in tandem with a githook for
83
56
  Pivotal\n\n `pb start` will switch to (possibly creating) a git branch named for
84
57
  your\n current highest priority started Pivotal story.\n"
@@ -99,34 +72,30 @@ files:
99
72
  homepage: http://nyarly.github.com/pivotal-brancher
100
73
  licenses:
101
74
  - MIT
75
+ metadata: {}
102
76
  post_install_message:
103
77
  rdoc_options:
104
78
  - --inline-source
105
79
  - --main
106
80
  - doc/README
107
81
  - --title
108
- - pivotal-brancher-0.0.4 Documentation
82
+ - pivotal-brancher-0.0.5 Documentation
109
83
  require_paths:
110
84
  - lib/
111
85
  required_ruby_version: !ruby/object:Gem::Requirement
112
86
  requirements:
113
87
  - - ! '>='
114
88
  - !ruby/object:Gem::Version
115
- segments:
116
- - 0
117
- hash: 304253647
118
89
  version: '0'
119
- none: false
120
90
  required_rubygems_version: !ruby/object:Gem::Requirement
121
91
  requirements:
122
92
  - - ! '>='
123
93
  - !ruby/object:Gem::Version
124
94
  version: '0'
125
- none: false
126
95
  requirements: []
127
96
  rubyforge_project: pivotal-brancher
128
- rubygems_version: 1.8.24
97
+ rubygems_version: 2.1.10
129
98
  signing_key:
130
- specification_version: 3
99
+ specification_version: 4
131
100
  summary: Quickly switch to a feature branch for your current story
132
101
  test_files: []