ptb 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ptb/cli.rb +15 -7
- data/ptb.gemspec +1 -1
- metadata +4 -5
- data/ptb-0.0.1.gem +0 -0
data/lib/ptb/cli.rb
CHANGED
@@ -30,23 +30,31 @@ module Ptb
|
|
30
30
|
|
31
31
|
desc "message",
|
32
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
33
|
def message
|
39
34
|
branch = `git symbolic-ref --short HEAD`.strip
|
40
35
|
if branch =~ /^[0-9]+$/
|
41
36
|
if story = project.stories.find(branch)
|
42
|
-
|
43
|
-
|
37
|
+
puts <<-EOS
|
38
|
+
[##{branch}]
|
39
|
+
|
40
|
+
#{word_wrap(story.name, :line_width => 72)}
|
41
|
+
#{story.url}
|
42
|
+
EOS
|
44
43
|
end
|
45
44
|
end
|
46
45
|
end
|
47
46
|
|
48
47
|
private
|
49
48
|
|
49
|
+
def word_wrap(text, *args)
|
50
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
51
|
+
options = { :line_width => 80 }.merge(options)
|
52
|
+
|
53
|
+
text.split("\n").collect do |line|
|
54
|
+
line.length > options[:line_width] ? line.gsub(/(.{1,#{options[:line_width]}})(\s+|$)/, "\\1\n").strip : line
|
55
|
+
end * "\n"
|
56
|
+
end
|
57
|
+
|
50
58
|
def choose(prompt, choices, confirm=false)
|
51
59
|
selection = nil
|
52
60
|
say ""
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
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: 2013-03-
|
18
|
+
date: 2013-03-27 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -62,7 +62,6 @@ files:
|
|
62
62
|
- bin/ptb
|
63
63
|
- lib/ptb.rb
|
64
64
|
- lib/ptb/cli.rb
|
65
|
-
- ptb-0.0.1.gem
|
66
65
|
- ptb.gemspec
|
67
66
|
has_rdoc: true
|
68
67
|
homepage: http://craftyco.de
|
data/ptb-0.0.1.gem
DELETED
Binary file
|