ptb 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/lib/ptb/cli.rb +22 -5
  2. data/ptb-0.0.1.gem +0 -0
  3. data/ptb.gemspec +1 -1
  4. metadata +4 -4
@@ -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
Binary file
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = "ptb"
4
- s.version = "0.0.1"
4
+ s.version = "0.0.2"
5
5
  s.authors = ["Anthony Crumley"]
6
6
  s.email = ["anthony.crumley@gmail.com"]
7
7
  s.homepage = "http://craftyco.de"
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
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: 2012-02-19 00:00:00 -06:00
18
+ date: 2013-03-21 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency