vclog 1.4.0 → 1.5.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.
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
@@ -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 %>
@@ -1,17 +1,18 @@
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
  <history>
6
6
  <title><%= title %></title>
7
- <% releases.each do |release| %>
7
+ <% history.releases.sort.each do |release| %>
8
8
  <tag>
9
9
  <% tag = release.tag %>
10
10
  <name><%= h tag.name %></name>
11
11
  <date><%= tag.date.strftime('%Y-%m-%d') %></date>
12
12
  <author><%= h tag.author %></author>
13
13
  <message><%= h tag.message %></message>
14
- <% groups(release.changes).each do |number, changes| %>
14
+
15
+ <% release.groups.each do |number, changes| %>
15
16
  <commit-group type="<%= changes[0].type %>" label="<%= changes[0].type_phrase %>">
16
17
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
17
18
  <commit>
@@ -0,0 +1 @@
1
+ <%= history.to_h.to_yaml %>
data/lib/vclog.rb CHANGED
@@ -1 +1 @@
1
- require 'vclog/vcs'
1
+ require 'vclog/adapters'
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 4
7
+ - 5
8
8
  - 0
9
- version: 1.4.0
9
+ version: 1.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Thomas Sawyer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-26 00:00:00 -04:00
17
+ date: 2010-05-28 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -31,7 +31,7 @@ dependencies:
31
31
  type: :runtime
32
32
  version_requirements: *id001
33
33
  description: VCLog is a cross-VCS/SCM ChangeLog generator.
34
- email:
34
+ email: transfire@gmail.com
35
35
  executables:
36
36
  - vclog
37
37
  extensions: []
@@ -41,49 +41,49 @@ extra_rdoc_files:
41
41
  files:
42
42
  - bin/vclog
43
43
  - lib/plugins/syckle/vclog.rb
44
+ - lib/vclog/adapters/abstract.rb
45
+ - lib/vclog/adapters/darcs.rb
46
+ - lib/vclog/adapters/git.rb
47
+ - lib/vclog/adapters/hg.rb
48
+ - lib/vclog/adapters/svn.rb
49
+ - lib/vclog/adapters.rb
44
50
  - lib/vclog/change.rb
45
51
  - lib/vclog/changelog.rb
46
52
  - lib/vclog/cli.rb
47
53
  - lib/vclog/facets.rb
54
+ - lib/vclog/formatter.rb
48
55
  - lib/vclog/heuristics.rb
49
56
  - lib/vclog/history.rb
57
+ - lib/vclog/metadata.rb
50
58
  - lib/vclog/release.rb
51
59
  - lib/vclog/tag.rb
60
+ - lib/vclog/templates/changelog.atom
52
61
  - lib/vclog/templates/changelog.gnu
53
62
  - lib/vclog/templates/changelog.html
63
+ - lib/vclog/templates/changelog.json
54
64
  - lib/vclog/templates/changelog.markdown
55
65
  - lib/vclog/templates/changelog.rdoc
56
66
  - lib/vclog/templates/changelog.xml
57
67
  - lib/vclog/templates/changelog.xsl
68
+ - lib/vclog/templates/changelog.yaml
69
+ - lib/vclog/templates/history.atom
70
+ - lib/vclog/templates/history.gnu
58
71
  - lib/vclog/templates/history.html
72
+ - lib/vclog/templates/history.json
59
73
  - lib/vclog/templates/history.markdown
60
74
  - lib/vclog/templates/history.rdoc
61
75
  - lib/vclog/templates/history.xml
62
- - lib/vclog/vcs/darcs.rb
63
- - lib/vclog/vcs/git.rb
64
- - lib/vclog/vcs/hg.rb
65
- - lib/vclog/vcs/svn.rb
66
- - lib/vclog/vcs.rb
76
+ - lib/vclog/templates/history.yaml
67
77
  - lib/vclog.rb
68
- - features/history.feature
78
+ - features/git.feature
79
+ - features/hg.feature
69
80
  - features/step_definitions/history_steps.rb
81
+ - features/step_definitions/repo_steps.rb
70
82
  - features/support/ae.rb
83
+ - features/support/aruba.rb
71
84
  - features/support/loadpath.rb
72
- - meta/authors
73
- - meta/contact
74
- - meta/created
75
- - meta/description
76
- - meta/homepage
77
- - meta/license
78
- - meta/name
79
- - meta/repository
80
- - meta/requires
81
- - meta/ruby
82
- - meta/sitemap
83
- - meta/suite
84
- - meta/summary
85
- - meta/title
86
- - meta/version
85
+ - features/support/repo.rb
86
+ - features/svn.feature
87
87
  - HISTORY.rdoc
88
88
  - PROFILE
89
89
  - LICENSE
@@ -92,7 +92,7 @@ files:
92
92
  - REQUIRE
93
93
  - VERSION
94
94
  has_rdoc: true
95
- homepage: http://proutils.rubyforge.org/vclog
95
+ homepage: http://proutils.github.com/vclog
96
96
  licenses: []
97
97
 
98
98
  post_install_message:
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: "0"
120
120
  requirements: []
121
121
 
122
- rubyforge_project: proutils
122
+ rubyforge_project: vclog
123
123
  rubygems_version: 1.3.6
124
124
  signing_key:
125
125
  specification_version: 3
@@ -1,16 +0,0 @@
1
- Feature: Release History
2
- As a SCM user
3
- I want to generate a nicely formatted Release History
4
-
5
- Scenario: SVN History
6
- Given a SVN repository
7
- When I generate a History
8
- Then it should include all tags
9
- And the list of releases should be in order from newest to oldest
10
-
11
- Scenario: Git History
12
- Given a Git repository
13
- When I generate a History
14
- Then it should include all tags
15
- And the list of releases should be in order from newest to oldest
16
-
@@ -1,83 +0,0 @@
1
- module VCLog
2
-
3
- class VCS
4
-
5
- # = DARCS
6
- #
7
- # Provide Darcs SCM revision tools.
8
- #
9
- # TODO: This needs to be fixed.
10
- #
11
- class DARCS
12
-
13
- ### Is a darcs repository?
14
- def repository?
15
- File.directory?('_darcs')
16
- end
17
-
18
- ### This is also a module function.
19
- module_function :repository?
20
-
21
- ### Cached Changelog.
22
- def changelog
23
- @changelog ||= generate_changelog
24
- end
25
-
26
- ### Generate Changelog object.
27
- def generate_changelog
28
- raise "not a darcs repository" unless repository?
29
-
30
- log = Changelog.new
31
-
32
- txt = `darcs changes` #--repo=#{@repository}`
33
-
34
- txt.each_line do |line|
35
- case line
36
- when /^\s*$/
37
- when /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/
38
- when /^\s*tagged/
39
- log << $'
40
- log << "\n"
41
- else
42
- log << line
43
- log << "\n"
44
- end
45
- end
46
-
47
- return log
48
- end
49
-
50
- ### Retrieve the "revision number" from the darcs tree.
51
- def calculate_version
52
- raise "not a darcs repository" unless repository?
53
-
54
- status = info.status
55
-
56
- changes = `darcs changes`
57
- count = 0
58
- tag = "0.0"
59
-
60
- changes.each("\n\n") do |change|
61
- head, title, desc = change.split("\n", 3)
62
- if title =~ /^ \*/
63
- # Normal change.
64
- count += 1
65
- elsif title =~ /tagged (.*)/
66
- # Tag. We look for these.
67
- tag = $1
68
- break
69
- else
70
- warn "Unparsable change: #{change}"
71
- end
72
- end
73
- ver = "#{tag}.#{count.to_s}"
74
-
75
- return ver
76
- #format_version_stamp(ver, status) # ,released)
77
- end
78
-
79
- end
80
-
81
- end
82
- end
83
-
data/lib/vclog/vcs/git.rb DELETED
@@ -1,83 +0,0 @@
1
- module VCLog
2
-
3
- require 'vclog/vcs'
4
-
5
- class VCS
6
-
7
- # = GIT Adapter
8
- #
9
- class GIT < VCS
10
-
11
- #def initialize
12
- #end
13
-
14
- #
15
- #def changelog
16
- # @changelog ||= ChangeLog.new(changes)
17
- #end
18
-
19
- #
20
- #def history(opts={})
21
- # @history ||= History.new(self, opts)
22
- #end
23
-
24
- # Collect changes.
25
- #
26
- def extract_changes
27
- list = []
28
- changelog = `git log --pretty=format:"---%ci|~|%aN|~|%H|~|%s"`.strip
29
- changes = changelog.split("---")
30
- #changes = changelog.split(/^commit/m)
31
- changes.shift # throw the first (empty) entry away
32
- changes.each do |entry|
33
- date, who, rev, msg = entry.split('|~|')
34
- date = Time.parse(date)
35
- msg, type = *split_type(msg)
36
- list << [rev, date, who, msg, type]
37
- end
38
- list
39
- end
40
-
41
- # Collect tags.
42
- #
43
- # `git show 1.0` produces:
44
- #
45
- # tag 1.0
46
- # Tagger: 7rans <transfire@gmail.com>
47
- # Date: Sun Oct 25 09:27:58 2009 -0400
48
- #
49
- # version 1.0
50
- # commit
51
- # ...
52
- #
53
- def extract_tags
54
- list = []
55
- tags = `git tag -l`
56
- tags.split(/\s+/).each do |tag|
57
- info = `git show #{tag}`
58
- md = /\Atag(.*?)\n(.*?)^commit/m.match(info)
59
- who, date, *msg = *md[2].split(/\n/)
60
- who = who.split(':')[1].strip
61
- date = date[date.index(':')+1..-1].strip
62
- msg = msg.join("\n")
63
-
64
- info = `git show #{tag}^ --pretty=format:"%ci|-|"`
65
- date, *_ = *info.split('|-|')
66
-
67
- #md = /\Atag(.*?)\n(.*?)^commit/m.match(info)
68
- #_who, _date, *_msg = *md[2].split(/\n/)
69
- #_who = _who.split(':')[1].strip
70
- #_date = _date[_date.index(':')+1..-1].strip
71
- #_msg = _msg.join("\n")
72
-
73
- list << [tag, date, who, msg]
74
- end
75
- list
76
- end
77
-
78
- end#class GIT
79
-
80
- end#class VCS
81
-
82
- end#module VCLog
83
-
data/lib/vclog/vcs/hg.rb DELETED
File without changes
data/lib/vclog/vcs/svn.rb DELETED
@@ -1,116 +0,0 @@
1
- module VCLog
2
-
3
- class VCS
4
-
5
- # = SVN
6
- #
7
- # NOTE: Unfortunately the SVN adapater is very slow. If hits the server
8
- # every time the 'svn log' command is issued. When generating a History
9
- # that's one hit for every tag. If anyone knows a better way please have
10
- # at it --maybe future versions of SVN will improve the situation.
11
- #
12
- class SVN < VCS
13
-
14
- def initialize(root)
15
- begin
16
- require 'xmlsimple'
17
- rescue LoadError
18
- "VCLog requires xmlsimple for SVN support"
19
- end
20
- super(root)
21
- end
22
-
23
- #
24
- def extract_changes
25
- log = []
26
-
27
- xml = `svn log --xml`.strip
28
-
29
- commits = XmlSimple.xml_in(xml, {'KeyAttr' => 'rev'})
30
- commits = commits['logentry']
31
-
32
- commits.each do |com|
33
- rev = com["revision"]
34
- msg = [com["msg"]].flatten.compact.join('').strip
35
- who = [com["author"]].flatten.compact.join('').strip
36
- date = [com["date"]].flatten.compact.join('').strip
37
-
38
- next if msg.empty?
39
- next if msg == "*** empty log message ***"
40
-
41
- date = Time.parse(date)
42
-
43
- msg, type = *split_type(msg)
44
-
45
- log << [rev, date, who, msg, type]
46
- end
47
-
48
- log
49
- end
50
-
51
- #
52
- def extract_tags
53
- list = []
54
- tagdir = tag_directory
55
-
56
- if tagdir
57
- tags = Dir.entries(tagdir).select{ |e| e.index('.') != 0 && e =~ /\d(.*)$/ }
58
- else
59
- tags = []
60
- end
61
-
62
- tags.each do |path|
63
- dir = File.join(tagdir, path)
64
-
65
- # using yaml, but maybe use xml instead?
66
- info = `svn info #{dir}`
67
- info = YAML.load(info)
68
- md = /(\d.*)$/.match(info['Path'])
69
- name = md ? md[1] : path
70
- date = info['Last Changed Date']
71
- who = info['Last Changed Author']
72
- rev = info['Revision']
73
-
74
- # get last commit
75
- xml = `svn log -l1 --xml #{dir}`
76
- commits = XmlSimple.xml_in(xml, {'KeyAttr' => 'rev'})
77
- commit = commits['logentry'].first
78
-
79
- msg = [commit["msg"]].flatten.compact.join('').strip
80
- date = [commit["date"]].flatten.compact.join('').strip
81
-
82
- list << [name, date, who, msg]
83
- end
84
- list
85
- end
86
-
87
- # This isn't perfect, but is there really anyway for it to be?
88
- # It ascends up the current directory tree looking for the
89
- # best candidate for a tags directory.
90
- def tag_directory
91
- fnd = nil
92
- dir = root
93
- while dir != '/' do
94
- entries = Dir.entries(dir)
95
- if entries.include?('.svn')
96
- if entries.include?('tags')
97
- break(fnd = File.join(dir, 'tags'))
98
- else
99
- entries = entries.reject{ |e| e.index('.') == 0 }
100
- entries = entries.reject{ |e| e !~ /\d$/ }
101
- break(fnd = dir) unless entries.empty?
102
- end
103
- else
104
- break(fnd=nil)
105
- end
106
- dir = File.dirname(dir)
107
- end
108
- fnd
109
- end
110
-
111
- end#class SVN
112
-
113
- end#class VCS
114
-
115
- end#module VCLog
116
-
data/meta/authors DELETED
@@ -1 +0,0 @@
1
- Thomas Sawyer
data/meta/contact DELETED
@@ -1 +0,0 @@
1
- http://googlegroups.com/group/proutils
data/meta/created DELETED
@@ -1 +0,0 @@
1
- 2006-05-09
data/meta/description DELETED
@@ -1 +0,0 @@
1
- VCLog is a cross-VCS/SCM ChangeLog generator.
data/meta/homepage DELETED
@@ -1 +0,0 @@
1
- http://proutils.rubyforge.org/vclog
data/meta/license DELETED
@@ -1 +0,0 @@
1
- GPL3
data/meta/name DELETED
@@ -1 +0,0 @@
1
- vclog
data/meta/repository DELETED
@@ -1 +0,0 @@
1
- git://github.com/proutils/vclog.git
data/meta/requires DELETED
@@ -1 +0,0 @@
1
- facets > 2.4
data/meta/ruby DELETED
@@ -1,2 +0,0 @@
1
- - 1.8.6
2
- - 1.8.7
data/meta/sitemap DELETED
@@ -1 +0,0 @@
1
- doc/rdoc: vclog
data/meta/suite DELETED
@@ -1 +0,0 @@
1
- proutils
data/meta/summary DELETED
@@ -1 +0,0 @@
1
- Cross-VCS/SCM ChangeLog Generator
data/meta/title DELETED
@@ -1 +0,0 @@
1
- VCLog
data/meta/version DELETED
@@ -1 +0,0 @@
1
- 1.4.0