knife-changelog 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/knife-changelog.gemspec +1 -0
- data/lib/knife/changelog/changelog.rb +30 -30
- data/lib/knife/changelog/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba116e510147c69ec799adfddd749fdbc5e86a9
|
4
|
+
data.tar.gz: e52264b4ccfc9d0c3c32e4cf4ab7b085962a098c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4f3393f8359ee5b9c77f1c41b779b8672750fa670a26e54d09f48e4eeb9e4ace8b8b409a8fc6bbb9ae808c849f7268789664e5ed933192a10d0def344e69a36
|
7
|
+
data.tar.gz: e6c69313c42e4c19fa712259ea06d03de976e66599eb1cabe5b52c686e001b8b4d689935c8e22f9e6e7ef3a35532b963e5780f20fbcf05502655f191b7343f12
|
data/.rubocop.yml
ADDED
data/knife-changelog.gemspec
CHANGED
@@ -70,37 +70,36 @@ class KnifeChangelog
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def execute(name, submodule=false)
|
73
|
-
changelog = if submodule
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
format_changelog(name, changelog)
|
92
|
-
end
|
93
|
-
|
94
|
-
def format_changelog(name, changelog)
|
73
|
+
version_change, changelog = if submodule
|
74
|
+
handle_submodule(name)
|
75
|
+
elsif ck_dep(name).nil?
|
76
|
+
handle_new_cookbook(name)
|
77
|
+
else
|
78
|
+
loc = ck_location(name)
|
79
|
+
case loc
|
80
|
+
when NilClass
|
81
|
+
handle_source name, ck_dep(name)
|
82
|
+
when Berkshelf::GitLocation
|
83
|
+
handle_git name, loc
|
84
|
+
when Berkshelf::PathLocation
|
85
|
+
Chef::Log.debug "path location are always at the last version"
|
86
|
+
["", ""]
|
87
|
+
else
|
88
|
+
raise "Cannot handle #{loc.class} yet"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
format_changelog(name, version_change, changelog)
|
92
|
+
end
|
93
|
+
|
94
|
+
def format_changelog(name, version_change, changelog)
|
95
95
|
if changelog.empty?
|
96
96
|
nil
|
97
97
|
else
|
98
|
-
[
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
].compact.join("\n")
|
98
|
+
full = ["Changelog for #{name}: #{version_change}"]
|
99
|
+
full << '=' * full.first.size
|
100
|
+
full << changelog
|
101
|
+
full << ''
|
102
|
+
full.compact.join("\n")
|
104
103
|
end
|
105
104
|
end
|
106
105
|
|
@@ -187,7 +186,8 @@ class KnifeChangelog
|
|
187
186
|
Chef::Log.info "Found changelog file : " + $1
|
188
187
|
generate_from_changelog_file($1, cur_rev, rev_parse, tmp_dir)
|
189
188
|
end
|
190
|
-
changelog
|
189
|
+
changelog ||= generate_from_git_history(tmp_dir, location, cur_rev, rev_parse)
|
190
|
+
[ "#{cur_rev}->#{rev_parse}", changelog ]
|
191
191
|
end
|
192
192
|
|
193
193
|
def generate_from_changelog_file(filename, current_rev, rev_parse, tmp_dir)
|
@@ -215,7 +215,7 @@ class KnifeChangelog
|
|
215
215
|
|
216
216
|
def linkify(url, changelog)
|
217
217
|
changelog.map do |line|
|
218
|
-
line.gsub(/^([a-f0-9]+)
|
218
|
+
line.gsub(/^([a-f0-9]+) (.*)$/, '\2 (%s/commit/\1) ' % [url.chomp('.git')])
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: berkshelf
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +130,7 @@ extensions: []
|
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
118
132
|
- ".gitignore"
|
133
|
+
- ".rubocop.yml"
|
119
134
|
- ".travis.yml"
|
120
135
|
- Gemfile
|
121
136
|
- LICENSE.txt
|