changelogerator 0.9.0 → 0.9.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
  SHA256:
3
- metadata.gz: b292e9657833099e9623ee12bc856d1212fe047a0fc3da90ef7192ab305c2f6d
4
- data.tar.gz: 24fab3a02631ae80b4ab8b810b8aee5b9fd9340280bfce389247dfb19d215ef6
3
+ metadata.gz: 8b7471810cc9cef7c45a8e3e299797131a6535eb3719160b27911f622ed9edc3
4
+ data.tar.gz: 7ba7b175da8540b9faefba07510736f484380ae698aa910480c69de4647220c5
5
5
  SHA512:
6
- metadata.gz: 28564cd68a1ebd4d4917e8f43339551a144edac68fa242ce1b3248e0f123e9835040d8c267e51755bfb0a3e09a26fb22214605ace98212b9bdc573b54c0265a0
7
- data.tar.gz: b9c23322c65362bdee0f6535982d4c349bde39092f99457901bebe48d5ba9d77e5484faab552ed81a5f786976024dc68f600eeaa85a34a578a50df6ec560f7dd
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
- Changelogerator helps you generate a template friendly context made of the changes
21
- between 2 references on your Github project.
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
@@ -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
- @changes = prs_from_ids(pr_ids_from_git_diff(from, to))
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.map do |c|
156
+ commits = @gh.compare(@repo, from, to).commits
157
+ commits.map do |c|
158
158
  title = c.commit.message.split("\n\n").first
159
- next unless title =~ /\(#[0-9]+\)$/
159
+ regex = /.*#([0-9]+).*$/
160
+ next unless title =~ regex
160
161
 
161
- title.gsub(/.*#([0-9]+)\)$/, '\1')
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.0
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-09 00:00:00.000000000 Z
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: Simple helper class for paritytech/polkadot changelogs
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