lib/pt/ui.rb in pt-0.6.0 vs lib/pt/ui.rb in pt-0.6.1

- old
+ new

@@ -143,16 +143,18 @@ title("Tasks for #{user_s} in #{project_to_s}") tasks = @client.get_tasks_to_assign(@project, @local_config[:user_name]) table = PT::TasksTable.new(tasks) task = select("Please select a task to assign it an owner", table) end + unless owner members = @client.get_members(@project) table = PT::MembersTable.new(members) owner = select("Please select a member to assign him the task", table).name end result = @client.assign_task(@project, task, owner) + if result.errors.any? error(result.errors.errors) else congrats("Task assigned to #{owner}, thanks!") end @@ -409,11 +411,11 @@ end if @params[0] tasks = @client.get_my_work(@project, @local_config[:user_name]) matched_tasks = tasks.select do |story_task| - task.name.downcase.index(@params[0]) && story_task.current_state != 'delivered' + story_task.name.downcase.index(@params[0]) && story_task.current_state != 'delivered' end matched_tasks.each do |story_task| title("--- [#{(tasks.index story_task) + 1 }] -----------------") show_task(story_task) @@ -437,10 +439,10 @@ def help if ARGV[0] && ARGV[0] != 'help' message("Command #{ARGV[0]} not recognized. Showing help.") end - title("Command line usage") + title("Command line usage for pt #{PT::VERSION}") puts("pt # show all available tasks") puts("pt todo # show all unscheduled tasks") puts("pt started # show all started stories") puts("pt create [title] ~[owner] ~[type] # create a new task") puts("pt show [id] # shows detailed info about a task")