vclog 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/HISTORY.rdoc +16 -0
  2. data/PROFILE +5 -5
  3. data/README.rdoc +11 -1
  4. data/REQUIRE +1 -0
  5. data/ROADMAP.rdoc +6 -2
  6. data/VERSION +1 -1
  7. data/features/git.feature +86 -0
  8. data/features/hg.feature +86 -0
  9. data/features/step_definitions/repo_steps.rb +71 -0
  10. data/features/support/aruba.rb +1 -0
  11. data/features/support/repo.rb +15 -0
  12. data/features/svn.feature +86 -0
  13. data/lib/plugins/syckle/vclog.rb +54 -55
  14. data/lib/vclog/{vcs.rb → adapters/abstract.rb} +39 -21
  15. data/lib/vclog/adapters/darcs.rb +83 -0
  16. data/lib/vclog/adapters/git.rb +83 -0
  17. data/lib/vclog/adapters/hg.rb +82 -0
  18. data/lib/vclog/adapters/svn.rb +139 -0
  19. data/lib/vclog/adapters.rb +29 -0
  20. data/lib/vclog/change.rb +38 -13
  21. data/lib/vclog/changelog.rb +23 -3
  22. data/lib/vclog/cli.rb +43 -50
  23. data/lib/vclog/formatter.rb +105 -0
  24. data/lib/vclog/history.rb +33 -17
  25. data/lib/vclog/metadata.rb +13 -0
  26. data/lib/vclog/release.rb +14 -3
  27. data/lib/vclog/tag.rb +17 -9
  28. data/lib/vclog/templates/changelog.atom +26 -0
  29. data/lib/vclog/templates/changelog.gnu +2 -2
  30. data/lib/vclog/templates/changelog.html +3 -3
  31. data/lib/vclog/templates/changelog.json +1 -0
  32. data/lib/vclog/templates/changelog.markdown +2 -2
  33. data/lib/vclog/templates/changelog.rdoc +2 -2
  34. data/lib/vclog/templates/changelog.xml +3 -3
  35. data/lib/vclog/templates/changelog.yaml +1 -0
  36. data/lib/vclog/templates/history.atom +46 -0
  37. data/lib/vclog/templates/history.gnu +12 -0
  38. data/lib/vclog/templates/history.html +5 -5
  39. data/lib/vclog/templates/history.json +1 -0
  40. data/lib/vclog/templates/history.markdown +4 -4
  41. data/lib/vclog/templates/history.rdoc +4 -4
  42. data/lib/vclog/templates/history.xml +5 -4
  43. data/lib/vclog/templates/history.yaml +1 -0
  44. data/lib/vclog.rb +1 -1
  45. metadata +27 -27
  46. data/features/history.feature +0 -16
  47. data/lib/vclog/vcs/darcs.rb +0 -83
  48. data/lib/vclog/vcs/git.rb +0 -83
  49. data/lib/vclog/vcs/hg.rb +0 -0
  50. data/lib/vclog/vcs/svn.rb +0 -116
  51. data/meta/authors +0 -1
  52. data/meta/contact +0 -1
  53. data/meta/created +0 -1
  54. data/meta/description +0 -1
  55. data/meta/homepage +0 -1
  56. data/meta/license +0 -1
  57. data/meta/name +0 -1
  58. data/meta/repository +0 -1
  59. data/meta/requires +0 -1
  60. data/meta/ruby +0 -2
  61. data/meta/sitemap +0 -1
  62. data/meta/suite +0 -1
  63. data/meta/summary +0 -1
  64. data/meta/title +0 -1
  65. data/meta/version +0 -1
data/lib/vclog/cli.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module VCLog
2
2
 
3
- require 'vclog/vcs'
3
+ require 'vclog/adapters'
4
4
  require 'optparse'
5
5
 
6
6
  # = vclog Command
@@ -59,7 +59,7 @@ module VCLog
59
59
 
60
60
  optparse = OptionParser.new do |opt|
61
61
 
62
- opt.banner = "Usage: vclog [--TYPE] [--FORMAT] [OPTIONS] [DIR]"
62
+ opt.banner = "Usage: vclog [--TYPE] [-f FORMAT] [OPTIONS] [DIR]"
63
63
 
64
64
  opt.separator(" ")
65
65
  opt.separator("OUTPUT TYPE (choose one):")
@@ -72,46 +72,27 @@ module VCLog
72
72
  type = :rel
73
73
  end
74
74
 
75
- opt.on('--bump', '-b', "display a bumped version number") do
76
- type = :bump
77
- end
78
-
79
75
  opt.on('--current', '-c', "display current version number") do
80
76
  type = :curr
81
77
  end
82
78
 
83
- opt.separator(" ")
84
- opt.separator("FORMAT (choose one):")
85
-
86
- opt.on('--gnu', "GNU standard format (default)") do
87
- format = :gnu
88
- end
89
-
90
- opt.on('--xml', "XML format") do
91
- format = :xml
92
- end
93
-
94
- opt.on('--yaml', "YAML format") do
95
- format = :yaml
96
- end
97
-
98
- opt.on('--json', "JSON format") do
99
- format = :json
79
+ opt.on('--bump', '-b', "display a bumped version number") do
80
+ type = :bump
100
81
  end
101
82
 
102
- opt.on('--html', "HTML micro-like format") do
103
- format = :html
83
+ opt.on('--formats', '-F', "list supported formats") do
84
+ puts "gnu rdoc markdown xml html atom rss json yaml"
85
+ exit
104
86
  end
105
87
 
106
- opt.on('--rdoc', "RDoc format") do
107
- format = :rdoc
108
- end
88
+ opt.separator(" ")
89
+ opt.separator("FORMAT OPTION:")
109
90
 
110
- opt.on('--markdown', '-m', "Markdown format") do
111
- format = :markdown
91
+ opt.on('--format', '-f <FORMAT>', "Output format") do |format|
92
+ format = format.to_sym
112
93
  end
113
94
 
114
- opt.separator(" ")
95
+ opt.separator(" ")
115
96
  opt.separator("OTHER OPTIONS:")
116
97
 
117
98
  #opt.on('--typed', "catagorize by commit type") do
@@ -160,7 +141,7 @@ module VCLog
160
141
 
161
142
  root = ARGV.shift || Dir.pwd
162
143
 
163
- vcs = VCLog::VCS.factory #(root)
144
+ vcs = VCLog::Adapters.factory #(root)
164
145
 
165
146
  case type
166
147
  when :bump
@@ -174,32 +155,44 @@ module VCLog
174
155
  end
175
156
  exit
176
157
  when :log
177
- log = vcs.changelog
158
+ doctype = :changelog
159
+ #log = vcs.changelog
178
160
  #log = log.typed if typed #TODO: ability to select types?
179
161
  when :rel
180
- log = vcs.history(:title=>title, :extra=>extra, :version=>version)
162
+ doctype = :history
163
+ #log = vcs.history(:title=>title, :extra=>extra, :version=>version)
181
164
  else
182
165
  raise "huh?"
183
166
  #log = vcs.changelog
184
167
  #log = log.typed if typed #TODO: ability to select types?
185
168
  end
186
169
 
187
- case format
188
- when :xml
189
- txt = log.to_xml(style) # xsl stylesheet url
190
- when :html
191
- txt = log.to_html(style) # css stylesheet url
192
- when :yaml
193
- txt = log.to_yaml
194
- when :json
195
- txt = log.to_json
196
- when :markdown
197
- txt = log.to_markdown(rev)
198
- when :rdoc
199
- txt = log.to_rdoc(rev)
200
- else #:gnu
201
- txt = log.to_gnu(rev)
202
- end
170
+ options = {
171
+ :title => title,
172
+ :extra => extra,
173
+ :version => version,
174
+ :revision => rev,
175
+ :stylesheet => style
176
+ }
177
+
178
+ txt = vcs.display(doctype, format, options)
179
+
180
+ #case format
181
+ #when :xml
182
+ # txt = log.to_xml(style) # xsl stylesheet url
183
+ #when :html
184
+ # txt = log.to_html(style) # css stylesheet url
185
+ #when :yaml
186
+ # txt = log.to_yaml
187
+ #when :json
188
+ # txt = log.to_json
189
+ #when :markdown
190
+ # txt = log.to_markdown(rev)
191
+ #when :rdoc
192
+ # txt = log.to_rdoc(rev)
193
+ #else #:gnu
194
+ # txt = log.to_gnu(rev)
195
+ #end
203
196
 
204
197
  if output
205
198
  File.open(output, 'w') do |f|
@@ -0,0 +1,105 @@
1
+ require 'ostruct'
2
+
3
+ module VCLog
4
+
5
+ #
6
+ class Formatter
7
+
8
+ DIR = File.dirname(__FILE__)
9
+
10
+ #
11
+ attr :vcs
12
+
13
+ #
14
+ def initialize(vcs)
15
+ @vcs = vcs
16
+ end
17
+
18
+ #
19
+ def changelog
20
+ @vcs.changelog
21
+ end
22
+
23
+ #
24
+ def history
25
+ @vcs.history
26
+ end
27
+
28
+ #
29
+ def user
30
+ @options.user || @vcs.user
31
+ end
32
+
33
+ #
34
+ def email
35
+ @options.email || @vcs.user
36
+ end
37
+
38
+ #
39
+ def repository
40
+ @vcs.repository
41
+ end
42
+
43
+ # TODO
44
+ def url
45
+ @options.url || '/'
46
+ end
47
+
48
+ # TODO
49
+ def homepage
50
+ @options.homepage
51
+ end
52
+
53
+ #
54
+ def title
55
+ return @options.title if @options.title
56
+ case @doctype
57
+ when :history
58
+ "Release History"
59
+ else
60
+ "Change Log"
61
+ end
62
+ end
63
+
64
+ #
65
+ def display(doctype, format, options={})
66
+ options = OpenStruct.new(options)
67
+
68
+ @doctype = doctype
69
+ @format = format
70
+ @options = options
71
+
72
+ require_formatter(format)
73
+
74
+ tmp = File.read(File.join(DIR, 'templates', "#{@doctype}.#{@format}"))
75
+ erb = ERB.new(tmp)
76
+ erb.result(binding)
77
+ end
78
+
79
+ private
80
+
81
+ #
82
+ def require_formatter(format)
83
+ case format.to_s
84
+ when 'yaml'
85
+ require 'yaml'
86
+ when 'json'
87
+ require 'json'
88
+ end
89
+ end
90
+
91
+ #
92
+ def h(input)
93
+ result = input.to_s.dup
94
+ result.gsub!("&", "&amp;")
95
+ result.gsub!("<", "&lt;")
96
+ result.gsub!(">", "&gt;")
97
+ result.gsub!("'", "&apos;")
98
+ #result.gsub!("@", "&at;")
99
+ result.gsub!("\"", "&quot;")
100
+ return result
101
+ end
102
+
103
+ end
104
+
105
+ end
data/lib/vclog/history.rb CHANGED
@@ -73,10 +73,10 @@ module VCLog
73
73
  tags = self.tags
74
74
 
75
75
  ver = vcs.bump(version)
76
+ user = vcs.user
76
77
  time = ::Time.now
77
- user = ENV['USER'] # TODO: get user name from vcs
78
78
 
79
- tags << Tag.new(ver, time, user, "Current Development")
79
+ tags << Tag.new(ver, 'current', time, user, "Current Development")
80
80
 
81
81
  # TODO: Do we need to add a Time.now tag?
82
82
  # add current verion to release list (if given)
@@ -92,27 +92,30 @@ module VCLog
92
92
  tags = tags.sort{ |a,b| b.date <=> a.date }
93
93
 
94
94
  # organize into deltas
95
- deltas, last = [], nil
96
- tags.each do |tag|
97
- deltas << [last, tag]
98
- last = tag
95
+ delta = {}
96
+ last = nil
97
+ tags.sort.each do |tag|
98
+ delta[tag] = [last, tag.date]
99
+ last = tag.date
99
100
  end
100
101
 
101
102
  # gather changes for each delta and build log
102
- deltas.each do |gt, lt|
103
- if gt
104
- gt_vers, gt_date = gt.name, gt.date
105
- lt_vers, lt_date = lt.name, lt.date
103
+ delta.each do |tag, (ended, started)|
104
+ if ended
105
+ set = changes.select{ |c| c.date < ended && c.date > started }
106
+ #gt_vers, gt_date = gt.name, gt.date
107
+ #lt_vers, lt_date = lt.name, lt.date
106
108
  #gt_date = Time.parse(gt_date) unless Time===gt_date
107
109
  #lt_date = Time.parse(lt_date) unless Time===lt_date
108
- log = changelog.after(gt_date).before(lt_date)
110
+ #log = changelog.after(gt).before(lt)
109
111
  else
110
- lt_vers, lt_date = lt.name, lt.date
112
+ #lt_vers, lt_date = lt.name, lt.date
111
113
  #lt_date = Time.parse(lt_date) unless Time===lt_date
112
- log = changelog.before(lt_date)
114
+ #log = changelog.before(lt_date)
115
+ set = changes.select{ |c| c.date > started }
113
116
  end
114
117
 
115
- rel << Release.new(lt, log.changes)
118
+ rel << Release.new(tag, set)
116
119
  end
117
120
  rel
118
121
  )
@@ -124,12 +127,20 @@ module VCLog
124
127
  @groups ||= changes.group_by{ |e| e.type_number }
125
128
  end
126
129
 
130
+ #
131
+ def to_h
132
+ releases.map{ |rel| rel.to_h }
133
+ end
134
+
135
+
136
+
127
137
  # Same as to_gnu.
128
138
 
129
- def to_s(rev=false)
130
- to_gnu(rev)
131
- end
139
+ #def to_s(rev=false)
140
+ # to_gnu(rev)
141
+ #end
132
142
 
143
+ =begin
133
144
  # TODO: What would GNU history look like?
134
145
 
135
146
  def to_gnu(rev=false)
@@ -149,7 +160,9 @@ module VCLog
149
160
  require 'json'
150
161
  releases.to_json
151
162
  end
163
+ =end
152
164
 
165
+ =begin
153
166
  # Translate history into a XML document.
154
167
 
155
168
  def to_xml(xsl=nil)
@@ -181,6 +194,7 @@ module VCLog
181
194
  erb = ERB.new(tmp)
182
195
  erb.result(binding)
183
196
  end
197
+ =end
184
198
 
185
199
  =begin
186
200
  #
@@ -261,6 +275,7 @@ module VCLog
261
275
  end
262
276
  =end
263
277
 
278
+ =begin
264
279
  private
265
280
 
266
281
  #
@@ -274,6 +289,7 @@ module VCLog
274
289
  result.gsub!("\"", "&quot;")
275
290
  return result
276
291
  end
292
+ =end
277
293
 
278
294
  end
279
295
 
@@ -0,0 +1,13 @@
1
+ module VCLog
2
+
3
+ class Metadata
4
+
5
+ def initialize
6
+ if file = Dir['PROFILE{,.yml}'].first
7
+ @profile = YAML.load(File.new(file))
8
+ end
9
+ end
10
+
11
+ end
12
+
13
+ end
data/lib/vclog/release.rb CHANGED
@@ -11,13 +11,24 @@ module VCLog
11
11
  end
12
12
 
13
13
  def to_h
14
- { :tag => tag.to_h, :changes => changes }
14
+ { 'version' => tag.name,
15
+ 'date' => tag.date,
16
+ 'message' => tag.message,
17
+ 'author' => tag.author,
18
+ 'revision' => tag.revision,
19
+ 'changes' => changes.map{|change| change.to_h}
20
+ }
15
21
  end
16
22
 
17
- def to_json
18
- to_h.to_json
23
+ # Group +changes+ by tag type.
24
+ def groups
25
+ @groups ||= changes.group_by{ |e| e.type_number }
19
26
  end
20
27
 
28
+ #def to_json
29
+ # to_h.to_json
30
+ #end
31
+
21
32
  def <=>(other)
22
33
  @tag <=> other.tag
23
34
  end
data/lib/vclog/tag.rb CHANGED
@@ -1,21 +1,24 @@
1
1
  module VCLog
2
2
 
3
3
  class Tag
4
+ attr_accessor :revision
4
5
  attr_accessor :name
5
6
  attr_accessor :date
6
7
  attr_accessor :author
7
8
  attr_accessor :message
8
9
 
9
- def initialize(name, date, author, message)
10
- self.name = name
11
- self.date = date
12
- self.author = author
13
- self.message = message
10
+ def initialize(name, rev, date, author, message)
11
+ self.revision = rev
12
+ self.name = name
13
+ self.date = date
14
+ self.author = author
15
+ self.message = message
14
16
  end
15
17
 
16
18
  def name=(name)
17
19
  @name = name.strip
18
20
  end
21
+ alias_method :label, :name
19
22
 
20
23
  def author=(author)
21
24
  @author = author.strip
@@ -43,13 +46,18 @@ module VCLog
43
46
 
44
47
  def to_h
45
48
  {
46
- :name => name,
47
- :date => date,
48
- :author => author,
49
- :message => message
49
+ 'name' => name,
50
+ 'date' => date,
51
+ 'author' => author,
52
+ 'message' => message
50
53
  }
51
54
  end
52
55
 
56
+ #
57
+ def inspect
58
+ "<Tag #{name} #{date.strftime('%Y-%m-%d %H:%M:%S')}>"
59
+ end
60
+
53
61
  # Normal tag order is the reverse typical sorts.
54
62
  def <=>(other)
55
63
  other.name <=> name
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <feed xmlns="http://www.w3.org/2005/Atom">
4
+
5
+ <title><%= title %> Feed</title>
6
+ <% if url %><link href="<%= url %>" rel="self" /><% end %>
7
+ <% if homepage %><link href="<%= homepage %>" /><% end %>
8
+ <id><% if vcs.uuid %>urn:uuid:<%= vcs.uuid %><% else %><%= vcs.repository %><% end %></id>
9
+ <updated><%= Time.now %></updated>
10
+ <author>
11
+ <name><%= user %></name>
12
+ <email><%= email %></email>
13
+ </author>
14
+
15
+ <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
16
+ <entry>
17
+ <title><%= h entry.message.lines.first %></title>
18
+ <id><%= entry.revision %></id>
19
+ <author><%= entry.author %></author>
20
+ <updated><%= entry.date %></updated>
21
+ <summary type="html"><%= h entry.message %></summary>
22
+ </entry>
23
+ <% end %>
24
+
25
+ </feed>
26
+
@@ -1,6 +1,6 @@
1
- <% by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
1
+ <% changelog.by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
2
2
  <%= date %> <%= author %>
3
3
  <% author_changes.each do |entry| %>
4
- * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if rev %>(#<%= entry.revision %>)<% end %><% end %>
4
+ * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if options.revision %>(#<%= entry.revision %>)<% end %><% end %>
5
5
  <% end %>
6
6
  <% end %>
@@ -13,13 +13,13 @@
13
13
  .message{padding: 5 0; font-weight: bold;}
14
14
  .revision{font-size: 0.8em;}
15
15
  </style>
16
- <% if css %>
17
- <link rel="stylesheet" href="#{css}" type="text/css">
16
+ <% if options.stylesheet %>
17
+ <link rel="stylesheet" href="#{options.stylesheet}" type="text/css">
18
18
  <% end %>
19
19
  </head>
20
20
  <body>
21
21
  <div class="changelog">
22
- <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
22
+ <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
23
23
  <div class="commit">
24
24
  <div class="revision">#<%= h entry.revision %></div>
25
25
  <div class="date"><%= entry.date %></div>
@@ -0,0 +1 @@
1
+ <%= changelog.to_h.to_json %>
@@ -1,6 +1,6 @@
1
1
  # <%= title %>
2
- <% by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
2
+ <% changelog.by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
3
3
  ## <%= date %> <%= author %>
4
4
  <% author_changes.each do |entry| %>
5
- * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if rev %>(#<%= entry.revision %>)<% end %><% end %>
5
+ * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if options.revision %>(#<%= entry.revision %>)<% end %><% end %>
6
6
  <% end %><% end %>
@@ -1,6 +1,6 @@
1
1
  = <%= title %>
2
- <% by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
2
+ <% changelog.by_date.each do |date, date_changes| %><% date_changes.by_author.each do |author, author_changes| %>
3
3
  == <%= date %> <%= author %>
4
4
  <% author_changes.each do |entry| %>
5
- * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if rev %>(#<%= entry.revision %>)<% end %><% end %>
5
+ * <%= entry.message %> <% if entry.type %><<%= entry.type %>><% end %><% if options.revision %>(#<%= entry.revision %>)<% end %><% end %>
6
6
  <% end %><% end %>
@@ -1,9 +1,9 @@
1
1
  <?xml version="1.0"?>
2
- <% if xsl %>
3
- <?xml-stylesheet href="#{xsl}" type="text/xsl" ?>
2
+ <% if options.stylesheet %>
3
+ <?xml-stylesheet href="#{options.stylesheet}" type="text/xsl" ?>
4
4
  <% end %>
5
5
  <changelog title="<%= title %>">
6
- <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
6
+ <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
7
7
  <commit>
8
8
  <revision>#<%= h entry.revision %></revision>
9
9
  <date><%= entry.date %></date>
@@ -0,0 +1 @@
1
+ <%= changelog.to_h.to_yaml %>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <feed xmlns="http://www.w3.org/2005/Atom">
4
+
5
+ <title><%= title %> Feed</title>
6
+ <subtitle>Release History</subtitle>
7
+ <% if url %><link href="<%= url %>" rel="self" /><% end %>
8
+ <% if homepage %><link href="<%= homepage %>" /><% end %>
9
+ <id><% if vcs.uuid %>urn:uuid:<%= vcs.uuid %><% else %><%= vcs.repository %><% end %></id>
10
+ <updated><%= Time.now %></updated>
11
+ <author>
12
+ <name><%= user %></name>
13
+ <email><%= email %></email>
14
+ </author>
15
+
16
+ <% history.releases.sort.each do |release| %>
17
+ <% tag = release.tag %>
18
+ <entry>
19
+ <title><%= tag.name %></title>
20
+ <id><%= tag.revision %></id>
21
+ <author><%= tag.author %></author>
22
+ <updated><%= tag.date.strftime('%Y-%m-%d') %></updated>
23
+ <summary type="html">
24
+ <p><%= tag.message %></p>
25
+ <% if options.extra %>
26
+ <% release.groups.each do |number, changes| %>
27
+ <h2><%= changes.size %> <%= changes[0].type_phrase %></h2>
28
+ <ul class="log">
29
+ <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
30
+ <li class="entry">
31
+ <div class="message"><%= h entry.message %></div>
32
+ <!-- <div class="type"><%= h entry.type %></div> -->
33
+ <div class="revision">#<%= h entry.revision %></div>
34
+ <div class="date"><%= entry.date %></div>
35
+ <div class="author"><%= h entry.author %></div>
36
+ </li>
37
+ <% end %>
38
+ </ul>
39
+ <% end %>
40
+ <% end %>
41
+ </summary>
42
+ </entry>
43
+ <% end %>
44
+
45
+ </feed>
46
+
@@ -0,0 +1,12 @@
1
+ # <%= title %>
2
+ <% history.releases.sort.each do |release| %><% tag = release.tag %>
3
+ ## <%= tag.name %> / <%= tag.date.strftime('%Y-%m-%d') %>
4
+
5
+ <%= h tag.message.strip %> (<%= tag.author %>)
6
+
7
+ <% if options.extra %>Changes:
8
+ <% release.groups.each do |number, changes| %>
9
+ * <%= changes.size %> <%= changes[0].type_phrase %>
10
+ <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
11
+ * <%= entry.message %> <% if options.revision %>(#<%= entry.revision %>)<% end %><% end %>
12
+ <% end %><% end %><% end %>
@@ -13,19 +13,19 @@
13
13
  .message{padding: 5 0; font-weight: bold;}
14
14
  .revision{font-size: 0.8em;}
15
15
  </style>
16
- <% if css %>
17
- <link rel="stylesheet" href="#{css}" type="text/css">
16
+ <% if options.stylesheet %>
17
+ <link rel="stylesheet" href="#{options.stylesheet}" type="text/css">
18
18
  <% end %>
19
19
  </head>
20
20
  <body>
21
21
  <div class="history">
22
22
  <div class="title"><%= title %></div>
23
- <% releases.each do |release| %>
23
+ <% history.releases.sort.each do |release| %>
24
24
  <% tag = release.tag %>
25
25
  <h1><%= tag.name %> / <%= tag.date.strftime('%Y-%m-%d') %></h1>
26
26
  <p><%= tag.message %></p>
27
- <% if extra %>
28
- <% groups(release.changes).each do |number, changes| %>
27
+ <% if options.extra %>
28
+ <% release.groups.each do |number, changes| %>
29
29
  <h2><%= changes.size %> <%= changes[0].type_phrase %></h2>
30
30
  <ul class="log">
31
31
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
@@ -0,0 +1 @@
1
+ <%= history.to_h.to_json %>
@@ -1,12 +1,12 @@
1
1
  # <%= title %>
2
- <% releases.each do |release| %><% tag = release.tag %>
2
+ <% history.releases.sort.each do |release| %><% tag = release.tag %>
3
3
  ## <%= tag.name %> / <%= tag.date.strftime('%Y-%m-%d') %>
4
4
 
5
5
  <%= h tag.message.strip %> (<%= tag.author %>)
6
6
 
7
- <% if extra %>Changes:
8
- <% groups(release.changes).each do |number, changes| %>
7
+ <% if options.extra %>Changes:
8
+ <% release.groups.each do |number, changes| %>
9
9
  * <%= changes.size %> <%= changes[0].type_phrase %>
10
10
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
11
- * <%= entry.message %> <% if rev %>(#<%= entry.revision %>)<% end %><% end %>
11
+ * <%= entry.message %> <% if options.revision %>(#<%= entry.revision %>)<% end %><% end %>
12
12
  <% end %><% end %><% end %>