changelogerator 0.0.8 → 0.0.13
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/lib/changelogerator.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e44086f68d767a710aef577aa660002855118836df3ceffd5e30709913a2b88
|
4
|
+
data.tar.gz: 270dc478077bf3513c8fa855bd9ac6b052d30ea59280c041b6272cc6836712ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3863d0b58860acb3cb837fd14e7718db5125af49570ab64b899a039065885759de2eafd0bd5c1f6ecd3a86931789244b7dcdcdba078cc8a0951ea2d6c09747
|
7
|
+
data.tar.gz: cca5542837bc8d13985e3223a122b54d4d08403e988d8e3a1da5c42582c5e9bfd89fd2804565b2d0bcf4ab950d9550152153b8c59c5e7cc22d1aede2296b32d5
|
data/lib/changelogerator.rb
CHANGED
@@ -52,7 +52,7 @@ class Changelog
|
|
52
52
|
|
53
53
|
def self.changes_with_label(changes, label)
|
54
54
|
changes.select do |change|
|
55
|
-
change
|
55
|
+
change[:labels].any? { |c| c[:name] == label } == true
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -81,7 +81,7 @@ class Changelog
|
|
81
81
|
access_token: token
|
82
82
|
)
|
83
83
|
@prefix = prefix
|
84
|
-
@changes = prs_from_ids(pr_ids_from_git_diff(from, to))
|
84
|
+
@changes = prs_from_ids(pr_ids_from_git_diff(from, to)).map(&:to_hash)
|
85
85
|
# add priority to each change
|
86
86
|
@changes.map { |c| apply_priority_to_change(c) }
|
87
87
|
end
|
@@ -95,20 +95,22 @@ class Changelog
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def add(change)
|
98
|
-
changes.prepend(apply_priority_to_change(change))
|
98
|
+
changes.prepend(prettify_title(apply_priority_to_change(change)))
|
99
99
|
end
|
100
100
|
|
101
101
|
def add_from_id(id)
|
102
102
|
pull = @gh.pull_request(@repo, id)
|
103
|
-
add
|
103
|
+
add pull
|
104
104
|
end
|
105
105
|
|
106
106
|
private
|
107
107
|
|
108
108
|
def apply_priority_to_change(change)
|
109
109
|
@priorities.each do |p|
|
110
|
-
change[:priority] = p if change
|
110
|
+
change[:priority] = p if change[:labels].any? { |l| l[:name] == p[:label] }
|
111
111
|
end
|
112
|
+
# Failsafe: add lowest priority if none detected
|
113
|
+
change[:priority] ||= @priorities[0]
|
112
114
|
change
|
113
115
|
end
|
114
116
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: changelogerator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Pugh
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.1.2
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Changelog generation/management
|