bake-modernize 0.45.0 → 0.46.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: 3af72d311492e8aa5c1a7345d4c7311fae87b71c3e9f50113d2fb27b56ab943a
4
- data.tar.gz: 7ce73daf0491e8fb1fa65f298bafc6e16f9c61fc4d0372db36cd494f05d87de6
3
+ metadata.gz: '00156569dd171233da14edf9c88081de950bfb931870ae51e8815acfd930361c'
4
+ data.tar.gz: 6a38233ff156e2dda6a8dadf973b76665be7a371119b3e94a576993b4ec6664a
5
5
  SHA512:
6
- metadata.gz: 995901876634184f2132568518e19f248d203e3de0fa8c8cafa8f640e0411677fe1ed68c5730556b2ac5769569f253f414b36a1a2f387c11883133186c84228f
7
- data.tar.gz: a7fa10e693f52bc5a114b41fc36b1dfd4c2b7d405a59b5c999377075237597e6f25ab6a8c79e5c414fe89a91a0d07924ac1c453c9d80641b8c81834abec1c9cb
6
+ metadata.gz: 1772e2875430bcd070ee1d9bd79421e92af1a0ad0550dcc9744d0ea25bdf3e53e791096969882425f86c5cb9531d0a66a36e502cf3d5a071993a59e67672f111
7
+ data.tar.gz: e03a719f0c27f2979ba15599f307562fadcc4ce0f805ec4113cc880e7a9065652d6dbd561e53a821b08d675af6912c6e25e9e6ccaaa0edd0d669d5f1eeb6b587
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.1"
9
9
  end
10
10
  end
@@ -42,6 +42,7 @@ Layout/DefEndAlignment:
42
42
 
43
43
  Layout/CaseIndentation:
44
44
  Enabled: true
45
+ EnforcedStyle: end
45
46
 
46
47
  Layout/CommentIndentation:
47
48
  Enabled: true
data.tar.gz.sig CHANGED
Binary file
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.6.9
171
+ rubygems_version: 3.7.2
172
172
  specification_version: 4
173
173
  summary: Automatically modernize parts of your project/gem.
174
174
  test_files: []
metadata.gz.sig CHANGED
Binary file