vandamme 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.0.4 / 2013-03-28
2
+
3
+ * The parser constructor parameter "version_header_exp" is now optional, and will default to changelog convention regexp.
4
+
5
+ # 0.0.3 / 2013-03-19
6
+
7
+ * Fix html rendering, especially with markdown format
8
+
1
9
  # 0.0.2 / 2013-01-06
2
10
 
3
11
  * Fix gem dependencies (to githup-markup)
@@ -4,17 +4,21 @@ 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+)?')
8
+
7
9
  # Create a new changelog parser
8
10
  #
9
11
  # Options:
10
12
  # * +changelog+:: Changelog content as a +String+.
11
- # * +version_header_exp+:: regexp to match the starting line of version.
13
+ # * +version_header_exp+ (optional):: regexp to match the starting line of version.
14
+ # Defaults to /^#{1,2} ([\w\d\.-]+\.[\w\d\.-]+) ?\/? ?(\d{4}-\d{2}-\d{2}|\w+)?/
15
+ # See http://tech-angels.github.com/vandamme/#changelogs-convention
12
16
  # * +format+ (optional):: One of "raw", "markdown", "rdoc"
13
17
  #
14
18
  #
15
19
  def initialize(options={})
16
20
  @changelog = options.fetch :changelog
17
- regexp = options.fetch :version_header_exp
21
+ regexp = options[:version_header_exp] || DEFAULT_REGEXP
18
22
  @version_header_exp = regexp.is_a?(Regexp) ? regexp : Regexp.new(/#{regexp}/)
19
23
  @match_group = options[:match_group] || 0
20
24
  @format = options[:format] || :raw
@@ -1,3 +1,3 @@
1
1
  module Vandamme
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -108,4 +108,41 @@ describe Vandamme::Parser do
108
108
  expect(@parser.to_html).to eq(changelog_as_html_hash)
109
109
  end
110
110
  end
111
+
112
+ context "Changelog Convention default regexp" do
113
+ # The convention now accepts level 2 headers
114
+ # and an optional release date:
115
+ let(:changelog_file) {
116
+ <<-eos
117
+ # X.Y.Z / Unreleased
118
+
119
+ * Update API
120
+ * Fix bug #1
121
+
122
+ ## 1.2.3-pre.1 / 2013-02-14
123
+
124
+ * Update API
125
+
126
+ # 1.0.0-x.7.z.92
127
+ eos
128
+ }
129
+
130
+ let(:changelog_as_hash) {
131
+ {
132
+ "X.Y.Z" => "* Update API \n* Fix bug #1",
133
+ "1.2.3-pre.1" => "* Update API ",
134
+ "1.0.0-x.7.z.92" => ""
135
+ }
136
+ }
137
+
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
111
148
  end
data/vandamme.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["philippe.lafoucriere@tech-angels.com"]
11
11
  gem.description = %q{Vandamme is aware of files content, and will be mostly used to parse changelog files and extract relevant content.}
12
12
  gem.summary = %q{Be aware of changelogs content}
13
- gem.homepage = "https://github.com/tech-angels/vandamme"
13
+ gem.homepage = "http://tech-angels.github.com/vandamme/"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vandamme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Philippe Lafoucrière
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-03-19 00:00:00.000000000 Z
12
+ date: 2013-03-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rspec
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: github-markup
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: redcarpet
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -89,28 +98,35 @@ files:
89
98
  - spec/spec_helper.rb
90
99
  - spec/vandamme/parser_spec.rb
91
100
  - vandamme.gemspec
92
- homepage: https://github.com/tech-angels/vandamme
101
+ homepage: http://tech-angels.github.com/vandamme/
93
102
  licenses: []
94
- metadata: {}
95
103
  post_install_message:
96
104
  rdoc_options: []
97
105
  require_paths:
98
106
  - lib
99
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
100
109
  requirements:
101
- - - '>='
110
+ - - ! '>='
102
111
  - !ruby/object:Gem::Version
103
112
  version: '0'
113
+ segments:
114
+ - 0
115
+ hash: -1723865160074823590
104
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
105
118
  requirements:
106
- - - '>='
119
+ - - ! '>='
107
120
  - !ruby/object:Gem::Version
108
121
  version: '0'
122
+ segments:
123
+ - 0
124
+ hash: -1723865160074823590
109
125
  requirements: []
110
126
  rubyforge_project:
111
- rubygems_version: 2.0.2
127
+ rubygems_version: 1.8.24
112
128
  signing_key:
113
- specification_version: 4
129
+ specification_version: 3
114
130
  summary: Be aware of changelogs content
115
131
  test_files:
116
132
  - spec/fixtures/json.md
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 8ee8ed35dab6adecac9164680abdcf0f2834d867
4
- data.tar.gz: c5e0fde915f24e83cd1b109a2df0791e38e3d437
5
- SHA512:
6
- metadata.gz: f585d6ce0ce9fc437cfedaebc49a0af88e544bd5d843775ae123c619443b799065673e2ec600eb76153d6be3ac83cfaa4a624bf04feebc529208b97eb9e2eabf
7
- data.tar.gz: 30b579987fdf59d4445c2680b312c0348a087afadd814a44c662dd08005f07e40195d77bd994ee3b981000c5b8be550c16817e2c7602a1468c1d8c16a5065124