lib/pt/ui.rb in pt-0.5.2 vs lib/pt/ui.rb in pt-0.5.4

- old
+ new

@@ -23,10 +23,17 @@ title("My Work for #{user_s} in #{project_to_s}") stories = @client.get_my_work(@project, @local_config[:user_name]) PT::TasksTable.new(stories).print end + def todo + title("My Work for #{user_s} in #{project_to_s}") + stories = @client.get_my_work(@project, @local_config[:user_name]) + stories = stories.select { |story| story.current_state == "unscheduled" } + PT::TasksTable.new(stories).print + end + def list if @params[0] user = find_owner @params[0] if user stories = @client.get_my_work(@project, user.name) @@ -75,11 +82,11 @@ end result = @client.create_task(@project, name, owner.name, requester, task_type) if result.errors.any? error(result.errors.errors) else - congrats("Task created, yay!") + congrats("#{task_type} for #{owner.name} created, cool.") end end def open if @params[0] @@ -380,10 +387,11 @@ message("Command #{ARGV[0]} not recognized. Showing help.") end title("Command line usage") message("pt # show all available tasks") + message("pt todo # show all unscheduled tasks") message("pt create [title] ~[owner] ~[type] # create a new task") message("pt show [id] # shows detailed info about a task") message("pt open [id] # open a task in the browser") message("pt assign [id] [member] # assign owner") message("pt comment [id] [comment] # add a comment") @@ -547,13 +555,13 @@ end def find_owner query members = @client.get_members(@project) members.each do | member | - if member.name.downcase.index query + if member.name.downcase.index query.to_s return member end - if member.initials.downcase.index query + if member.initials.downcase.index query.to_s return member end end nil end