keepachangelog 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e63e90c5940db3033ddb2f4e58e77437af51e43
4
- data.tar.gz: 8f30352f336656f66229df3eba5abbb4e2924149
3
+ metadata.gz: c215397c43999eed8396c30d3220d90e09a2bdc4
4
+ data.tar.gz: 7308f595692c3b88e9eb03f5aeb1d8ec944534e9
5
5
  SHA512:
6
- metadata.gz: 7d332fc8dc0d944376a22d7419a8e31aff436e89b18c533d5e3f1c26d8639b8c9cbb3b6a57ee5083120869d82e5628b8f2e841dedcac29c5324bf15c10fd4a20
7
- data.tar.gz: 2bf95c69b9f25c988c53f193735ef3fa254a2d81dd6be3e663c77cf2e7bd3c5909cc981a06f9828572384462a0efa5fd1c508082245a5eff661e0a81c16cf3cb
6
+ metadata.gz: 683825c4d04eb53302f1f24bbeb577d847a61f3a2ad6ccb2ebe60f8aab08367883d9bd36021ab654a509d679dcc7d5789875a047004e3a390ebc07d78c1ee5b3
7
+ data.tar.gz: fd712b96a127ff809408277551adaa95cc00738cca69482a5fda4ea1b4e5796d91311fe1070505dc5c3f61fa778476833445179ce88f66e6b878f368f4a2e32f
@@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
- ## [0.4.1]
7
+ ## [0.5.0] - 2017-04-04
8
+ ### Fixed
9
+ - Lines that end with special characters will no longer result in a crash. (#10)
10
+
11
+ ### Changed
12
+ - Date of a version in generated Markdown now defaults to current date instead of blank. (#11)
13
+
14
+ ### New
15
+ - Allow any name for unreleased versions. (#9)
16
+
17
+ ## [0.4.1] - 2017-03-30
8
18
  ### Fixed
9
19
  - Deploy job in CI will no longer be skipped even though it should run. (#8)
10
20
 
@@ -43,6 +53,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
43
53
  - Tool for reading Changelog in Markdown format.
44
54
  - Ability to convert Changelog to YAML.
45
55
 
56
+ [0.5.0]: https://gitlab.com/ephracis/keepachangelog/compare/0.4.1...0.5.0
46
57
  [0.4.1]: https://gitlab.com/ephracis/keepachangelog/compare/0.4.0...0.4.1
47
58
  [0.4.0]: https://gitlab.com/ephracis/keepachangelog/compare/0.3.1...0.4.0
48
59
  [0.3.1]: https://gitlab.com/ephracis/keepachangelog/compare/0.3.0...0.3.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keepachangelog (0.4.1)
4
+ keepachangelog (0.5.0)
5
5
  json (~> 2.0)
6
6
  thor (~> 0.19)
7
7
 
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Lines that end with special characters will no longer result in a crash
3
+ type: Fixed
4
+ issue: 10
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Date of a version in generated Markdown now defaults to current date instead of blank
3
+ issue: 11
4
+ type: Changed
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Allow any name for unreleased versions
3
+ issue: 9
4
+ type: New
@@ -33,8 +33,10 @@ Feature: Parse changelogs
33
33
 
34
34
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
35
35
  and this project adheres to [Semantic Versioning](http://semver.org/).
36
-
37
- ## 1.0.0
36
+ """
37
+ And the output should contain "## 1.0.0 - "
38
+ And the output should contain:
39
+ """
38
40
  ### New
39
41
  - Feature A.
40
42
  """
@@ -95,7 +95,7 @@ module Keepachangelog
95
95
 
96
96
  def generate_line(yaml)
97
97
  line = yaml['title']
98
- line += + '.' unless line =~ /[[:punct:]]$/
98
+ line += '.' unless line =~ /[[:punct:]]$/
99
99
  line += " (!#{yaml['merge_request']})" if yaml['merge_request']
100
100
  line += " (##{yaml['issue']})" if yaml['issue']
101
101
  line += " (#{yaml['author']})" if yaml['author']
@@ -26,11 +26,15 @@ module Keepachangelog
26
26
  end
27
27
 
28
28
  def compare_versions(a, b)
29
- a = Gem::Version.new(a) if Gem::Version.correct?(a)
30
- b = Gem::Version.new(b) if Gem::Version.correct?(b)
31
- return -1 if b == 'Unreleased'
32
- return 1 if a == 'Unreleased'
33
- a <=> b
29
+ if Gem::Version.correct?(a) && Gem::Version.correct?(b)
30
+ Gem::Version.new(a) <=> Gem::Version.new(b)
31
+ elsif Gem::Version.correct?(a)
32
+ -1
33
+ elsif Gem::Version.correct?(b)
34
+ 1
35
+ else
36
+ a <=> b
37
+ end
34
38
  end
35
39
 
36
40
  def clean_intro(text)
@@ -89,7 +93,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/)."
89
93
  date = `git log -1 --format=%aI #{version} 2>/dev/null`.strip
90
94
  DateTime.parse(date).strftime('%Y-%m-%d')
91
95
  rescue
92
- nil
96
+ Gem::Version.correct?(version) ? DateTime.now.strftime('%Y-%m-%d') : nil
93
97
  end
94
98
 
95
99
  def version_header(version)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keepachangelog",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Parser for changelogs based on keepachangelog.com",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@ module Keepachangelog
11
11
  it 'should parse single version' do
12
12
  content = "
13
13
  ---
14
- title: Feature A
14
+ title: 'Test: Here we are testing to parse `something`'
15
15
  type: New
16
16
  "
17
17
  cl = YamlParser.parse(content, '1.2.3')
@@ -19,7 +19,7 @@ type: New
19
19
  'versions' => {
20
20
  '1.2.3' => {
21
21
  'changes' => {
22
- 'New' => ['Feature A.']
22
+ 'New' => ['Test: Here we are testing to parse `something`.']
23
23
  }
24
24
  }
25
25
  }
@@ -20,6 +20,9 @@ module Keepachangelog
20
20
  '0.1.0' => {
21
21
  'changes' => { 'New' => ['Feature A'] }
22
22
  },
23
+ 'foo bar' => {
24
+ 'changes' => { 'New' => ['Feature D'] }
25
+ },
23
26
  '0.10.0' => {
24
27
  'changes' => { 'New' => ['Feature B'] }
25
28
  },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keepachangelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Basalt AB
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,6 +156,9 @@ files:
156
156
  - changelog/0.4.0/7-numeric-order.yaml
157
157
  - changelog/0.4.0/share-with-public.yaml
158
158
  - changelog/0.4.1/8-fix-deploy.yaml
159
+ - changelog/0.5.0/10-yaml-add-period.yaml
160
+ - changelog/0.5.0/11-default-date.yaml
161
+ - changelog/0.5.0/9-allow-any-name-for-unreleased.yaml
159
162
  - changelog/meta.yaml
160
163
  - exe/keepachangelog
161
164
  - features/help.feature