vandamme 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.5 / unreleased
2
+
3
+ * Fix default regexp for trailing chars in version number. (@nzwsch)
4
+
1
5
  # 0.0.4 / 2013-03-28
2
6
 
3
7
  * The parser constructor parameter "version_header_exp" is now optional, and will default to changelog convention regexp.
data/README.md CHANGED
@@ -142,13 +142,30 @@ Example in Markdown:
142
142
  + {{version_number}} **SHOULD** follow the [semver](http://semver.org/) convention.
143
143
  + {{version_number}} **MUST** contain at least a dot (ex: "1.2").
144
144
 
145
+ ### Keywords
146
+
147
+ Usage of keywords is strongly recommanded, as it helps to identify the nature of each change.
148
+ Keywords should be a one-word tag, in caps, preceding each change line:
149
+
150
+ ```markdown
151
+ # 1.2.4 / Unreleased
152
+
153
+ * [BUGFIX] Fix bug #2
154
+ * [FEATURE] Add github oauth login
155
+ * [PERFORMANCE] Now 25% faster!
156
+ ```
157
+
158
+ + Keyword, if present, **MUST** be in caps, at beginning of line, and surrounded with square brackets.
159
+ + Keyword **SHOULD** be preferably among: "SECURITY", "BUGFIX", "FEATURE", "ENHANCEMENT", "PERFORMANCE"
160
+
161
+
145
162
  ### Note
146
163
 
147
164
  Changelogs following these rules will be automatically included in Gemnasium.
148
165
  The regexp used is
149
166
 
150
167
  ```
151
- ^#{1,2} ([\w\d\.-]+\.[\w\d\.-]+) ?\/? ?(\d{4}-\d{2}-\d{2}|\w+)?
168
+ ^#{0,3} ?([\w\d\.-]+\.[\w\d\.-]+[a-zA-Z0-9])( \/ (\d{4}-\d{2}-\d{2}|\w+))?\n?[=-]*
152
169
  ```
153
170
 
154
171
  Check your changelog using Rubular if you want to be sure:
@@ -4,7 +4,7 @@ require 'github/markup'
4
4
  module Vandamme
5
5
  class Parser
6
6
 
7
- DEFAULT_REGEXP = Regexp.new('^#{1,2} ([\w\d\.-]+\.[\w\d\.-]+) ?\/? ?(\d{4}-\d{2}-\d{2}|\w+)?')
7
+ DEFAULT_REGEXP = Regexp.new('^#{0,3} ?([\w\d\.-]+\.[\w\d\.-]+[a-zA-Z0-9])( \/ (\d{4}-\d{2}-\d{2}|\w+))?\n?[=-]*')
8
8
 
9
9
  # Create a new changelog parser
10
10
  #
@@ -1,3 +1,3 @@
1
1
  module Vandamme
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -136,6 +136,47 @@ describe Vandamme::Parser do
136
136
  }
137
137
 
138
138
 
139
+ before do
140
+ @parser = Vandamme::Parser.new(changelog: changelog_file)
141
+ @changelog_parsed = @parser.parse
142
+ end
143
+
144
+ it "should parse file and fill changelog hash" do
145
+ expect(@changelog_parsed).to eq(changelog_as_hash)
146
+ end
147
+ end
148
+
149
+ context "Alternative markdown headers syntax" do
150
+ let(:changelog_file) {
151
+ <<-eos
152
+ Changelog
153
+ =========
154
+
155
+ X.Y.Z / Unreleased
156
+ ------------------
157
+
158
+ * Update API
159
+ * Fix bug #1
160
+
161
+ 1.2.3-pre.1 / 2013-02-14
162
+ ------------------------
163
+
164
+ * Update API
165
+
166
+ 1.0.0-x.7.z.92
167
+ --------------
168
+ eos
169
+ }
170
+
171
+ let(:changelog_as_hash) {
172
+ {
173
+ "X.Y.Z" => "* Update API \n* Fix bug #1",
174
+ "1.2.3-pre.1" => "* Update API ",
175
+ "1.0.0-x.7.z.92" => ""
176
+ }
177
+ }
178
+
179
+
139
180
  before do
140
181
  @parser = Vandamme::Parser.new(changelog: changelog_file)
141
182
  @changelog_parsed = @parser.parse
data/vandamme.gemspec CHANGED
@@ -21,5 +21,5 @@ Gem::Specification.new do |gem|
21
21
  gem.add_development_dependency 'rake','~> 10.0.2'
22
22
 
23
23
  gem.add_dependency 'github-markup', '~> 0.7.5'
24
- gem.add_dependency 'redcarpet', '~> 2.2.2'
24
+ gem.add_dependency 'redcarpet', '3.0.0'
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vandamme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-28 00:00:00.000000000 Z
12
+ date: 2013-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -64,17 +64,17 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 2.2.2
69
+ version: 3.0.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 2.2.2
77
+ version: 3.0.0
78
78
  description: Vandamme is aware of files content, and will be mostly used to parse
79
79
  changelog files and extract relevant content.
80
80
  email:
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: -1723865160074823590
115
+ hash: 371014573655272997
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: -1723865160074823590
124
+ hash: 371014573655272997
125
125
  requirements: []
126
126
  rubyforge_project:
127
127
  rubygems_version: 1.8.24