changelogerator 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/changelogerator +5 -4
- data/lib/changelogerator.rb +7 -6
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b7471810cc9cef7c45a8e3e299797131a6535eb3719160b27911f622ed9edc3
|
4
|
+
data.tar.gz: 7ba7b175da8540b9faefba07510736f484380ae698aa910480c69de4647220c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1b900314ed34b4b90de73ad40ebc946aa4e60f40fc3ed9801ad840088739b654452fbe226cf9233bcb881cec2bc7e742c431554cbb2b81209decc769bb2acf9
|
7
|
+
data.tar.gz: b413918b6710e7504f7ac1c750a1bdd1c00788f744c3168e25ff0ba85e1b6c13d985d368b3e50da8d872f047c3e072f6a656dbbda69e0e5a3749d2fe973ce02e
|
data/bin/changelogerator
CHANGED
@@ -16,12 +16,13 @@ logger.level = Logger::WARN
|
|
16
16
|
logger.debug('Starting')
|
17
17
|
|
18
18
|
OptionParser.new do |opts|
|
19
|
-
opts.banner =
|
20
|
-
|
21
|
-
|
19
|
+
opts.banner = 'Changelogerator
|
20
|
+
|
21
|
+
This utility helps generate a template friendly context made
|
22
|
+
of the changes between 2 references on your Github project.
|
22
23
|
|
23
24
|
Usage:
|
24
|
-
changelogerator <repo> [options]
|
25
|
+
changelogerator <repo> [options]'
|
25
26
|
|
26
27
|
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
|
27
28
|
@options[:verbose] = v
|
data/lib/changelogerator.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'pry'
|
4
|
-
|
5
3
|
# A small wrapper class for more easily generating and manipulating Github/Git
|
6
4
|
# changelogs. Given two different git objects (sha, tag, whatever), it will
|
7
5
|
# find all PRs that made up that diff and store them as a list. Also allows
|
@@ -84,7 +82,8 @@ class Changelog
|
|
84
82
|
)
|
85
83
|
@repository = @gh.repository(@repo)
|
86
84
|
@prefix = prefix
|
87
|
-
|
85
|
+
ids = pr_ids_from_git_diff(from, to)
|
86
|
+
@changes = prs_from_ids(ids)
|
88
87
|
@changes.map do |c|
|
89
88
|
compute_change_meta(c)
|
90
89
|
end
|
@@ -154,11 +153,13 @@ class Changelog
|
|
154
153
|
end
|
155
154
|
|
156
155
|
def pr_ids_from_git_diff(from, to)
|
157
|
-
@gh.compare(@repo, from, to).commits
|
156
|
+
commits = @gh.compare(@repo, from, to).commits
|
157
|
+
commits.map do |c|
|
158
158
|
title = c.commit.message.split("\n\n").first
|
159
|
-
|
159
|
+
regex = /.*#([0-9]+).*$/
|
160
|
+
next unless title =~ regex
|
160
161
|
|
161
|
-
title.gsub(
|
162
|
+
title.gsub(regex, '\1')
|
162
163
|
end.compact.map(&:to_i)
|
163
164
|
end
|
164
165
|
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: changelogerator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Pugh
|
8
|
+
- Wilfried Kopp
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
12
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: git_diff_parser
|
@@ -38,7 +39,8 @@ dependencies:
|
|
38
39
|
- - "~>"
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '4'
|
41
|
-
description:
|
42
|
+
description: A utility to fetch the data required to generate a changelog based on
|
43
|
+
change in Github and formatted labels.
|
42
44
|
email:
|
43
45
|
executables:
|
44
46
|
- changelogerator
|