conventional-changelog 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82e232d316b2991fe1ab21738840de315b4947d2
4
- data.tar.gz: 2c1cf594ac555f73d854a05aa42cc35f4a29e598
3
+ metadata.gz: f2a7f066856c013c2b967c40efba2c2678346524
4
+ data.tar.gz: ef029dbc2d5e73f287afad2d1dcabe72b55e98f8
5
5
  SHA512:
6
- metadata.gz: 030486a4cd67efcf2551c4ddfd9a32fa3d59b0994798ca45a402a0bb1b125cd9887df81f276bc72b08c4d731fa3ab2240b9532c67a9db916e89aa41dfca6f38c
7
- data.tar.gz: 235950400c1240ee2c29fa5f5b5393e485b1b3fc9bb6a53e5e34c9d35cde6725babadf4675c7c8a4ef9587b952df42f30dd2a4e68231c3b4f271c710ca0d5d66
6
+ metadata.gz: de608fb26f639768ae164e1eaae55de7e43eb9e70d92082de32222c9d6ec00000aa114dec6e74e80009b815c57237c53b1f6828aebb33b3339378846703e65c9
7
+ data.tar.gz: 830f57ae62f4f4e162a92a90bdf07f4c233bf40a05acc58b74ed6e998aafd35fdad0f38d80441a386c5c585830ae1ac587bc4f4c718e635b2cad09b3524a13de
@@ -1,5 +1,31 @@
1
- <a name="1.0.0"></a>
2
- ### 1.0.0 (2015-03-28)
1
+ <a name="v1.2.0"></a>
2
+ ### v1.2.0 (2015-03-31)
3
+
4
+
5
+ #### Features
6
+
7
+ * **output**
8
+ * support commits without scope ([3b127d7](/../../commit/3b127d7))
9
+
10
+
11
+ <a name="v1.1.0"></a>
12
+ ### v1.1.0 (2015-03-29)
13
+
14
+
15
+ #### Features
16
+
17
+ * **output**
18
+ * add a link to the change id ([c027a8f](/../../commit/c027a8f))
19
+
20
+ * **bin**
21
+ * conventional-changelog accepts a version=x.y.z param ([ccc8eec](/../../commit/ccc8eec))
22
+
23
+ * **api**
24
+ * Generator#generate accepts a version param ([69f8f72](/../../commit/69f8f72))
25
+
26
+
27
+ <a name="v1.0.0"></a>
28
+ ### v1.0.0 (2015-03-28)
3
29
 
4
30
 
5
31
  #### Features
data/README.md CHANGED
@@ -8,6 +8,8 @@ Generates a CHANGELOG.md file from Git metadata using the AngularJS commit conve
8
8
 
9
9
  - [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/)
10
10
 
11
+ Since version 1.2.0, the scopes are optional.
12
+
11
13
 
12
14
  ## Installation
13
15
 
@@ -17,14 +19,18 @@ Generates a CHANGELOG.md file from Git metadata using the AngularJS commit conve
17
19
  ## Usage
18
20
 
19
21
  $ conventional-changelog
22
+ $ conventional-changelog version=vX.Y.Z
20
23
 
21
24
  or programatically:
22
25
 
23
26
  ```ruby
24
27
  require 'conventional_changelog'
25
28
  ConventionalChangelog::Generator.new.generate!
29
+ ConventionalChangelog::Generator.new.generate! version: "vX.Y.Z"
26
30
  ```
27
31
 
32
+ Version param should follow your Git tags format
33
+
28
34
  ## Examples
29
35
 
30
36
  Converts this:
@@ -4,8 +4,8 @@ module ConventionalChangelog
4
4
 
5
5
  def self.commits(options)
6
6
  log(options).split("\n").map { |commit| commit.split DELIMITER }.select { |commit| options[:since_date].nil? or commit[1] > options[:since_date] }.map do |commit|
7
- comment = commit[2].match(/(.*)\((.*)\): (.*)/)
8
- { id: commit[0], date: commit[1], type: comment[1], component: comment[2], change: comment[3] }
7
+ comment = commit[2].match(/(\w*)(\(([\w\$\.\-\* ]*)\))?\: (.*)/)
8
+ { id: commit[0], date: commit[1], type: comment[1], component: comment[3], change: comment[4] }
9
9
  end
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module ConventionalChangelog
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -29,14 +29,18 @@ module ConventionalChangelog
29
29
  unless (type_commits = commits.select { |commit| commit[:type] == type }).empty?
30
30
  puts "#### #{title}", ""
31
31
  type_commits.group_by { |commit| commit[:component] }.each do |component, commits|
32
- puts "* **#{component}**"
33
- commits.each { |commit| puts " * #{commit[:change]} ([#{commit[:id]}](/../../commit/#{commit[:id]}))" }
32
+ puts "* **#{component}**" if component
33
+ commits.each { |commit| write_commit commit, component }
34
34
  puts ""
35
35
  end
36
36
  puts ""
37
37
  end
38
38
  end
39
39
 
40
+ def write_commit(commit, componentized)
41
+ puts "#{componentized ? ' ' : ''}* #{commit[:change]} ([#{commit[:id]}](/../../commit/#{commit[:id]}))"
42
+ end
43
+
40
44
  def write_section(commits, id)
41
45
  puts version_header(id)
42
46
  append_changes commits, "feat", "Features"
@@ -7,7 +7,7 @@ describe ConventionalChangelog::Generator do
7
7
  end
8
8
 
9
9
  it 'runs clean' do
10
- expect { subject.generate! }.to_not raise_exception
10
+ expect { subject.generate! }.to_not raise_exception
11
11
  end
12
12
 
13
13
  context "with no commits" do
@@ -36,6 +36,7 @@ describe ConventionalChangelog::Generator do
36
36
  LOG
37
37
  end
38
38
 
39
+
39
40
  it 'parses simple lines into dates' do
40
41
  subject.generate!
41
42
  body = <<-BODY
@@ -160,6 +161,37 @@ describe ConventionalChangelog::Generator do
160
161
  expect(File.open("CHANGELOG.md").read + "\n").to eql body
161
162
  end
162
163
  end
164
+
165
+ context "with no scope" do
166
+ let(:log) do <<-LOG
167
+ 4303fd4/////2015-03-30/////feat: increase reports ranges
168
+ 4303fd5/////2015-03-30/////fix: fix annoying bug
169
+ LOG
170
+ end
171
+
172
+ it 'creates changelog without scope' do
173
+ subject.generate!
174
+ body = <<-BODY
175
+ <a name="2015-03-30"></a>
176
+ ### 2015-03-30
177
+
178
+
179
+ #### Features
180
+
181
+ * increase reports ranges ([4303fd4](/../../commit/4303fd4))
182
+
183
+
184
+ #### Bug Fixes
185
+
186
+ * fix annoying bug ([4303fd5](/../../commit/4303fd5))
187
+
188
+
189
+
190
+ BODY
191
+ expect(File.open("CHANGELOG.md").read).to eql body
192
+ end
193
+ end
194
+
163
195
  end
164
196
  end
165
197
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conventional-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Carrion
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-29 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler