conventional-changelog 1.2.1 → 1.2.2

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: ce0cf32de55422c10a531945e26796461ea641e2
4
- data.tar.gz: 7d31b4086fabc18b11380d1cdae9700c1036af31
3
+ metadata.gz: 2071ea87d3cc1351bb5af23371ce7ccf983095d0
4
+ data.tar.gz: 6c997b3a58da55c0ef8772a7432a7e476eb33a2a
5
5
  SHA512:
6
- metadata.gz: 530c060bb2db10a50be6df9df2dbb2abec50886b344687b17910c4e0197ce29d1a9ecca37b6c87e57ce22a67946bd03b617f3bcae412f7b73728da62359a9322
7
- data.tar.gz: d0600c7e482b0b77bf1f22cc2dc9209a292ba88f7a58753af3875b64f52ec5e2718a2e50368f6873e66a1e19385c6b5ac67283ca845f08a8b863b766b1b87a12
6
+ metadata.gz: 8fc529d5b97c661e9bd46c87d656fe37924773990ae1237d0609537d00de1e884df01416932c46f4f18ab5e310c4c054df9fabd8fe685af2f607e4c8a3db4815
7
+ data.tar.gz: 666eed3f55e4d2f1933084913f198c0403a3727ba209909075d8a52231a2b107839b0079004321a65f34319203e67ba0560b2c4219340cdeb5cf20380cea9fce
data/README.md CHANGED
@@ -74,7 +74,7 @@ into this:
74
74
 
75
75
  ## Contributing
76
76
 
77
- 1. Fork it ( https://github.com/[my-github-username]/conventional-changelog/fork )
77
+ 1. Fork it ( https://github.com/dcrec1/conventional-changelog-ruby/fork )
78
78
  2. Create your feature branch (`git checkout -b my-new-feature`)
79
79
  3. Commit your changes (`git commit -am 'Add some feature'`)
80
80
  4. Push to the branch (`git push origin my-new-feature`)
@@ -7,7 +7,7 @@ module ConventionalChangelog
7
7
  end
8
8
 
9
9
  def write_new_lines(options)
10
- commits.group_by { |commit| commit[:date] }.sort.reverse.each do |date, commits|
10
+ commits.group_by { |commit| commit[:date] }.sort.reverse_each do |date, commits|
11
11
  write_section commits, date
12
12
  end
13
13
  end
@@ -4,7 +4,6 @@ module ConventionalChangelog
4
4
  Generator.new.generate! parse(params)
5
5
  end
6
6
 
7
- private
8
7
  def self.parse(params)
9
8
  Hash[*params.map { |param| param.split("=") }.map { |key, value| [key.to_sym, value] }.flatten]
10
9
  end
@@ -5,12 +5,11 @@ module ConventionalChangelog
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
7
  comment = commit[2].match(/(\w*)(\(([\w\$\.\-\* ]*)\))?\: (.*)/)
8
+ next unless comment
8
9
  { id: commit[0], date: commit[1], type: comment[1], component: comment[3], change: comment[4] }
9
- end
10
+ end.compact
10
11
  end
11
12
 
12
- private
13
-
14
13
  def self.log(options)
15
14
  `git log --pretty=format:"%h#{DELIMITER}%ad#{DELIMITER}%s%x09" --date=short --grep="^(feat|fix)(\\(.*\\))?:" -E #{version_filter(options)}`
16
15
  end
@@ -1,3 +1,3 @@
1
1
  module ConventionalChangelog
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -28,9 +28,9 @@ module ConventionalChangelog
28
28
  def append_changes(commits, type, title)
29
29
  unless (type_commits = commits.select { |commit| commit[:type] == type }).empty?
30
30
  puts "#### #{title}", ""
31
- type_commits.group_by { |commit| commit[:component] }.each do |component, commits|
31
+ type_commits.group_by { |commit| commit[:component] }.each do |component, component_commits|
32
32
  puts "* **#{component}**" if component
33
- commits.each { |commit| write_commit commit, component }
33
+ component_commits.each { |commit| write_commit commit, component }
34
34
  puts ""
35
35
  end
36
36
  puts ""
@@ -25,6 +25,38 @@ describe ConventionalChangelog::Generator do
25
25
  end
26
26
  end
27
27
 
28
+ context "with merge commit" do
29
+ before :each do
30
+ allow(ConventionalChangelog::Git).to receive(:log).and_return log
31
+ end
32
+
33
+ context "skip merged commit" do
34
+ let(:log) do <<-LOG
35
+ 4303fd4/////2015-03-30/////feat(admin): increase reports ranges
36
+ 430fa51/////2015-03-31/////Merge branch 'develop' into 'master'
37
+ LOG
38
+ end
39
+
40
+ it 'does not contain merge commit' do
41
+ subject.generate!
42
+ body = <<-BODY
43
+ <a name="2015-03-30"></a>
44
+ ### 2015-03-30
45
+
46
+
47
+ #### Features
48
+
49
+ * **admin**
50
+ * increase reports ranges ([4303fd4](/../../commit/4303fd4))
51
+
52
+
53
+
54
+ BODY
55
+ expect(changelog).to eql body
56
+ end
57
+ end
58
+ end
59
+
28
60
  context "with multiple commits" do
29
61
  before :each do
30
62
  allow(ConventionalChangelog::Git).to receive(:log).and_return log
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.2.1
4
+ version: 1.2.2
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-04-12 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.2.2
131
+ rubygems_version: 2.4.5.1
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Ruby binary to generate a conventional changelog — Edit