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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +2 -2
- data/changelog/undefined/13-compare-non-proper-version.yaml +3 -0
- data/changelog/undefined/14-json-dates.yaml +3 -0
- data/lib/keepachangelog/parser/yaml.rb +11 -1
- data/lib/keepachangelog/printer/markdown.rb +3 -11
- data/package.json +1 -1
- data/spec/parser/yaml_spec.rb +2 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac102da84255c733478723635d73a3de6e43d9c9
|
4
|
+
data.tar.gz: a2c7235b802c24dffb6b0126af91081368e88c0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335a86c0ee5e3e93c81819748a24dacf869e9a5a07b6abe1d934335b26bef9e5fb70b171cc3e5b84869a440cc1a7150b9adb71d4db86f85c061bded854083291
|
7
|
+
data.tar.gz: 7722088c0273a5f23254a13aaf5bba366666ea3c8d85e11bd32fa86e2de1487aa874bc9c2bb702f8f7b36a13c6c912ee5098af96623569ec2af7da6b903c5684
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/Gemfile.lock
CHANGED
@@ -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] = {
|
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]
|
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
|
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
|
data/package.json
CHANGED
data/spec/parser/yaml_spec.rb
CHANGED
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.
|
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
|