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.
@@ -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 :account => 'myproject, :email => 'jeff@animoto.com', :password => 'secret', :milestone => '5/7'
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
- State: resolved
14
- Sign in link is misaligned in IE7 [#1001]
15
- Add "merge accounts" featur [#1002]
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
- State: open
18
- Upload picture broken [#1004]
25
+ Open
26
+ - Upload picture broken [#1004]
19
27
 
20
- State: invalid
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.1
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(options[:email], options[:password])
9
- web2 = Lighthouse::Project.find(7135)
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 = web2.tickets(:q => "milestone:#{options[:milestone]}", :page => i)
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| a.state <=> b.state }.each do |f|
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 "State: #{f.state}"
26
+ puts f.state.capitalize
23
27
  end
24
- print f.title; print ' [#'; print f.number; print ']'; puts ''
28
+ puts "- #{f.title} [##{f.number}]"
25
29
  prev_state = f.state
26
30
  end
27
31
  nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{lighthouse-release-notes}
5
- s.version = "0.1.1"
5
+ s.version = "0.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeff Jolma"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jjolma-lighthouse-release-notes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Jolma