bake-modernize 0.45.0 → 0.46.0

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: 3af72d311492e8aa5c1a7345d4c7311fae87b71c3e9f50113d2fb27b56ab943a
4
- data.tar.gz: 7ce73daf0491e8fb1fa65f298bafc6e16f9c61fc4d0372db36cd494f05d87de6
3
+ metadata.gz: 992b5b95403456b3a11eb441febb6500078d31a484ecd48fadec8ae3e26ad235
4
+ data.tar.gz: 869db9aa228cdb177b9ccd7e6874828e8aff1d181a13b7ffaf411cbbda1be398
5
5
  SHA512:
6
- metadata.gz: 995901876634184f2132568518e19f248d203e3de0fa8c8cafa8f640e0411677fe1ed68c5730556b2ac5769569f253f414b36a1a2f387c11883133186c84228f
7
- data.tar.gz: a7fa10e693f52bc5a114b41fc36b1dfd4c2b7d405a59b5c999377075237597e6f25ab6a8c79e5c414fe89a91a0d07924ac1c453c9d80641b8c81834abec1c9cb
6
+ metadata.gz: 7f052902f3c11da2fa126817f84eb1bdecb0562cb8a4c6454b781f7226a847ffd9d3eeaa333daff2c27979fcdb6190fcd9ea64a37d02ec98460d71509cb3ded5
7
+ data.tar.gz: d5093403e4105527f9609d8833a3716b3f9e05ceea151bd650640415073ce8adf1b5df63badd81ce27093962855f862dd63a5a8929c4446aee2e23728cad7d3e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -110,27 +110,36 @@ module Bake
110
110
  DEFAULT_PATH = "."
111
111
 
112
112
  # Load contributors from a directory.
113
- def self.for(root)
113
+ def self.for(root, mailmap: nil)
114
114
  full_path = File.join(root, ".contributors.yaml")
115
115
 
116
116
  if File.exist?(full_path)
117
- contributors = self.new
117
+ contributors = self.new(mailmap: mailmap)
118
118
  contributors.extract(full_path)
119
119
  return contributors
120
120
  end
121
121
  end
122
122
 
123
123
  # Create a new, empty, contributors list.
124
- def initialize
124
+ def initialize(mailmap: nil)
125
125
  @contributions = []
126
+ @mailmap = mailmap
126
127
  end
127
128
 
129
+ # @attribute [Array(Hash)] The list of contributions.
130
+ attr :contributions
131
+
128
132
  # Iterate over each contribution.
129
133
  def each(&block)
130
134
  @contributions.each do |contribution|
131
- author = contribution[:author]
135
+ author = contribution[:author].dup
132
136
  time = contribution[:time]
133
137
 
138
+ # Apply mailmap transformation if available
139
+ if @mailmap && author[:email] && mapped_name = @mailmap.names[author[:email]]
140
+ author[:name] = mapped_name
141
+ end
142
+
134
143
  paths_for(contribution) do |path|
135
144
  yield path, author, time
136
145
  end
@@ -220,7 +229,7 @@ module Bake
220
229
  mailmap = Mailmap.for(root)
221
230
  skip_list = SkipList.for(root)
222
231
 
223
- if contributors = Contributors.for(root)
232
+ if contributors = Contributors.for(root, mailmap: mailmap)
224
233
  contributors.each do |path, author, time|
225
234
  add(path, author, time)
226
235
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Bake
7
7
  module Modernize
8
- VERSION = "0.45.0"
8
+ VERSION = "0.46.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ���`���;���D���� ��"���'c���c��� Pm��x�`���w��E��O�:���Nkm.��'��-ڭ�r�3%�ӃK �!�<�+w��@�O����ff �j�^������X�wr��=�Ed��5?6��(����� ]� ¸��|!���3,��@r�5��
2
- �̟sۅS��v���u���~]j]5!G�$�JTL��F0R�3)7D�Г* x�<���6����]Mԋ�=>�'<=�|1mS��f��&@#U��h{���.VxtJ�����?'�F��?��@�f|KM�ꄿ���#��t��}H���b椕��������7,��j�� ��/���#���
1
+ 1ړ��bna}�w=2
2
+ &���#|�6�<�7�O���>�Y�!-筿h�%[f7��s���k6qG���@���;���IX�F{�ȔU�~|���
3
+ ���
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-modernize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.45.0
4
+ version: 0.46.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file