pt-flow 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Guardfile +8 -0
- data/lib/pt-flow/ui.rb +1 -1
- data/lib/pt-flow/version.rb +1 -1
- data/pt-flow.gemspec +4 -0
- data/spec/fixtures/global_config.yml +3 -0
- data/spec/fixtures/local_config.yml +6 -0
- data/spec/lib/pt-flow/ui_spec.rb +43 -0
- data/spec/spec_helper.rb +11 -0
- metadata +69 -7
data/Guardfile
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec', :version => 2, :all_on_start => false, :all_after_pass => false do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
end
|
data/lib/pt-flow/ui.rb
CHANGED
@@ -45,7 +45,7 @@ class PT::Flow::UI < PT::UI
|
|
45
45
|
`git remote prune origin`
|
46
46
|
|
47
47
|
# Remove local branches fully merged with origin/master
|
48
|
-
`git branch --merged origin/master | grep -v 'master$' | xargs git branch -
|
48
|
+
`git branch --merged origin/master | grep -v 'master$' | xargs git branch -D`
|
49
49
|
|
50
50
|
congrats('All clean!')
|
51
51
|
end
|
data/lib/pt-flow/version.rb
CHANGED
data/pt-flow.gemspec
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module PT::Flow
|
4
|
+
describe UI do
|
5
|
+
|
6
|
+
let(:project) { double('Project', id: 1, use_https: false) }
|
7
|
+
let(:task) { double('Task', id: 1, name: 'Do this', current_state: 'Unscheduled', estimate: 1, errors: []) }
|
8
|
+
let(:prompt) { double('HighLine') }
|
9
|
+
|
10
|
+
before do
|
11
|
+
PivotalTracker::Project.stub(all: [], find: project)
|
12
|
+
PivotalTracker::Story.stub(find: task)
|
13
|
+
HighLine.stub(new: prompt)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#start' do
|
17
|
+
before do
|
18
|
+
project.stub(stories: double('stories', all: [task]))
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'given no args' do
|
22
|
+
it "shows lists of tasks - choosing one starts/assigns the task on pt and checks out a new branch." do
|
23
|
+
prompt.should_receive(:ask).with("Please select a task to start working on (1-1, 'q' to exit)".bold).and_return('1')
|
24
|
+
task.should_receive(:update).with(owned_by: 'Jens Balvig').and_return(task)
|
25
|
+
task.should_receive(:update).with(current_state: 'started').and_return(task)
|
26
|
+
UI.any_instance.should_receive(:`).with('git checkout -B 1')
|
27
|
+
|
28
|
+
ui = UI.new %w{ start }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context 'given a number' do
|
32
|
+
it "starts/assigns the task on pt and checks out a new branch." do
|
33
|
+
task.should_receive(:update).with(owned_by: 'Jens Balvig').and_return(task)
|
34
|
+
task.should_receive(:update).with(current_state: 'started').and_return(task)
|
35
|
+
UI.any_instance.should_receive(:`).with('git checkout -B 1')
|
36
|
+
|
37
|
+
ui = UI.new %w{ start 1 }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
require 'pt-flow'
|
3
|
+
|
4
|
+
PT::UI.send(:remove_const, :GLOBAL_CONFIG_PATH)
|
5
|
+
PT::UI.send(:remove_const, :LOCAL_CONFIG_PATH)
|
6
|
+
PT::UI::GLOBAL_CONFIG_PATH = File.join(File.dirname(__FILE__), 'fixtures', 'global_config.yml')
|
7
|
+
PT::UI::LOCAL_CONFIG_PATH = File.join(File.dirname(__FILE__), 'fixtures', 'local_config.yml')
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.mock_with :rspec
|
11
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pt-flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-10-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pt
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,60 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '2.9'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '2.9'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: guard
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: guard-rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
25
78
|
description: Some extra methods for the pt gem to use in our dev flow.
|
26
79
|
email:
|
27
80
|
- jens@balvig.com
|
@@ -32,6 +85,7 @@ extra_rdoc_files: []
|
|
32
85
|
files:
|
33
86
|
- .gitignore
|
34
87
|
- Gemfile
|
88
|
+
- Guardfile
|
35
89
|
- LICENSE
|
36
90
|
- README.md
|
37
91
|
- Rakefile
|
@@ -40,6 +94,10 @@ files:
|
|
40
94
|
- lib/pt-flow/ui.rb
|
41
95
|
- lib/pt-flow/version.rb
|
42
96
|
- pt-flow.gemspec
|
97
|
+
- spec/fixtures/global_config.yml
|
98
|
+
- spec/fixtures/local_config.yml
|
99
|
+
- spec/lib/pt-flow/ui_spec.rb
|
100
|
+
- spec/spec_helper.rb
|
43
101
|
homepage: ''
|
44
102
|
licenses: []
|
45
103
|
post_install_message:
|
@@ -54,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
112
|
version: '0'
|
55
113
|
segments:
|
56
114
|
- 0
|
57
|
-
hash:
|
115
|
+
hash: 3650737686470413081
|
58
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
117
|
none: false
|
60
118
|
requirements:
|
@@ -63,11 +121,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
121
|
version: '0'
|
64
122
|
segments:
|
65
123
|
- 0
|
66
|
-
hash:
|
124
|
+
hash: 3650737686470413081
|
67
125
|
requirements: []
|
68
126
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.
|
127
|
+
rubygems_version: 1.8.23
|
70
128
|
signing_key:
|
71
129
|
specification_version: 3
|
72
130
|
summary: Some extra methods for the pt gem to use in our dev flow.
|
73
|
-
test_files:
|
131
|
+
test_files:
|
132
|
+
- spec/fixtures/global_config.yml
|
133
|
+
- spec/fixtures/local_config.yml
|
134
|
+
- spec/lib/pt-flow/ui_spec.rb
|
135
|
+
- spec/spec_helper.rb
|