README.md in vandamme-0.0.7 vs README.md in vandamme-0.0.8
- old
+ new
@@ -44,15 +44,15 @@
### Regex format
**version_header_exp** will be converted to a new Regex object if it wasn't one.
Therefore,
- Vandamme::Parser.new(changelog: changelog, version_header_exp: '\d{4}-\d{2}-\d{2} \((\d\.\d+\.\d+)\)')
+ Vandamme::Parser.new(changelog: changelog, version_header_exp: '(\d\.\d+\.\d+) \((\d{4}-\d{2}-\d{2})\)?')
is equivalent to:
- Vandamme::Parser.new(changelog: changelog, version_header_exp: /\d{4}-\d{2}-\d{2} \((\d\.\d+\.\d+)\)/)
+ Vandamme::Parser.new(changelog: changelog, version_header_exp: /(\d\.\d+\.\d+) \(\d{4}-\d{2}-\d{2}\)?/)
Be careful with how ruby is handling escaped caracters in a string: ```"\d"``` if different from ```'\d'```!
### Version Matching
@@ -81,11 +81,11 @@
```ruby
require 'rubygems'
require 'vandamme'
require 'open-uri'
changelog = open('https://raw.github.com/flori/json/master/CHANGES').read
-parser = Vandamme::Parser.new(changelog: changelog, version_header_exp: '\d{4}-\d{2}-\d{2} \((\d\.\d+\.\d+)\)', format: 'markdown')
+parser = Vandamme::Parser.new(changelog: changelog, version_header_exp: '(\d\.\d+\.\d+) \(\d{4}-\d{2}-\d{2}\)', format: 'markdown')
parser.parse
```
will return a hash with each version as keys, and version content as value.
The hash can be converted to html (using the [github-markup](https://github.com/github/markup) gem):
@@ -134,12 +134,15 @@
* Update API
* Fix bug #1
```
+ LEVEL 1 (or 2) HEADER WITH VERSION **MUST** at least contain the version number (```{{version_number}}```)
-+ If the release date is present, it **MUST** of the form ```{{version_number}} / {{release_date}}```
-+ {{release_date}} **MUST** follow the ISO 8601 format: "YYYY-MM-DD", or the text "Unreleased", if present
++ If the release date is present, it **MUST** follow the form ```{{version_number}} / {{release_date}}```
++ {{release_date}} is optional but if present it **MUST** follow one of these formats:
+++ the full english style format: "December 14th, 2014" (ordinal suffix is optional)
+++ the ISO 8601 format: "YYYY-MM-DD"
+++ the text "Unreleased"
+ VERSION CHANGES **MAY** contain more levels, but MUST follow the markup syntax.
+ {{version_number}} **SHOULD** follow the [semver](http://semver.org/) convention.
+ {{version_number}} **MUST** contain at least a dot (ex: "1.2").
### Keywords
@@ -163,14 +166,14 @@
Changelogs following these rules will be automatically included in Gemnasium.
The regexp used is
```
-^#{0,3} ?([\w\d\.-]+\.[\w\d\.-]+[a-zA-Z0-9])( \/ (\d{4}-\d{2}-\d{2}|\w+))?\n?[=-]*
+^#{0,3} ?([\w\d\.-]+\.[\w\d\.-]+[a-zA-Z0-9])(?: \/ (\w+ \d{1,2}(?:st|nd|rd|th)?,\s\d{4}|\d{4}-\d{2}-\d{2}|\w+))?\n?[=-]*
```
Check your changelog using Rubular if you want to be sure:
-http://rubular.com/r/u5FTZWYtE0
+http://rubular.com/r/Gw6rIS5HkJ
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)