lib/pt-flow/ui.rb in pt-flow-0.0.5 vs lib/pt-flow/ui.rb in pt-flow-0.1.0

- old
+ new

@@ -1,19 +1,8 @@ class PT::Flow::UI < PT::UI - def setup - `git-tracker install` - message 'git-tracker ready to add story numbers to commits' - congrats 'All done!' - end - - def list - @params[0] ||= 'all' - super - end - - def checkout + def start tasks = @client.get_work(@project) table = PT::TasksTable.new(tasks) if @params[0] task = table[@params[0].to_i] else @@ -23,22 +12,24 @@ result = @client.assign_task(@project, task, owner) if result.errors.any? error(result.errors.errors) else + start_task(task) congrats("Task assigned to #{owner}, checking out new branch!") + `git checkout -B #{task.id}` end - - `git checkout -B #{task.id}` end - def request + def finish `git push origin #{current_branch}` task = PivotalTracker::Story.find(current_branch, @project.id) - `open '#{github_page_url}/pull/new/#{current_branch}?title=#{task.name} [##{task.id}]&body=#{task.url}'` + finish_task(task) + pull_request_url = "#{github_page_url}/pull/new/#{current_branch}?title=#{task.name} [##{task.id}]&body=#{task.url}" + `open '#{pull_request_url}'` end - def merge + def deliver branch = @params[0] || current_branch `git checkout master` `git merge #{branch}` `git push origin master` `git push origin :#{branch}`