keepachangelog 0.5.0 → 0.5.1

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: c215397c43999eed8396c30d3220d90e09a2bdc4
4
- data.tar.gz: 7308f595692c3b88e9eb03f5aeb1d8ec944534e9
3
+ metadata.gz: ac102da84255c733478723635d73a3de6e43d9c9
4
+ data.tar.gz: a2c7235b802c24dffb6b0126af91081368e88c0b
5
5
  SHA512:
6
- metadata.gz: 683825c4d04eb53302f1f24bbeb577d847a61f3a2ad6ccb2ebe60f8aab08367883d9bd36021ab654a509d679dcc7d5789875a047004e3a390ebc07d78c1ee5b3
7
- data.tar.gz: fd712b96a127ff809408277551adaa95cc00738cca69482a5fda4ea1b4e5796d91311fe1070505dc5c3f61fa778476833445179ce88f66e6b878f368f4a2e32f
6
+ metadata.gz: 335a86c0ee5e3e93c81819748a24dacf869e9a5a07b6abe1d934335b26bef9e5fb70b171cc3e5b84869a440cc1a7150b9adb71d4db86f85c061bded854083291
7
+ data.tar.gz: 7722088c0273a5f23254a13aaf5bba366666ea3c8d85e11bd32fa86e2de1487aa874bc9c2bb702f8f7b36a13c6c912ee5098af96623569ec2af7da6b903c5684
@@ -4,6 +4,13 @@ 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
+ ## [undefined]
8
+ ### Fixed
9
+ - Handle arbitrary name for unreleased version when creating URL in Markdown.
10
+
11
+ ### New
12
+ - The YAML parser now fetches the date when a version was created.
13
+
7
14
  ## [0.5.0] - 2017-04-04
8
15
  ### Fixed
9
16
  - Lines that end with special characters will no longer result in a crash. (#10)
@@ -53,6 +60,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
53
60
  - Tool for reading Changelog in Markdown format.
54
61
  - Ability to convert Changelog to YAML.
55
62
 
63
+ [undefined]: https://gitlab.com/ephracis/keepachangelog/compare/0.5.0...HEAD
56
64
  [0.5.0]: https://gitlab.com/ephracis/keepachangelog/compare/0.4.1...0.5.0
57
65
  [0.4.1]: https://gitlab.com/ephracis/keepachangelog/compare/0.4.0...0.4.1
58
66
  [0.4.0]: https://gitlab.com/ephracis/keepachangelog/compare/0.3.1...0.4.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keepachangelog (0.5.0)
4
+ keepachangelog (0.5.1)
5
5
  json (~> 2.0)
6
6
  thor (~> 0.19)
7
7
 
@@ -84,4 +84,4 @@ DEPENDENCIES
84
84
  simplecov (~> 0.14)
85
85
 
86
86
  BUNDLED WITH
87
- 1.14.3
87
+ 1.14.6
@@ -0,0 +1,3 @@
1
+ ---
2
+ title: Handle arbitrary name for unreleased version when creating URL in Markdown
3
+ type: Fixed
@@ -0,0 +1,3 @@
1
+ ---
2
+ title: The YAML parser now fetches the date when a version was created
3
+ type: New
@@ -104,7 +104,17 @@ module Keepachangelog
104
104
 
105
105
  def initialize_version(version)
106
106
  return if parsed_content['versions'][version]
107
- parsed_content['versions'][version] = { 'changes' => {} }
107
+ parsed_content['versions'][version] = {
108
+ 'changes' => {},
109
+ 'date' => version_date(version)
110
+ }
111
+ end
112
+
113
+ def version_date(version)
114
+ date = `git log -1 --format=%aI #{version} 2>/dev/null`.strip
115
+ DateTime.parse(date).strftime('%Y-%m-%d')
116
+ rescue
117
+ Gem::Version.correct?(version) ? DateTime.now.strftime('%Y-%m-%d') : nil
108
118
  end
109
119
  end
110
120
  end
@@ -44,7 +44,7 @@ module Keepachangelog
44
44
 
45
45
  def version(header, content)
46
46
  [
47
- version_header(header),
47
+ version_header(header, content['date']),
48
48
  content['changes'].map { |k, v| section(k, v) }
49
49
  ]
50
50
  end
@@ -65,7 +65,7 @@ module Keepachangelog
65
65
 
66
66
  def anchor(v, i)
67
67
  from_v = i == v.length - 1 ? first_commit : v[i + 1]
68
- to_v = v[i] == 'Unreleased' ? 'HEAD' : v[i]
68
+ to_v = Gem::Version.correct?(v[i]) ? v[i] : 'HEAD'
69
69
  "[#{v[i]}]: #{options[:url]}/compare/#{from_v}...#{to_v}"
70
70
  end
71
71
 
@@ -89,17 +89,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/)."
89
89
  .strip
90
90
  end
91
91
 
92
- def version_date(version)
93
- date = `git log -1 --format=%aI #{version} 2>/dev/null`.strip
94
- DateTime.parse(date).strftime('%Y-%m-%d')
95
- rescue
96
- Gem::Version.correct?(version) ? DateTime.now.strftime('%Y-%m-%d') : nil
97
- end
98
-
99
- def version_header(version)
92
+ def version_header(version, date)
100
93
  header = version
101
94
  header = "[#{header}]" if options[:url]
102
- date = version_date(version)
103
95
  header += " - #{date}" if date
104
96
  "## #{header}"
105
97
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keepachangelog",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Parser for changelogs based on keepachangelog.com",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,7 +20,8 @@ type: New
20
20
  '1.2.3' => {
21
21
  'changes' => {
22
22
  'New' => ['Test: Here we are testing to parse `something`.']
23
- }
23
+ },
24
+ 'date' => DateTime.now.strftime('%Y-%m-%d')
24
25
  }
25
26
  }
26
27
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keepachangelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Basalt AB
@@ -160,6 +160,8 @@ files:
160
160
  - changelog/0.5.0/11-default-date.yaml
161
161
  - changelog/0.5.0/9-allow-any-name-for-unreleased.yaml
162
162
  - changelog/meta.yaml
163
+ - changelog/undefined/13-compare-non-proper-version.yaml
164
+ - changelog/undefined/14-json-dates.yaml
163
165
  - exe/keepachangelog
164
166
  - features/help.feature
165
167
  - features/parser.feature