pt-flow 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pt-flow/ui.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  class PT::Flow::UI < PT::UI
2
2
 
3
+ def my_work #default command
4
+ help
5
+ end
6
+
3
7
  def start
4
8
  tasks = @client.get_work(@project)
5
9
  table = PT::TasksTable.new(tasks)
@@ -10,12 +14,11 @@ class PT::Flow::UI < PT::UI
10
14
  task = select("Please select a task to start working on", table)
11
15
  end
12
16
 
13
- result = @client.assign_task(@project, task, owner)
17
+ result = @client.assign_task(@project, task, @local_config[:user_name])
14
18
  if result.errors.any?
15
19
  error(result.errors.errors)
16
20
  else
17
21
  start_task(task)
18
- congrats("Task assigned to #{owner}, checking out new branch!")
19
22
  `git checkout -B #{task.id}`
20
23
  end
21
24
  end
@@ -39,6 +42,17 @@ class PT::Flow::UI < PT::UI
39
42
  deliver_task(task)
40
43
  end
41
44
 
45
+ def help
46
+ if ARGV[0] && ARGV[0] != 'help'
47
+ message("Command #{ARGV[0]} not recognized. Showing help.")
48
+ end
49
+
50
+ title("Command line usage")
51
+ puts("flow start # start working on a story")
52
+ puts("flow finish # finish a story and create a pull request")
53
+ puts("flow deliver # merge current story branch and clean up")
54
+ end
55
+
42
56
  private
43
57
 
44
58
  def github_page_url
@@ -50,8 +64,4 @@ class PT::Flow::UI < PT::UI
50
64
  def current_branch
51
65
  @current_branch ||= `git rev-parse --abbrev-ref HEAD`.strip
52
66
  end
53
-
54
- def owner
55
- @local_config[:user_name]
56
- end
57
67
  end
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  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.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  segments:
61
61
  - 0
62
- hash: 2763872611259201268
62
+ hash: 3502779640242885259
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: 2763872611259201268
71
+ hash: 3502779640242885259
72
72
  requirements: []
73
73
  rubyforge_project:
74
74
  rubygems_version: 1.8.23