rubycut-vclog 1.9.5 → 1.9.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby ADDED
@@ -0,0 +1,55 @@
1
+ ---
2
+ source:
3
+ - meta
4
+ authors:
5
+ - name: Trans
6
+ email: transfire@gmail.com
7
+ copyrights:
8
+ - holder: Rubyworks
9
+ year: '2009'
10
+ license: BSD-2-Clause
11
+ requirements:
12
+ - name: facets
13
+ version: 2.4+
14
+ - name: ansi
15
+ version: 1.2+
16
+ - name: rdoc
17
+ - name: xml-simple
18
+ - name: detroit
19
+ groups:
20
+ - build
21
+ development: true
22
+ - name: citron
23
+ groups:
24
+ - test
25
+ development: true
26
+ - name: lime
27
+ groups:
28
+ - test
29
+ development: true
30
+ - name: ae
31
+ groups:
32
+ - test
33
+ development: true
34
+ dependencies: []
35
+ alternatives: []
36
+ conflicts: []
37
+ repositories:
38
+ - uri: git://github.com/rubyworks/vclog.git
39
+ scm: git
40
+ name: upstream
41
+ resources:
42
+ home: http://rubyworks.github.com/vclog
43
+ code: http://github.com/rubyworks/vclog
44
+ extra: {}
45
+ load_path:
46
+ - lib
47
+ revision: 0
48
+ created: '2006-05-09'
49
+ summary: Cross-VCS/SCM ChangeLog Generator
50
+ title: VCLog
51
+ version: 1.9.5.1
52
+ name: rubycut-vclog
53
+ description: VCLog is a cross-VCS/SCM ChangeLog generator.
54
+ organization: Rubyworks
55
+ date: '2012-03-22'
data/History.md CHANGED
@@ -1,16 +1,5 @@
1
1
  # RELEASE HISTORY
2
2
 
3
- ## 1.9.3 / 2012-04-09
4
-
5
- This release should finally fix issue #14. If also adds support
6
- for RC based configuration.
7
-
8
- Changes:
9
-
10
- * Fix issue #14.
11
- * Add support for RC.
12
-
13
-
14
3
  ## 1.9.2 / 2012-03-03
15
4
 
16
5
  Adds `vclog-news` command to output the lastest release entry in a project History file.
data/License.txt CHANGED
@@ -1,4 +1,9 @@
1
- BSD-2-Clause License
1
+ (BSD-2-Clause License)
2
+
3
+ VCLog - Mult-platform VCS Logging Tool
4
+ http://rubyworks.github.com/vclog
5
+
6
+ Copyright (c) 2008 Rubyworks. All rights reserved.
2
7
 
3
8
  Redistribution and use in source and binary forms, with or without
4
9
  modification, are permitted provided that the following conditions are met:
data/README.md CHANGED
@@ -1,46 +1,41 @@
1
1
  # VCLog
2
2
 
3
3
  [Website](http://rubyworks.github.com/vclog) /
4
+ [Source Code](http://github.com/rubyworks/vclog) /
4
5
  [Report Issue](http://github.com/rubyworks/vclog/issues) /
5
- [Source Code](http://github.com/rubyworks/vclog)    
6
- [![Build Status](https://secure.travis-ci.org/rubyworks/vclog.png)](http://travis-ci.org/rubyworks/vclog)
7
-
8
- **VCLog is a versatile and customizable cross-VCS/SCM changelog and release history generator.**
6
+ [Mailing List](http://googlegroups.com/group/rubyworks-mailinglist)
9
7
 
10
- ## Supported Systems
8
+ [![Build Status](https://secure.travis-ci.org/rubyworks/vclog.png)](http://travis-ci.org/rubyworks/vclog)
11
9
 
12
- VCLog is a multi-platform VCS logging tool.
13
- It currently supports the following Version Control Systems:
14
10
 
15
- * <a href="http://git-scm.com/">Git</a>
16
- * <a href="http://mercurial.selenic.com/">Mercurial</a>
17
- * <a href="http://subversion.apache.org/">Subversion</a>
11
+ ## Description
18
12
 
19
- Subversion support is limited however. See Limitations noted below.
13
+ VCLog is a versatile cross-VCS/SCM changelog generator.
14
+ It currently supports Git, Hg and (limited) Subversion.
20
15
 
21
16
 
22
- ## Instructions
17
+ ## Instruction
23
18
 
24
19
  ### Creating Changelogs
25
20
 
26
21
  The default output is an ANSI colored GNU-like changelog.
27
22
  From a repository's root directory try:
28
23
 
29
- $ vclog
24
+ $ vclog
30
25
 
31
26
  The is the same as specifying 'changelog' or 'log'.
32
27
 
33
- $ vclog log
28
+ $ vclog log
34
29
 
35
30
  To generate an a different format use -f:
36
31
 
37
- $ vclog -f xml
32
+ $ vclog -f xml
38
33
 
39
34
  ### Creating Release Histories
40
35
 
41
36
  To get a release history specify `-r`, `--release` or `--history` option.
42
37
 
43
- $ vclog -r
38
+ $ vclog -r
44
39
 
45
40
  Again the default format is an ANSI colored GNU-like text style.
46
41
 
@@ -56,13 +51,13 @@ See 'vclog help' for more options.
56
51
  VCLog can also be used to intelligently bump versions. To see the current
57
52
  tag version:
58
53
 
59
- $ vclog-version
60
- 1.1.0
54
+ $ vclog-version
55
+ 1.1.0
61
56
 
62
57
  To see the next reasonable version based on current changes:
63
58
 
64
- $ vclog-bump
65
- 1.2.0
59
+ $ vclog-bump
60
+ 1.2.0
66
61
 
67
62
  VCLog can determine the appropriate version based on commit level. Any
68
63
  commit with a level greater than 1 will bump the major number, while any
@@ -71,12 +66,16 @@ level only bump the patch level.
71
66
 
72
67
  ### Writing Heuristics
73
68
 
74
- VCLog can be configured to support custom log heuristics to suite the work flow
75
- of any project. It is recommended that configurations be placed in a project's
76
- `etc/vclog.rb` file. But `config/vclog.rb` and simply `.vclog` or `vclog.rb`
77
- also work.
69
+ You can configure custom log heuristics for your project. VCLog uses
70
+ the {confection gem}[http://rubyworks.github.com/confection] to
71
+ handle configuration, and will look for a `.confile` or `Confile` in
72
+ which to find a `vclog` section.
73
+
74
+ vclog do
75
+ ...
76
+ end
78
77
 
79
- Within this file rules are defined via the #on method. For example,
78
+ Within this block we can define rules via the #on method.
80
79
 
81
80
  on /updated? (README|VERSION|MANIFEST)/ do |commit|
82
81
  commit.label = "Adminstrative Changes"
@@ -98,7 +97,7 @@ These rules can also "massage" the commit message.
98
97
 
99
98
  on /\Aadmin:/ do |commit, matchdata|
100
99
  commit.type = :admin
101
- commit.message = matchdata.post_match
100
+ commit.message = matchdate.post_match
102
101
  end
103
102
 
104
103
  Lastly, we can customize the colorization of the certain formats via #colors
@@ -106,8 +105,6 @@ method.
106
105
 
107
106
  colors :blue, :cyan, :green, :yellow, :red
108
107
 
109
- The colors are taken in order from least importance to greatest importance.
110
-
111
108
 
112
109
  ## Limitations
113
110
 
@@ -121,13 +118,11 @@ access by the server for making too many rapid requests. I have no
121
118
  idea how to remedy this issue. If you have any ideas please let me know.
122
119
 
123
120
 
124
- ## Copyrights
125
-
126
- VCLog (http://rubyworks.github.com/vclog)
121
+ ## License
127
122
 
128
- Copyright &copy; 2008 Rubyworks. All rights reserved.
123
+ Copyright (c) 2008 Rubyworks
129
124
 
130
- VCLog is modifiable and redistributable in accordance with the terms of
131
- the *BSD-2-Clause* license.
125
+ VCLog is distributable in accordance with the terms of the *FreeBSD* license.
132
126
 
133
127
  See License.txt for details.
128
+
data/lib/vclog.yml CHANGED
@@ -1,68 +1,55 @@
1
1
  ---
2
- revision: 2013
3
- type: ruby
4
- sources:
5
- - index
2
+ source:
3
+ - meta
6
4
  authors:
7
5
  - name: Trans
8
6
  email: transfire@gmail.com
9
- organizations: []
7
+ copyrights:
8
+ - holder: Rubyworks
9
+ year: '2009'
10
+ license: BSD-2-Clause
10
11
  requirements:
11
- - version: ! '>= 2.4'
12
- name: facets
13
- - version: ! '>= 1.2'
14
- name: ansi
12
+ - name: facets
13
+ version: 2.4+
14
+ - name: ansi
15
+ version: 1.2+
16
+ - name: rdoc
15
17
  - name: xml-simple
16
- #- groups:
17
- # - build
18
- # development: true
19
- # name: detroit
20
- - groups:
18
+ - name: detroit
19
+ groups:
21
20
  - build
22
21
  development: true
23
- name: ergo
24
- - groups:
22
+ - name: citron
23
+ groups:
25
24
  - test
26
25
  development: true
27
- name: citron
28
- - groups:
26
+ - name: lime
27
+ groups:
29
28
  - test
30
29
  development: true
31
- name: lime
32
- - groups:
30
+ - name: ae
31
+ groups:
33
32
  - test
34
33
  development: true
35
- name: ae
36
- - groups:
37
- - test
38
- development: true
39
- name: rubytest-cli
40
- conflicts: []
34
+ dependencies: []
41
35
  alternatives: []
42
- resources:
43
- - type: home
44
- uri: http://rubyworks.github.com/vclog
45
- label: Homepage
46
- - type: code
47
- uri: http://github.com/rubyworks/vclog
48
- label: Source Code
36
+ conflicts: []
49
37
  repositories:
50
- - name: upstream
38
+ - uri: git://github.com/rubyworks/vclog.git
51
39
  scm: git
52
- uri: git://github.com/rubyworks/vclog.git
53
- categories: []
54
- copyrights:
55
- - holder: Rubyworks
56
- year: '2009'
57
- license: BSD-2-Clause
58
- customs: []
59
- paths:
60
- lib:
61
- - lib
40
+ name: upstream
41
+ resources:
42
+ home: http://rubyworks.github.com/vclog
43
+ code: http://github.com/rubyworks/vclog
44
+ extra: {}
45
+ load_path:
46
+ - lib
47
+ revision: 0
62
48
  created: '2006-05-09'
63
49
  summary: Cross-VCS/SCM ChangeLog Generator
64
50
  title: VCLog
65
- version: 1.9.5
51
+ version: 1.9.5.1
66
52
  name: rubycut-vclog
67
53
  description: VCLog is a cross-VCS/SCM ChangeLog generator.
68
- date: '2013-03-22'
54
+ organization: Rubyworks
55
+ date: '2012-03-22'
data/lib/vclog/config.rb CHANGED
@@ -1,46 +1,33 @@
1
1
  require 'vclog/heuristics'
2
- #require 'vclog/rc'
3
2
 
4
3
  module VCLog
5
4
 
6
- # Get/set master configruation(s).
7
- def self.configure(&block)
8
- @config ||= []
9
- @config << block if block
10
- @config
11
- end
12
-
13
5
  # Encapsulates configuration settings for running vclog.
14
6
  #
15
- # We recommend putting vclog configuration in a project's `etc/vclog.rb`
16
- # file. For Rails projects, however, `config/vclog.rb` can be used. If
17
- # usig a subdirectory is not suitable to a project then simply using
18
- # the more traditional `.vclog` file works too.
19
- #
20
7
  class Config
21
8
 
22
- # File glob for identifying the project's root directory.
23
9
  #
24
- # NOTE: SVN support is limited to repos with a trunk directory.
25
- ROOT_GLOB = "{.git,.hg,_darcs,.svn/trunk}"
26
-
10
+ # If not in a default location a `.map` entry can be used to
11
+ # tell vclog where the config file it located.
27
12
  #
28
- # Default vclog config file glob looks for these possible matches:
13
+ # @example
14
+ # ---
15
+ # vclog: task/vclog.rb
29
16
  #
30
- # * vclog.rb
31
- # * etc/vclog.rb
32
- # * config/vclog.rb
17
+ MAP_FILE = ".map"
18
+
33
19
  #
34
- # The configuration file can also be a hidden dot file if preferred:
20
+ # Default vclog config file glob looks for these possible matches in order:
35
21
  #
36
22
  # * .vclog
37
- # * .etc/vclog.rb
38
- # * .config/vclog.rb
23
+ # * .config/vclog
24
+ # * config/vclog
25
+ # * .dot/vclog
26
+ # * dot/vclog
39
27
  #
40
- # Root files have precedence over files in subdirectories, and the `.rb`
41
- # file extension is optional in all cases.
28
+ # File may have optional `.rb` extension.
42
29
  #
43
- FILE_GLOBS = [ '{,.}vclog{,.rb}', '{.,}{etc/,config/}vclog{,.rb}' ]
30
+ DEFAULT_GLOB = '{.,.config/,config/.dot/,dot/}vclog{,.rb}'
44
31
 
45
32
  #
46
33
  #
@@ -86,11 +73,7 @@ module VCLog
86
73
  if file
87
74
  Heuristics.load(file)
88
75
  else
89
- h = Heuristics.new
90
- if config = VCLog.configure
91
- config.each{ |c| c.call(h) }
92
- end
93
- h
76
+ Heuristics.new
94
77
  end
95
78
  )
96
79
  end
@@ -112,17 +95,42 @@ module VCLog
112
95
  # The vclog config file.
113
96
  #
114
97
  def file
115
- DEFAULT_GLOBS.find{ |g| Dir.glob(g).first }
98
+ if glob = file_map['vclog']
99
+ Dir.glob(glob).first
100
+ else
101
+ Dir.glob(DEFAULT_GLOB).first
102
+ end
103
+ end
104
+
105
+ #
106
+ # Project's map file, if present.
107
+ #
108
+ def map_file
109
+ file = File.join(root, MAP_FILE)
110
+ return file if File.exist?(file)
111
+ return nil
112
+ end
113
+
114
+ #
115
+ # Load the map file.
116
+ #
117
+ def file_map
118
+ @file_map ||= (
119
+ map_file ? YAML.load_file(map_file) : {}
120
+ )
116
121
  end
117
122
 
118
123
  #
119
124
  # Find project root. This searches up from the current working
120
- # directory for a source control manager directory.
125
+ # directory for a .map configuration file or source control
126
+ # manager directory.
121
127
  #
122
- # * `.git/`
123
- # * `.hg/`
124
- # * `_darcs/`
125
- # * `.svn/trunk`
128
+ # .ruby/
129
+ # .map
130
+ # .git/
131
+ # .hg/
132
+ # .svn/
133
+ # _darcs/
126
134
  #
127
135
  # If all else fails the current directory is returned.
128
136
  #
@@ -131,7 +139,7 @@ module VCLog
131
139
  Dir.ascend(Dir.pwd) do |path|
132
140
  check = Dir[ROOT_GLOB].first
133
141
  if check
134
- root = path
142
+ root = path
135
143
  break
136
144
  end
137
145
  end
@@ -5,7 +5,104 @@ require 'facets/string/margin'
5
5
  require 'facets/enumerable/group_by'
6
6
  require 'facets/kernel/ask'
7
7
 
8
- class OpenStruct
9
- method_undef(:type) if method_defined?(:type)
8
+ =begin
9
+
10
+ module VCLog
11
+
12
+ # Extensions for String class.
13
+ # Taken from Facets.
14
+ module String
15
+
16
+ # Provides a margin controlled string.
17
+ #
18
+ # x = %Q{
19
+ # | This
20
+ # | is
21
+ # | margin controlled!
22
+ # }.margin
23
+ #
24
+ #
25
+ # NOTE: This may still need a bit of tweaking.
26
+ #
27
+ # CREDIT: Trans
28
+
29
+ def margin(n=0)
30
+ #d = /\A.*\n\s*(.)/.match( self )[1]
31
+ #d = /\A\s*(.)/.match( self)[1] unless d
32
+ d = ((/\A.*\n\s*(.)/.match(self)) ||
33
+ (/\A\s*(.)/.match(self)))[1]
34
+ return '' unless d
35
+ if n == 0
36
+ gsub(/\n\s*\Z/,'').gsub(/^\s*[#{d}]/, '')
37
+ else
38
+ gsub(/\n\s*\Z/,'').gsub(/^\s*[#{d}]/, ' ' * n)
39
+ end
40
+ end
41
+
42
+ # Preserves relative tabbing.
43
+ # The first non-empty line ends up with n spaces before nonspace.
44
+ #
45
+ # CREDIT: Gavin Sinclair
46
+
47
+ def tabto(n)
48
+ if self =~ /^( *)\S/
49
+ indent(n - $1.length)
50
+ else
51
+ self
52
+ end
53
+ end
54
+
55
+ # Indent left or right by n spaces.
56
+ # (This used to be called #tab and aliased as #indent.)
57
+ #
58
+ # CREDIT: Gavin Sinclair
59
+ # CREDIT: Trans
60
+
61
+ def indent(n)
62
+ if n >= 0
63
+ gsub(/^/, ' ' * n)
64
+ else
65
+ gsub(/^ {0,#{-n}}/, "")
66
+ end
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+
73
+ class String #:nodoc:
74
+ include VCLog::String
10
75
  end
11
76
 
77
+
78
+ # Core extension
79
+
80
+ module Enumerable
81
+
82
+ unless defined?(group_by) or defined?(::ActiveSupport) # 1.9 or ActiveSupport
83
+
84
+ # #group_by is used to group items in a collection by something they
85
+ # have in common. The common factor is the key in the resulting hash, the
86
+ # array of like elements is the value.
87
+ #
88
+ # (1..5).group_by { |n| n % 3 }
89
+ # #=> { 0 => [3], 1 => [1, 4], 2 => [2,5] }
90
+ #
91
+ # ["I had", 1, "dollar and", 50, "cents"].group_by { |e| e.class }
92
+ # #=> { String => ["I had","dollar and","cents"], Fixnum => [1,50] }
93
+ #
94
+ # CREDIT: Erik Veenstra
95
+
96
+ def group_by #:yield:
97
+ #h = k = e = nil
98
+ r = Hash.new
99
+ each{ |e| (r[yield(e)] ||= []) << e }
100
+ r
101
+ end
102
+
103
+ end
104
+
105
+ end
106
+
107
+ =end
108
+
data/lib/vclog/report.rb CHANGED
@@ -31,7 +31,7 @@ module VCLog
31
31
  # An instance of VCLog::Repo.
32
32
  #
33
33
  def initialize(repo, options)
34
- @repo = repo
34
+ @repo = repo
35
35
 
36
36
  options[:type] ||= 'changelog'
37
37
  options[:format] ||= 'ansi'
@@ -132,7 +132,7 @@ module VCLog
132
132
  tmpl_glob = File.join(DIR, 'templates', "#{type}.#{format}.{erb,rb}")
133
133
  tmpl_file = Dir[tmpl_glob].first
134
134
 
135
- raise "could not find template -- #{type}.#{format}" unless tmpl_file
135
+ raise "could not find template -- #{tmp_glob}" unless tmpl_file
136
136
 
137
137
  tmpl = File.read(tmpl_file)
138
138
 
@@ -3,7 +3,7 @@ require 'vclog/metadata'
3
3
  testcase "VCLog" do
4
4
 
5
5
  test "VERSION is set" do
6
- ::VCLog::VERSION.assert == File.read('index/version').strip
6
+ ::VCLog::VERSION.assert == File.read('meta/version').strip
7
7
  end
8
8
 
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycut-vclog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,7 +44,7 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.2'
46
46
  - !ruby/object:Gem::Dependency
47
- name: xml-simple
47
+ name: rdoc
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
@@ -60,14 +60,14 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: ergo
63
+ name: xml-simple
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
- type: :development
70
+ type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
@@ -76,7 +76,7 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- name: citron
79
+ name: detroit
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
@@ -92,7 +92,7 @@ dependencies:
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- name: lime
95
+ name: citron
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
@@ -108,7 +108,7 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: ae
111
+ name: lime
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
@@ -124,7 +124,7 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
- name: rubytest-cli
127
+ name: ae
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
@@ -155,6 +155,7 @@ extra_rdoc_files:
155
155
  - History.md
156
156
  - README.md
157
157
  files:
158
+ - .ruby
158
159
  - .yardopts
159
160
  - bin/vclog
160
161
  - bin/vclog-autotag
@@ -186,7 +187,6 @@ files:
186
187
  - lib/vclog/heuristics.rb
187
188
  - lib/vclog/history_file.rb
188
189
  - lib/vclog/metadata.rb
189
- - lib/vclog/rc.rb
190
190
  - lib/vclog/release.rb
191
191
  - lib/vclog/repo.rb
192
192
  - lib/vclog/report.rb
@@ -255,11 +255,4 @@ rubygems_version: 1.8.25
255
255
  signing_key:
256
256
  specification_version: 3
257
257
  summary: Cross-VCS/SCM ChangeLog Generator
258
- test_files:
259
- - test/case_metadata.rb
260
- - spec/feature_hg_history.rb
261
- - spec/feature_git_changes.rb
262
- - spec/feature_hg_changes.rb
263
- - spec/featurettes/repo_creation.rb
264
- - spec/featurettes/shellout.rb
265
- - spec/feature_git_history.rb
258
+ test_files: []
data/lib/vclog/rc.rb DELETED
@@ -1,9 +0,0 @@
1
- begin
2
- require 'rc/api'
3
-
4
- configure 'vclog' do |config|
5
- VCLog.configure(&config) if config.profile?
6
- end
7
- rescue LoadError
8
- end
9
-