pt 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog.md +4 -0
- data/lib/pt.rb +1 -1
- data/lib/pt/data_table.rb +2 -2
- data/lib/pt/ui.rb +31 -30
- metadata +31 -11
    
        data/Changelog.md
    CHANGED
    
    | @@ -1,5 +1,9 @@ | |
| 1 1 | 
             
            # pt changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ## v0.5.5
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Show the id of tickes by default in tables, adds the url of the task to show and shows more information about attachments ( derwiki )
         | 
| 6 | 
            +
             | 
| 3 7 | 
             
            ## v0.5.4
         | 
| 4 8 |  | 
| 5 9 | 
             
            Fix to pt create, wherein skipping optional parameters wouldn't work as expected, or at all. ( aniccolai )
         | 
    
        data/lib/pt.rb
    CHANGED
    
    
    
        data/lib/pt/data_table.rb
    CHANGED
    
    
    
        data/lib/pt/ui.rb
    CHANGED
    
    | @@ -42,7 +42,7 @@ class PT::UI | |
| 42 42 | 
             
                else
         | 
| 43 43 | 
             
                  members = @client.get_members(@project)
         | 
| 44 44 | 
             
                  table = PT::MembersTable.new(members)
         | 
| 45 | 
            -
                  user = select("Please select a member to see his tasks", table).name
         | 
| 45 | 
            +
                  user = select("Please select a member to see his tasks.", table).name
         | 
| 46 46 | 
             
                  title("Work for #{user} in #{project_to_s}")
         | 
| 47 47 | 
             
                  stories = @client.get_my_work(@project, user)
         | 
| 48 48 | 
             
                  PT::TasksTable.new(stories).print
         | 
| @@ -64,7 +64,7 @@ class PT::UI | |
| 64 64 | 
             
                  if ask('Do you want to assign it now? (y/n)').downcase == 'y'
         | 
| 65 65 | 
             
                    members = @client.get_members(@project)
         | 
| 66 66 | 
             
                    table = PT::MembersTable.new(members)
         | 
| 67 | 
            -
                    owner = select("Please select a member to assign him the task", table).name
         | 
| 67 | 
            +
                    owner = select("Please select a member to assign him the task.", table).name
         | 
| 68 68 | 
             
                  else
         | 
| 69 69 | 
             
                    owner = nil
         | 
| 70 70 | 
             
                  end
         | 
| @@ -80,11 +80,11 @@ class PT::UI | |
| 80 80 | 
             
                else
         | 
| 81 81 | 
             
                  'feature'
         | 
| 82 82 | 
             
                end
         | 
| 83 | 
            -
                result = @client.create_task(@project, name, owner | 
| 83 | 
            +
                result = @client.create_task(@project, name, owner, requester, task_type)
         | 
| 84 84 | 
             
                if result.errors.any?
         | 
| 85 85 | 
             
                  error(result.errors.errors)
         | 
| 86 86 | 
             
                else
         | 
| 87 | 
            -
                  congrats("#{task_type} for #{owner | 
| 87 | 
            +
                  congrats("#{task_type} for #{owner} created: #{result.url}")
         | 
| 88 88 | 
             
                end
         | 
| 89 89 | 
             
              end
         | 
| 90 90 |  | 
| @@ -267,7 +267,7 @@ class PT::UI | |
| 267 267 | 
             
                if @params[1]
         | 
| 268 268 | 
             
                  comment = @params[1]
         | 
| 269 269 | 
             
                else
         | 
| 270 | 
            -
                  comment = ask("Please explain why are you rejecting the task")
         | 
| 270 | 
            +
                  comment = ask("Please explain why are you rejecting the task.")
         | 
| 271 271 | 
             
                end
         | 
| 272 272 |  | 
| 273 273 | 
             
                if @client.comment_task(@project, task, comment)
         | 
| @@ -383,36 +383,36 @@ class PT::UI | |
| 383 383 |  | 
| 384 384 |  | 
| 385 385 | 
             
              def help 
         | 
| 386 | 
            -
                if ARGV[0]
         | 
| 386 | 
            +
                if ARGV[0] && ARGV[0] != 'help'
         | 
| 387 387 | 
             
                  message("Command #{ARGV[0]} not recognized. Showing help.")
         | 
| 388 388 | 
             
                end
         | 
| 389 389 |  | 
| 390 390 | 
             
                title("Command line usage")
         | 
| 391 | 
            -
                 | 
| 392 | 
            -
                 | 
| 393 | 
            -
                 | 
| 394 | 
            -
                 | 
| 395 | 
            -
                 | 
| 396 | 
            -
                 | 
| 397 | 
            -
                 | 
| 398 | 
            -
                 | 
| 399 | 
            -
                 | 
| 400 | 
            -
                 | 
| 401 | 
            -
                 | 
| 402 | 
            -
                 | 
| 403 | 
            -
                 | 
| 404 | 
            -
                 | 
| 405 | 
            -
                 | 
| 406 | 
            -
                 | 
| 407 | 
            -
                 | 
| 408 | 
            -
                 | 
| 409 | 
            -
                 | 
| 391 | 
            +
                puts("pt                                     # show all available tasks")
         | 
| 392 | 
            +
                puts("pt todo                                # show all unscheduled tasks")
         | 
| 393 | 
            +
                puts("pt create    [title] ~[owner] ~[type]  # create a new task")
         | 
| 394 | 
            +
                puts("pt show      [id]                      # shows detailed info about a task")
         | 
| 395 | 
            +
                puts("pt open      [id]                      # open a task in the browser")
         | 
| 396 | 
            +
                puts("pt assign    [id] [member]             # assign owner")
         | 
| 397 | 
            +
                puts("pt comment   [id] [comment]            # add a comment")
         | 
| 398 | 
            +
                puts("pt estimate  [id] [0-3]                # estimate a task in points scale")
         | 
| 399 | 
            +
                puts("pt start     [id]                      # mark a task as started")
         | 
| 400 | 
            +
                puts("pt finish    [id]                      # indicate you've finished a task")
         | 
| 401 | 
            +
                puts("pt deliver   [id]                      # indicate the task is delivered");
         | 
| 402 | 
            +
                puts("pt accept    [id]                      # mark a task as accepted")
         | 
| 403 | 
            +
                puts("pt reject    [id] [reason]             # mark a task as rejected, explaining why")
         | 
| 404 | 
            +
                puts("pt find      [query]                   # looks in your tasks by title and presents it")
         | 
| 405 | 
            +
                puts("pt done      [id] ~[0-3] ~[comment]    # lazy mans finish task, does everything")
         | 
| 406 | 
            +
                puts("pt list      [member]                  # list all tasks for another pt user")
         | 
| 407 | 
            +
                puts("pt updates   [number]                  # shows number recent activity from your current project")
         | 
| 408 | 
            +
                puts("")
         | 
| 409 | 
            +
                puts("All commands can be ran without arguments for a wizard like UI.")
         | 
| 410 410 | 
             
              end
         | 
| 411 411 |  | 
| 412 412 | 
             
              protected
         | 
| 413 413 |  | 
| 414 414 | 
             
              def commands
         | 
| 415 | 
            -
                (public_methods - Object.public_methods).sort.map{ |c| c.to_sym}
         | 
| 415 | 
            +
                (public_methods - Object.public_methods + [:help]).sort.map{ |c| c.to_sym}
         | 
| 416 416 | 
             
              end
         | 
| 417 417 |  | 
| 418 418 | 
             
              # Config
         | 
| @@ -420,7 +420,7 @@ class PT::UI | |
| 420 420 | 
             
              def load_global_config
         | 
| 421 421 | 
             
                config = YAML.load(File.read(GLOBAL_CONFIG_PATH)) rescue {}
         | 
| 422 422 | 
             
                if config.empty?
         | 
| 423 | 
            -
                  message "I can't find info about your Pivotal Tracker account in #{GLOBAL_CONFIG_PATH}"
         | 
| 423 | 
            +
                  message "I can't find info about your Pivotal Tracker account in #{GLOBAL_CONFIG_PATH}."
         | 
| 424 424 | 
             
                  while !config[:api_number] do
         | 
| 425 425 | 
             
                    config[:email] = ask "What is your email?"
         | 
| 426 426 | 
             
                    password = ask_secret "And your password? (won't be displayed on screen)"
         | 
| @@ -432,7 +432,7 @@ class PT::UI | |
| 432 432 | 
             
                  end
         | 
| 433 433 | 
             
                  congrats "Thanks!",
         | 
| 434 434 | 
             
                           "Your API id is " + config[:api_number],
         | 
| 435 | 
            -
                           "I'm saving it in #{GLOBAL_CONFIG_PATH}  | 
| 435 | 
            +
                           "I'm saving it in #{GLOBAL_CONFIG_PATH} so you don't have to log in again."
         | 
| 436 436 | 
             
                  save_config(config, GLOBAL_CONFIG_PATH)
         | 
| 437 437 | 
             
                end
         | 
| 438 438 | 
             
                config
         | 
| @@ -571,10 +571,11 @@ class PT::UI | |
| 571 571 | 
             
                title task.name
         | 
| 572 572 | 
             
                estimation = [-1, nil].include?(task.estimate) ? "Unestimated" : "#{task.estimate} points"
         | 
| 573 573 | 
             
                message "#{task.current_state.capitalize} #{task.story_type} | #{estimation} | Req: #{task.requested_by} | Owns: #{task.owned_by} | Id: #{task.id}"
         | 
| 574 | 
            -
                message task.description unless task.description.empty?
         | 
| 574 | 
            +
                message task.description unless task.description.nil? || task.description.empty?
         | 
| 575 575 | 
             
                task.tasks.all.each{ |t| message "- #{t.complete ? "(done) " : "(pend)"} #{t.description}" }
         | 
| 576 576 | 
             
                task.notes.all.each{ |n| message "#{n.author}: \"#{n.text}\"" }
         | 
| 577 | 
            -
                task.attachments.each{ |a| message "#{a.uploaded_by} uploaded: \"#{a.description.empty? ? "#{a.filename}" : "#{a.description} (#{a.filename})" }\" #{a.url}" }
         | 
| 577 | 
            +
                task.attachments.each{ |a| message "#{a.uploaded_by} uploaded: \"#{a.description && a.description.empty? ? "#{a.filename}" : "#{a.description} (#{a.filename})" }\" #{a.url}" }
         | 
| 578 | 
            +
                puts task.url
         | 
| 578 579 | 
             
              end
         | 
| 579 580 |  | 
| 580 581 | 
             
              def show_activity(activity, tasks)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pt
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.5
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -10,11 +10,11 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2012- | 
| 13 | 
            +
            date: 2012-08-01 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: pivotal-tracker
         | 
| 17 | 
            -
              requirement:  | 
| 17 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 18 18 | 
             
                none: false
         | 
| 19 19 | 
             
                requirements:
         | 
| 20 20 | 
             
                - - ! '>='
         | 
| @@ -22,10 +22,15 @@ dependencies: | |
| 22 22 | 
             
                    version: 0.4.1
         | 
| 23 23 | 
             
              type: :runtime
         | 
| 24 24 | 
             
              prerelease: false
         | 
| 25 | 
            -
              version_requirements:  | 
| 25 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 26 | 
            +
                none: false
         | 
| 27 | 
            +
                requirements:
         | 
| 28 | 
            +
                - - ! '>='
         | 
| 29 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 30 | 
            +
                    version: 0.4.1
         | 
| 26 31 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 27 32 | 
             
              name: hirb
         | 
| 28 | 
            -
              requirement:  | 
| 33 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 29 34 | 
             
                none: false
         | 
| 30 35 | 
             
                requirements:
         | 
| 31 36 | 
             
                - - ! '>='
         | 
| @@ -33,10 +38,15 @@ dependencies: | |
| 33 38 | 
             
                    version: 0.4.5
         | 
| 34 39 | 
             
              type: :runtime
         | 
| 35 40 | 
             
              prerelease: false
         | 
| 36 | 
            -
              version_requirements:  | 
| 41 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 42 | 
            +
                none: false
         | 
| 43 | 
            +
                requirements:
         | 
| 44 | 
            +
                - - ! '>='
         | 
| 45 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 46 | 
            +
                    version: 0.4.5
         | 
| 37 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 38 48 | 
             
              name: colored
         | 
| 39 | 
            -
              requirement:  | 
| 49 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 40 50 | 
             
                none: false
         | 
| 41 51 | 
             
                requirements:
         | 
| 42 52 | 
             
                - - ! '>='
         | 
| @@ -44,10 +54,15 @@ dependencies: | |
| 44 54 | 
             
                    version: '1.2'
         | 
| 45 55 | 
             
              type: :runtime
         | 
| 46 56 | 
             
              prerelease: false
         | 
| 47 | 
            -
              version_requirements:  | 
| 57 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                none: false
         | 
| 59 | 
            +
                requirements:
         | 
| 60 | 
            +
                - - ! '>='
         | 
| 61 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 62 | 
            +
                    version: '1.2'
         | 
| 48 63 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 49 64 | 
             
              name: highline
         | 
| 50 | 
            -
              requirement:  | 
| 65 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 51 66 | 
             
                none: false
         | 
| 52 67 | 
             
                requirements:
         | 
| 53 68 | 
             
                - - ! '>='
         | 
| @@ -55,7 +70,12 @@ dependencies: | |
| 55 70 | 
             
                    version: 1.6.1
         | 
| 56 71 | 
             
              type: :runtime
         | 
| 57 72 | 
             
              prerelease: false
         | 
| 58 | 
            -
              version_requirements:  | 
| 73 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 74 | 
            +
                none: false
         | 
| 75 | 
            +
                requirements:
         | 
| 76 | 
            +
                - - ! '>='
         | 
| 77 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 78 | 
            +
                    version: 1.6.1
         | 
| 59 79 | 
             
            description: Minimalist, opinionated client to manage your Pivotal Tracker tasks from
         | 
| 60 80 | 
             
              the command line.
         | 
| 61 81 | 
             
            email:
         | 
| @@ -98,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 98 118 | 
             
                  version: '0'
         | 
| 99 119 | 
             
            requirements: []
         | 
| 100 120 | 
             
            rubyforge_project: pt
         | 
| 101 | 
            -
            rubygems_version: 1.8. | 
| 121 | 
            +
            rubygems_version: 1.8.24
         | 
| 102 122 | 
             
            signing_key: 
         | 
| 103 123 | 
             
            specification_version: 3
         | 
| 104 124 | 
             
            summary: Client to use Pivotal Tracker from the console.
         |