bake-modernize 0.17.0 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08439a38dc5093368958f4067f181d072c35631427bc7cdd4aaf0c01f92ac4b2'
4
- data.tar.gz: 18f75636b41aa9ccfd73f75279a7450390b9a350f66d0f5e60a09f92dcba3dac
3
+ metadata.gz: 3adf18f4bf40c41642f4a556147a3a5e17ffa0be5ddf7c500c560467f39f9ac4
4
+ data.tar.gz: 0de5d13a9a64c097282558d4874f5e8e8b5c4d6a89a2abe7aae3686ae45bb24f
5
5
  SHA512:
6
- metadata.gz: ce96787d866cb394a12d382ac3907b336f9e0e1c6cd72428710b05f5d1a3500543672ab37e21e10b9048d63869c47740a756f687357560c21ab37ef9f6b73f88
7
- data.tar.gz: 2f6bed57a621dd34e247af585947d7f13dbd9a468ab5335916335763455f44731b3f111ae7476ef51984c0ce2bc8e18ecdec6693df225c6a4180f8bbecdc74ee
6
+ metadata.gz: 558fab3ed955228a67a0a64fe513696fa5993db232546724638958d83f1493a70d5ebebd704ec49a2157c8c18ef88421ef9ee7af98ca728038c0d8cf111a4dd9
7
+ data.tar.gz: 32fb0451b53300d6d82cf52a9f1d91fbc8807ca0b62ea36140c0fb4a3cb9f7321b8ba4756a8576eef12ef7023dfeb2eda8916ed4f485ceec5a51c341cab97cd4
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
4
+ # Copyright, 2020-2023, by Samuel Williams.
5
5
 
6
6
  # Rewrite the current gemspec.
7
7
  def gemspec
@@ -154,8 +154,14 @@ module Bake
154
154
  def walk(repository, mailmap: nil, show: "HEAD")
155
155
  Rugged::Walker.walk(repository, show: show, sort: DEFAULT_SORT) do |commit|
156
156
  diff = commit.diff
157
- diff.find_similar!
158
-
157
+
158
+ # We relax the threshold for copy and rename detection because we want to detect files that have been moved and modified more generously.
159
+ diff.find_similar!(
160
+ rename_threshold: 25,
161
+ copy_threshold: 25,
162
+ ignore_whitespace: true,
163
+ )
164
+
159
165
  diff.each_delta do |delta|
160
166
  old_path = delta.old_file[:path]
161
167
  new_path = delta.new_file[:path]
@@ -164,6 +170,7 @@ module Bake
164
170
 
165
171
  if old_path != new_path
166
172
  # The file was moved, move copyright information too:
173
+ Console.logger.debug(self, "Moving #{old_path} to #{new_path}", similarity: delta.similarity)
167
174
  @paths[new_path].concat(@paths[old_path])
168
175
  end
169
176
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Bake
7
7
  module Modernize
8
- VERSION = "0.17.0"
8
+ VERSION = "0.17.2"
9
9
  end
10
10
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
4
+ # Copyright, 2020-2023, by Samuel Williams.
5
5
 
6
6
  require_relative 'modernize/license'
7
7
  require_relative 'modernize/version'
@@ -18,6 +18,14 @@ module Bake
18
18
  TEMPLATE_ROOT + path
19
19
  end
20
20
 
21
+ def self.stale?(source_path, destination_path)
22
+ if File.exist?(destination_path)
23
+ return !FileUtils.identical?(source_path, destination_path)
24
+ end
25
+
26
+ return true
27
+ end
28
+
21
29
  def self.copy_template(source_path, destination_path)
22
30
  glob = Build::Files::Glob.new(source_path, '**/*')
23
31
 
@@ -29,7 +37,7 @@ module Bake
29
37
  FileUtils.mkdir_p(full_path)
30
38
  end
31
39
  else
32
- unless FileUtils.identical?(path, full_path)
40
+ if stale?(path, full_path)
33
41
  FileUtils::Verbose.cp(path, full_path)
34
42
  end
35
43
  end
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.17.0
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2023-06-26 00:00:00.000000000 Z
41
+ date: 2023-06-28 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: async-http
metadata.gz.sig CHANGED
Binary file