pivotal-brancher 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/pt-start +16 -0
- data/lib/pivotal-brancher.rb +35 -0
- metadata +105 -0
data/bin/pt-start
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
require 'pivotal-brancher'
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
app = PivotalBrancher::App.new
|
6
|
+
stories = app.started_stories
|
7
|
+
story = stories.shift
|
8
|
+
|
9
|
+
$stderr.puts "Switching to branch for:"
|
10
|
+
$stderr.puts "#{story.id}: #{story.name}"
|
11
|
+
$stderr.puts
|
12
|
+
$stderr.puts "Other started stories are:"
|
13
|
+
stories.each do |story|
|
14
|
+
$stderr.puts "#{story.id}: #{story.name}"
|
15
|
+
end
|
16
|
+
%x"git checkout -b #{([story.id] + story.name.split(/\s/).map(&:downcase)).join("_")}"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'valise'
|
2
|
+
require 'pivotal-tracker'
|
3
|
+
|
4
|
+
module PivotalBrancher
|
5
|
+
|
6
|
+
class App
|
7
|
+
def initialize
|
8
|
+
@files = Valise::define do
|
9
|
+
rw ".pivotal-brancher"
|
10
|
+
rw "~/.pivotal-brancher"
|
11
|
+
|
12
|
+
handle "*.yaml", :yaml, :hash_merge
|
13
|
+
end
|
14
|
+
configure_pivotal
|
15
|
+
end
|
16
|
+
|
17
|
+
def configs
|
18
|
+
@files.find("config.yaml").contents
|
19
|
+
end
|
20
|
+
|
21
|
+
def configure_pivotal
|
22
|
+
PivotalTracker::Client.token = configs["token"]
|
23
|
+
PivotalTracker::Client.use_ssl
|
24
|
+
#RestClient.log = "stdout"
|
25
|
+
end
|
26
|
+
|
27
|
+
def project
|
28
|
+
@project = PivotalTracker::Project.find(configs["project"])
|
29
|
+
end
|
30
|
+
|
31
|
+
def started_stories
|
32
|
+
project.stories.all(:current_state => "started", :owned_by => configs["user"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pivotal-brancher
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Judson Lester
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
prerelease: false
|
16
|
+
type: :runtime
|
17
|
+
name: pivotal-tracker
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
segments:
|
23
|
+
- 0
|
24
|
+
- 5
|
25
|
+
- 1
|
26
|
+
version: 0.5.1
|
27
|
+
none: false
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
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
|
39
|
+
prerelease: false
|
40
|
+
type: :runtime
|
41
|
+
name: valise
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 9
|
49
|
+
version: '0.9'
|
50
|
+
none: false
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 9
|
58
|
+
version: '0.9'
|
59
|
+
none: false
|
60
|
+
description: ! " Some command line tools to be used in tandem with a githook for
|
61
|
+
Pivotal\n\n - pt-start will switch to\n (possibly creating) a git branch named
|
62
|
+
for your current highest priority\n started Pivotal story.\n"
|
63
|
+
email:
|
64
|
+
- nyarly@gmail.com
|
65
|
+
executables:
|
66
|
+
- pt-start
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- lib/pivotal-brancher.rb
|
71
|
+
- bin/pt-start
|
72
|
+
homepage: http://nyarly.github.com/pivotal-brancher
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options:
|
77
|
+
- --inline-source
|
78
|
+
- --main
|
79
|
+
- doc/README
|
80
|
+
- --title
|
81
|
+
- pivotal-brancher-0.0.1 Documentation
|
82
|
+
require_paths:
|
83
|
+
- lib/
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
hash: -363476799
|
91
|
+
version: '0'
|
92
|
+
none: false
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
none: false
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project: pivotal-brancher
|
101
|
+
rubygems_version: 1.8.24
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: Quickly switch to a feature branch for your current story
|
105
|
+
test_files: []
|