jjolma-lighthouse-release-notes 0.1.1 → 0.2.0
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/README.rdoc +16 -8
- data/VERSION +1 -1
- data/lib/lighthouse-release-notes.rb +10 -6
- data/lighthouse-release-notes.gemspec +1 -1
- metadata +1 -1
    
        data/README.rdoc
    CHANGED
    
    | @@ -1,5 +1,7 @@ | |
| 1 1 | 
             
            = lighthouse-release-notes
         | 
| 2 2 |  | 
| 3 | 
            +
            Release note generator for Lighthouse milestones
         | 
| 4 | 
            +
             | 
| 3 5 | 
             
            == Dependencies
         | 
| 4 6 | 
             
              lighthouse-api gem
         | 
| 5 7 |  | 
| @@ -7,18 +9,24 @@ | |
| 7 9 |  | 
| 8 10 | 
             
              require 'rubygems'
         | 
| 9 11 | 
             
              require 'lighthouse-release-notes'
         | 
| 10 | 
            -
              LighthouseReleaseNotes.generate | 
| 12 | 
            +
              LighthouseReleaseNotes.generate(:account => 'myproject,
         | 
| 13 | 
            +
                                              :email => 'jeff@animoto.com',
         | 
| 14 | 
            +
                                              :password => 'secret',
         | 
| 15 | 
            +
                                              :project_id => 1234,          
         | 
| 16 | 
            +
                                              :milestone => '5/7')
         | 
| 11 17 |  | 
| 12 18 | 
             
            == Example output
         | 
| 13 | 
            -
               | 
| 14 | 
            -
             | 
| 15 | 
            -
               | 
| 19 | 
            +
              puts "Release notes for #{5/7}"  
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              Resolved
         | 
| 22 | 
            +
              - Sign in link is misaligned in IE7 [#1001]
         | 
| 23 | 
            +
              - Add "merge accounts" feature [#1002]
         | 
| 16 24 |  | 
| 17 | 
            -
               | 
| 18 | 
            -
              Upload picture broken [#1004]
         | 
| 25 | 
            +
              Open
         | 
| 26 | 
            +
              - Upload picture broken [#1004]
         | 
| 19 27 |  | 
| 20 | 
            -
               | 
| 21 | 
            -
              Can't log in from a Newton [#1003]
         | 
| 28 | 
            +
              Invalid
         | 
| 29 | 
            +
              - Can't log in from a Newton [#1003]
         | 
| 22 30 |  | 
| 23 31 |  | 
| 24 32 | 
             
            == Copyright
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0. | 
| 1 | 
            +
            0.2.0
         | 
| @@ -4,24 +4,28 @@ require 'lighthouse-api' | |
| 4 4 | 
             
            class LighthouseReleaseNotes
         | 
| 5 5 | 
             
              class << self
         | 
| 6 6 | 
             
                def generate(options={})
         | 
| 7 | 
            +
             | 
| 7 8 | 
             
                  Lighthouse.account = options[:account]
         | 
| 8 | 
            -
                  Lighthouse.authenticate | 
| 9 | 
            -
                   | 
| 9 | 
            +
                  Lighthouse.authenticate options[:email], options[:password]
         | 
| 10 | 
            +
                  project = Lighthouse::Project.find options[:project_id]
         | 
| 11 | 
            +
             | 
| 10 12 | 
             
                  tickets = []
         | 
| 11 13 | 
             
                  i = 1
         | 
| 12 14 | 
             
                  while true
         | 
| 13 | 
            -
                    ts =  | 
| 15 | 
            +
                    ts = project.tickets(:q => "milestone:#{options[:milestone]}", :page => i)
         | 
| 14 16 | 
             
                    break if ts.size <= 0
         | 
| 15 17 | 
             
                    tickets << ts
         | 
| 16 18 | 
             
                    i = i + 1
         | 
| 17 19 | 
             
                  end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  puts "Release notes for #{options[:milestone]}"
         | 
| 18 22 | 
             
                  prev_state = nil
         | 
| 19 | 
            -
                  tickets.flatten.sort {|a,b|  | 
| 23 | 
            +
                  tickets.flatten.sort {|a,b| b.state <=> a.state }.each do |f|
         | 
| 20 24 | 
             
                    if f.state != prev_state
         | 
| 21 25 | 
             
                      puts ""
         | 
| 22 | 
            -
                      puts  | 
| 26 | 
            +
                      puts f.state.capitalize
         | 
| 23 27 | 
             
                    end
         | 
| 24 | 
            -
                     | 
| 28 | 
            +
                    puts "- #{f.title} [##{f.number}]"
         | 
| 25 29 | 
             
                    prev_state = f.state
         | 
| 26 30 | 
             
                  end
         | 
| 27 31 | 
             
                  nil
         |