pt-flow 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,4 +16,5 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .pt
19
- spec/fixtures/dummy/
19
+ spec/fixtures/dummy
20
+ spec/fixtures/origin.git
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in pt-flow.gemspec
4
4
  gemspec
5
- gem 'rake'
data/README.md CHANGED
@@ -19,10 +19,8 @@ $ flow start
19
19
  # shows lists of tasks - choosing one starts/assigns the task on pt and checks out a new branch.
20
20
 
21
21
  $ flow finish
22
- # pushes branch, finishes task on pt, and opens github new pull request page.
23
-
22
+ # pushes branch, finishes task on pt, and creates a pull request
24
23
  # reviewer comments :+1: to approve on github
25
-
26
24
  # committer presses merge button on github which delivers task on pivotal tracker
27
25
 
28
26
  $ flow cleanup
data/lib/pt-flow.rb CHANGED
@@ -1,9 +1,11 @@
1
- require "pt"
2
- require "pt-flow/version"
3
- require "pt-flow/branch"
4
- require "pt-flow/repo"
5
- require "pt-flow/tasks_table"
6
- require "pt-flow/ui"
1
+ require 'pt'
2
+ require 'pt-flow/version'
3
+ require 'pt-flow/branch'
4
+ require 'pt-flow/repo'
5
+ require 'pt-flow/task_row'
6
+ require 'pt-flow/tasks_table'
7
+ require 'pt-flow/ui'
8
+ require 'hirb-colors'
7
9
 
8
10
  module PT
9
11
  module Flow
@@ -0,0 +1,12 @@
1
+ class TaskRow < PT::DataRow
2
+ def method_missing(method)
3
+ str = super
4
+ case @record.story_type
5
+ when 'feature' then str.cyan.bold
6
+ when 'chore' then str
7
+ when 'bug' then str.red
8
+ when 'release' then "< #{str} >".white_on_blue
9
+ else str
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,9 @@
1
1
  module PT::Flow
2
2
  class TasksTable < PT::TasksTable
3
+ def initialize(dataset)
4
+ @rows = dataset.map{ |row| TaskRow.new(row, dataset) }
5
+ end
6
+
3
7
  def self.fields
4
8
  [:name, :story_type, :current_state, :id]
5
9
  end
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = "0.6.4"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
data/pt-flow.gemspec CHANGED
@@ -19,9 +19,11 @@ Gem::Specification.new do |gem|
19
19
  gem.add_dependency 'hub'
20
20
  gem.add_dependency 'active_support'
21
21
  gem.add_dependency 'i18n'
22
+ gem.add_dependency 'hirb-colors'
22
23
 
23
24
  gem.add_development_dependency 'rspec', '~> 2.9'
24
25
  gem.add_development_dependency 'webmock'
25
26
  gem.add_development_dependency 'guard'
26
27
  gem.add_development_dependency 'guard-rspec'
28
+ gem.add_development_dependency 'rake'
27
29
  end
@@ -1,14 +1,23 @@
1
1
  RSpec.configure do |config|
2
- dummy_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'dummy')
2
+ fixtures_path = File.expand_path('../../fixtures', __FILE__)
3
+ dummy_path = File.join(fixtures_path, 'dummy')
4
+ origin_path = File.join(fixtures_path, 'origin.git')
3
5
 
4
6
  config.before(:each) do
5
- FileUtils.rm_rf(dummy_path) if Dir.exists?(dummy_path)
6
- Dir.mkdir(dummy_path)
7
+ [dummy_path, origin_path].each do |path|
8
+ FileUtils.rm_rf(path) if Dir.exists?(path)
9
+ FileUtils.mkdir_p(path)
10
+ end
7
11
  Dir.chdir(dummy_path)
8
12
  system('git init .')
9
13
  system('touch dummy.txt')
10
14
  system('git add .')
11
15
  system('git commit -m"init commit"')
16
+ Dir.chdir(origin_path)
17
+ system('git init . --bare')
18
+ Dir.chdir(dummy_path)
19
+ system("git remote add origin file://#{origin_path}")
20
+ system("git push -u origin master")
12
21
  end
13
22
 
14
23
  end
@@ -2,6 +2,10 @@ module GitMacros
2
2
  def current_branch
3
3
  `git rev-parse --abbrev-ref HEAD`.strip
4
4
  end
5
+
6
+ def remote_branches
7
+ `git branch -r`.strip.split("\n").map(&:strip)
8
+ end
5
9
  end
6
10
 
7
11
  RSpec.configure do |config|
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.6.4
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-08 00:00:00.000000000 Z
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pt
@@ -75,6 +75,22 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: hirb-colors
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
78
94
  - !ruby/object:Gem::Dependency
79
95
  name: rspec
80
96
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +155,22 @@ dependencies:
139
155
  - - ! '>='
140
156
  - !ruby/object:Gem::Version
141
157
  version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: rake
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
142
174
  description: Some extra methods for the pt gem to use in our dev flow.
143
175
  email:
144
176
  - jens@balvig.com
@@ -158,6 +190,7 @@ files:
158
190
  - lib/pt-flow.rb
159
191
  - lib/pt-flow/branch.rb
160
192
  - lib/pt-flow/repo.rb
193
+ - lib/pt-flow/task_row.rb
161
194
  - lib/pt-flow/tasks_table.rb
162
195
  - lib/pt-flow/ui.rb
163
196
  - lib/pt-flow/version.rb
@@ -188,7 +221,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
221
  version: '0'
189
222
  segments:
190
223
  - 0
191
- hash: 1743957255277720657
224
+ hash: 1204691239520265833
192
225
  required_rubygems_version: !ruby/object:Gem::Requirement
193
226
  none: false
194
227
  requirements:
@@ -197,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
230
  version: '0'
198
231
  segments:
199
232
  - 0
200
- hash: 1743957255277720657
233
+ hash: 1204691239520265833
201
234
  requirements: []
202
235
  rubyforge_project:
203
236
  rubygems_version: 1.8.23