ptb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ptb/cli.rb +22 -5
- data/ptb-0.0.1.gem +0 -0
- data/ptb.gemspec +1 -1
- metadata +4 -4
data/lib/ptb/cli.rb
CHANGED
@@ -15,15 +15,32 @@ module Ptb
|
|
15
15
|
branches=`git branch`
|
16
16
|
|
17
17
|
branches.each_line do |line|
|
18
|
-
branch = line[2..-2]
|
19
|
-
if branch =~ /^[0-9]+$/
|
18
|
+
branch = line[2..-2]
|
19
|
+
if branch =~ /^[0-9]+$/
|
20
20
|
if story = project.stories.find(branch)
|
21
|
-
say "#{line.rstrip} [#{story.current_state}] #{story.name} (#{story.url})"
|
21
|
+
say "#{line.rstrip} [#{story.current_state}] #{story.name} (#{story.url})"
|
22
22
|
else
|
23
23
|
say line.rstrip
|
24
24
|
end
|
25
|
-
else
|
26
|
-
say line.rstrip
|
25
|
+
else
|
26
|
+
say line.rstrip
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "message",
|
32
|
+
"Generates a PivotalTracker commit message for the current branch"
|
33
|
+
method_option :lines,
|
34
|
+
:aliases => '-l',
|
35
|
+
:type => :numeric,
|
36
|
+
:default => 3,
|
37
|
+
:desc => "Number of lines between header and footer"
|
38
|
+
def message
|
39
|
+
branch = `git symbolic-ref --short HEAD`.strip
|
40
|
+
if branch =~ /^[0-9]+$/
|
41
|
+
if story = project.stories.find(branch)
|
42
|
+
lines = "\n" * options[:lines]
|
43
|
+
say "[##{ branch }] #{ story.name }\n#{ lines }#{ story.url }"
|
27
44
|
end
|
28
45
|
end
|
29
46
|
end
|
data/ptb-0.0.1.gem
ADDED
Binary file
|
data/ptb.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ptb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Anthony Crumley
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-03-21 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|