vandamme 0.0.2 → 0.0.3
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.
- checksums.yaml +7 -0
- data/{Changelog.md → CHANGELOG.md} +2 -2
- data/README.md +74 -3
- data/lib/vandamme.rb +0 -4
- data/lib/vandamme/parser.rb +2 -2
- data/lib/vandamme/version.rb +1 -1
- data/spec/vandamme/parser_spec.rb +10 -10
- data/vandamme.gemspec +1 -1
- metadata +10 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8ee8ed35dab6adecac9164680abdcf0f2834d867
|
4
|
+
data.tar.gz: c5e0fde915f24e83cd1b109a2df0791e38e3d437
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f585d6ce0ce9fc437cfedaebc49a0af88e544bd5d843775ae123c619443b799065673e2ec600eb76153d6be3ac83cfaa4a624bf04feebc529208b97eb9e2eabf
|
7
|
+
data.tar.gz: 30b579987fdf59d4445c2680b312c0348a087afadd814a44c662dd08005f07e40195d77bd994ee3b981000c5b8be550c16817e2c7602a1468c1d8c16a5065124
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# 2013-01-06
|
1
|
+
# 0.0.2 / 2013-01-06
|
2
2
|
|
3
3
|
* Fix gem dependencies (to githup-markup)
|
4
4
|
* Allow users to specify :match_group for dirty changelogs
|
5
5
|
* Improved documentation
|
6
6
|
* ```:version_header_exp``` can be a real Regexp now
|
7
7
|
|
8
|
-
# 2013-01-02
|
8
|
+
# 0.0.1 / 2013-01-02
|
9
9
|
|
10
10
|
Initial release
|
data/README.md
CHANGED
@@ -3,7 +3,20 @@
|
|
3
3
|
[](https://gemnasium.com/tech-angels/vandamme)
|
4
4
|
[](https://travis-ci.org/tech-angels/vandamme)
|
5
5
|
|
6
|
-
Vandamme is a changelog parser gem, used in the [Gemnasium
|
6
|
+
Vandamme is a changelog parser gem, used in the [Gemnasium](https://gemnasium.com) project.
|
7
|
+
|
8
|
+
There are thousands of different changelogs (if any) out there, with dozens of different names.
|
9
|
+
It's almost impossible to fetch and parse them automatically... Gemnasium is using Vandamme to
|
10
|
+
keep each changelog specificities (changelog location, version format, file format).
|
11
|
+
|
12
|
+
We really believe in changelogs. Following changes in dependencies is a hard task, and almost impossible
|
13
|
+
by reading commits only.
|
14
|
+
|
15
|
+
The opensource world would be so much nicer with full, readable and comprehensive changelogs.
|
16
|
+
As a solution to this problem, we propose a simple set of rules and requirements to follow in order to have a
|
17
|
+
Standard Changelog. Please see the [Changelogs Convention](#changelogs-convention) section below.
|
18
|
+
|
19
|
+
Stay aware of changes!
|
7
20
|
|
8
21
|
## Installation
|
9
22
|
|
@@ -60,8 +73,7 @@ initializer:
|
|
60
73
|
Vandamme::Parser.new([...], :matching_group => 1)
|
61
74
|
|
62
75
|
The default match group is 0: this is the first group matched (0 being the
|
63
|
-
original string), because we are using ```String#scan``` instead of
|
64
|
-
```Regexp.match```.
|
76
|
+
original string), because we are using ```String#scan``` instead of ```Regexp.match```.
|
65
77
|
|
66
78
|
|
67
79
|
## Examples
|
@@ -83,6 +95,65 @@ parser.to_html
|
|
83
95
|
|
84
96
|
Vandamme is bundled with Redcarpet by default (for markdown), you must add the necessary gems to your bundle if you want to handle more formats.
|
85
97
|
|
98
|
+
## Changelogs Convention
|
99
|
+
|
100
|
+
### Filename
|
101
|
+
|
102
|
+
+ Your changelog file **MUST** be named CHANGELOG.format (preferably ```CHANGELOG.md```)
|
103
|
+
+ Your changelog file **MUST** be at the root of your project
|
104
|
+
+ You **MAY** have different changelog in each branch (like [Ruby on Rails](https://github.com/rails/rails))
|
105
|
+
|
106
|
+
### Format
|
107
|
+
|
108
|
+
+ Your changelog **MUST** be in plain text formatting syntax.
|
109
|
+
+ You **MUST** use one the supported markup: https://github.com/github/markup#markups
|
110
|
+
+ You **MAY** prefer Markdown (.md) is now the most popular format for READMEs on Github, let's stick to it.
|
111
|
+
+ Your changelog **MUST** follow the format:
|
112
|
+
|
113
|
+
```
|
114
|
+
LEVEL 1 (or 2) HEADER WITH VERSION AND RELEASE DATE
|
115
|
+
|
116
|
+
VERSION CHANGES
|
117
|
+
|
118
|
+
LEVEL 1 (or 2) HEADER WITH VERSION AND RELEASE DATE
|
119
|
+
|
120
|
+
VERSION CHANGES
|
121
|
+
|
122
|
+
[...]
|
123
|
+
```
|
124
|
+
|
125
|
+
Example in Markdown:
|
126
|
+
|
127
|
+
```markdown
|
128
|
+
# 1.2.4 / Unreleased
|
129
|
+
|
130
|
+
* Fix bug #2
|
131
|
+
|
132
|
+
# 1.2.3 / 2013-02-14
|
133
|
+
|
134
|
+
* Update API
|
135
|
+
* Fix bug #1
|
136
|
+
```
|
137
|
+
|
138
|
+
+ LEVEL 1 (or 2) HEADER WITH VERSION **MUST** at least contain the version number (```{{version_number}}```)
|
139
|
+
+ If the release date is present, it **MUST** of the form ```{{version_number}} / {{release_date}}```
|
140
|
+
+ {{release_date}} **MUST** follow the ISO 8601 format: "YYYY-MM-DD", or the text "Unreleased", if present
|
141
|
+
+ VERSION CHANGES **MAY** contain more levels, but MUST follow the markup syntax.
|
142
|
+
+ {{version_number}} **SHOULD** follow the [semver](http://semver.org/) convention.
|
143
|
+
+ {{version_number}} **MUST** contain at least a dot (ex: "1.2").
|
144
|
+
|
145
|
+
### Note
|
146
|
+
|
147
|
+
Changelogs following these rules will be automatically included in Gemnasium.
|
148
|
+
The regexp used is
|
149
|
+
|
150
|
+
```
|
151
|
+
^#{1,2} ([\w\d\.-]+\.[\w\d\.-]+) ?\/? ?(\d{4}-\d{2}-\d{2}|\w+)?
|
152
|
+
```
|
153
|
+
|
154
|
+
Check your changelog using Rubular if you want to be sure:
|
155
|
+
http://rubular.com/r/u5FTZWYtE0
|
156
|
+
|
86
157
|
## Contributing
|
87
158
|
|
88
159
|
1. Fork it
|
data/lib/vandamme.rb
CHANGED
data/lib/vandamme/parser.rb
CHANGED
@@ -32,7 +32,7 @@ module Vandamme
|
|
32
32
|
version_content = $~.post_match
|
33
33
|
changelog_scanner = StringScanner.new(version_content)
|
34
34
|
changelog_scanner.scan_until(@version_header_exp)
|
35
|
-
@changelog_hash[match[@match_group]]= (changelog_scanner.pre_match || version_content).gsub(
|
35
|
+
@changelog_hash[match[@match_group]] = (changelog_scanner.pre_match || version_content).gsub(/(\A\n+|\n+\z)/, '')
|
36
36
|
end
|
37
37
|
@changelog_hash
|
38
38
|
end
|
@@ -44,7 +44,7 @@ module Vandamme
|
|
44
44
|
# for more formats. The corresponding gem must be bundled.
|
45
45
|
def to_html
|
46
46
|
self.parse if @changelog_hash.empty?
|
47
|
-
# GitHub Markup API is really weird, we MUST pass a file name for format detection:
|
47
|
+
# GitHub Markup API is really weird, we MUST pass a file name for format detection as 1st arg:
|
48
48
|
@changelog_hash.inject({}) { |h,(k,v)| h[k] = GitHub::Markup.render(".#{@format}", v); h }
|
49
49
|
end
|
50
50
|
end
|
data/lib/vandamme/version.rb
CHANGED
@@ -5,9 +5,9 @@ describe Vandamme::Parser do
|
|
5
5
|
let(:changelog_file) { File.read("spec/fixtures/json.md") }
|
6
6
|
let(:changelog_as_hash) {
|
7
7
|
{
|
8
|
-
"1.7.6"=> " * Add GeneratorState#merge alias for JRuby, fix state accessor methods. Thx to\n jvshahid@github.\n * Increase hash likeness of state objects
|
9
|
-
"1.7.5"=> " * Fix compilation of extension on older rubies
|
10
|
-
"1.7.4"=> " * Fix compilation problem on AIX, see https://github.com/flori/json/issues/142
|
8
|
+
"1.7.6"=> " * Add GeneratorState#merge alias for JRuby, fix state accessor methods. Thx to\n jvshahid@github.\n * Increase hash likeness of state objects.",
|
9
|
+
"1.7.5"=> " * Fix compilation of extension on older rubies.",
|
10
|
+
"1.7.4"=> " * Fix compilation problem on AIX, see https://github.com/flori/json/issues/142"
|
11
11
|
}
|
12
12
|
}
|
13
13
|
|
@@ -37,11 +37,11 @@ describe Vandamme::Parser do
|
|
37
37
|
let(:changelog_file) { File.read("spec/fixtures/postmark-gem.rdoc") }
|
38
38
|
let(:changelog_as_hash) {
|
39
39
|
{
|
40
|
-
"0.9.15" => "* Save a received MessageID in message headers
|
41
|
-
"0.9.14" => "* Parse Subject and MessageID from the Bounce API response
|
42
|
-
"0.9.13" => "* Added error_code to DeliveryError\n* Added retries for Timeout::Error
|
43
|
-
"0.9.12" => "* Fixed a problem of attachments processing when using deliver! method on Mail object.\n* Removed activesupport dependency for Postmark::AttachmentsFixForMail.\n* Added specs for AttachmentFixForMail
|
44
|
-
"0.9.11" => "* Replaced Jeweler by Bundler.\n* Updated RSpec to 2.8.\n* Fixed specs.\n* Refactored the codebase
|
40
|
+
"0.9.15" => "* Save a received MessageID in message headers.",
|
41
|
+
"0.9.14" => "* Parse Subject and MessageID from the Bounce API response.",
|
42
|
+
"0.9.13" => "* Added error_code to DeliveryError\n* Added retries for Timeout::Error",
|
43
|
+
"0.9.12" => "* Fixed a problem of attachments processing when using deliver! method on Mail object.\n* Removed activesupport dependency for Postmark::AttachmentsFixForMail.\n* Added specs for AttachmentFixForMail.",
|
44
|
+
"0.9.11" => "* Replaced Jeweler by Bundler.\n* Updated RSpec to 2.8.\n* Fixed specs.\n* Refactored the codebase."
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
@@ -83,8 +83,8 @@ describe Vandamme::Parser do
|
|
83
83
|
}
|
84
84
|
let(:changelog_as_hash) {
|
85
85
|
{
|
86
|
-
"1.0.0" => "* First stable version
|
87
|
-
"0.9.9" => "* Last Beta before stable
|
86
|
+
"1.0.0" => "* First stable version.",
|
87
|
+
"0.9.9" => "* Last Beta before stable."
|
88
88
|
}
|
89
89
|
}
|
90
90
|
|
data/vandamme.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_development_dependency 'rspec','~> 2.
|
20
|
+
gem.add_development_dependency 'rspec','~> 2.13.0'
|
21
21
|
gem.add_development_dependency 'rake','~> 10.0.2'
|
22
22
|
|
23
23
|
gem.add_dependency 'github-markup', '~> 0.7.5'
|
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vandamme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Philippe Lafoucrière
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.
|
19
|
+
version: 2.13.0
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.
|
26
|
+
version: 2.13.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: github-markup
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: redcarpet
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -85,7 +76,7 @@ extra_rdoc_files: []
|
|
85
76
|
files:
|
86
77
|
- .gitignore
|
87
78
|
- .travis.yml
|
88
|
-
-
|
79
|
+
- CHANGELOG.md
|
89
80
|
- Gemfile
|
90
81
|
- LICENSE.txt
|
91
82
|
- README.md
|
@@ -100,27 +91,26 @@ files:
|
|
100
91
|
- vandamme.gemspec
|
101
92
|
homepage: https://github.com/tech-angels/vandamme
|
102
93
|
licenses: []
|
94
|
+
metadata: {}
|
103
95
|
post_install_message:
|
104
96
|
rdoc_options: []
|
105
97
|
require_paths:
|
106
98
|
- lib
|
107
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
-
none: false
|
109
100
|
requirements:
|
110
|
-
- -
|
101
|
+
- - '>='
|
111
102
|
- !ruby/object:Gem::Version
|
112
103
|
version: '0'
|
113
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
105
|
requirements:
|
116
|
-
- -
|
106
|
+
- - '>='
|
117
107
|
- !ruby/object:Gem::Version
|
118
108
|
version: '0'
|
119
109
|
requirements: []
|
120
110
|
rubyforge_project:
|
121
|
-
rubygems_version:
|
111
|
+
rubygems_version: 2.0.2
|
122
112
|
signing_key:
|
123
|
-
specification_version:
|
113
|
+
specification_version: 4
|
124
114
|
summary: Be aware of changelogs content
|
125
115
|
test_files:
|
126
116
|
- spec/fixtures/json.md
|