bake-modernize 0.17.2 → 0.17.4
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
- checksums.yaml.gz.sig +0 -0
- data/bake/modernize/gemspec.rb +28 -3
- data/lib/bake/modernize/license.rb +38 -2
- data/lib/bake/modernize/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -16
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65d6b9a42133ae86ab48a97a908f5539b0223f1bf7fec948f5f3cd20d178e043
|
|
4
|
+
data.tar.gz: 7390a861caca26af8389d00da3409722eb08632f4a2e7f0db4c6938ba12e2c42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44a727be6bc7dd4e3a4edd7b6d4b022139314fecd9b8305cdc2e573f5eee726cedb81873cb25362900038c851a6e8bf483f218ae043479069110a61cd5cd81fc
|
|
7
|
+
data.tar.gz: 7dc3a78ad44ce97113ca1e63558e059c14c168a9b6ef6563f899b5ad14695a661aabd57f6457df5f404b37002d2b8a22f38cb0a8b0f41d0635498061f92ad83c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/bake/modernize/gemspec.rb
CHANGED
|
@@ -110,9 +110,11 @@ def update(path: default_gemspec_path, output: $stdout)
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
if spec.development_dependencies.any?
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
unless move_development_dependencies(spec.development_dependencies)
|
|
114
|
+
output.puts "\t"
|
|
115
|
+
spec.development_dependencies.sort.each do |dependency|
|
|
116
|
+
output.puts "\tspec.add_development_dependency #{format_dependency(dependency)}"
|
|
117
|
+
end
|
|
116
118
|
end
|
|
117
119
|
end
|
|
118
120
|
|
|
@@ -236,3 +238,26 @@ def sorted_authors(spec)
|
|
|
236
238
|
|
|
237
239
|
return authors.sort_by{|k,v| [-v, k]}.map(&:first)
|
|
238
240
|
end
|
|
241
|
+
|
|
242
|
+
IGNORE_GEMS = %w[
|
|
243
|
+
bundler
|
|
244
|
+
].freeze
|
|
245
|
+
|
|
246
|
+
def move_development_dependencies(dependencies)
|
|
247
|
+
gemfile_path = File.expand_path("gems.rb")
|
|
248
|
+
|
|
249
|
+
if File.exist?(gemfile_path)
|
|
250
|
+
File.open(gemfile_path, "a") do |file|
|
|
251
|
+
file.puts
|
|
252
|
+
file.puts "# Moved Development Dependencies"
|
|
253
|
+
|
|
254
|
+
dependencies.each do |dependency|
|
|
255
|
+
next if IGNORE_GEMS.include?(dependency.name)
|
|
256
|
+
|
|
257
|
+
file.puts "gem #{format_dependency(dependency)}"
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
true
|
|
262
|
+
end
|
|
263
|
+
end
|
|
@@ -9,6 +9,39 @@ require 'yaml'
|
|
|
9
9
|
module Bake
|
|
10
10
|
module Modernize
|
|
11
11
|
module License
|
|
12
|
+
GIT_BLAME_IGNORE_REVS = ".git-blame-ignore-revs"
|
|
13
|
+
|
|
14
|
+
class SkipList
|
|
15
|
+
def self.for(root)
|
|
16
|
+
full_path = File.join(root, GIT_BLAME_IGNORE_REVS)
|
|
17
|
+
|
|
18
|
+
if File.exist?(full_path)
|
|
19
|
+
skip_list = self.new
|
|
20
|
+
skip_list.extract(full_path)
|
|
21
|
+
return skip_list
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def initialize(revisions = [])
|
|
26
|
+
@revisions = Set.new(revisions)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def extract(path)
|
|
30
|
+
File.open(path, 'r') do |file|
|
|
31
|
+
file.each_line do |line|
|
|
32
|
+
# Skip empty lines and comments
|
|
33
|
+
next if line =~ /^\s*(#|$)/
|
|
34
|
+
# Parse line
|
|
35
|
+
@revisions << line.strip
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def ignore?(commit)
|
|
41
|
+
@revisions.include?(commit.oid)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
12
45
|
class Mailmap
|
|
13
46
|
def self.for(root)
|
|
14
47
|
full_path = File.join(root, '.mailmap')
|
|
@@ -119,6 +152,7 @@ module Bake
|
|
|
119
152
|
|
|
120
153
|
def extract(root = Dir.pwd)
|
|
121
154
|
mailmap = Mailmap.for(root)
|
|
155
|
+
skip_list = SkipList.for(root)
|
|
122
156
|
|
|
123
157
|
if contributors = Contributors.for(root)
|
|
124
158
|
contributors.each do |path, author, time|
|
|
@@ -126,7 +160,7 @@ module Bake
|
|
|
126
160
|
end
|
|
127
161
|
end
|
|
128
162
|
|
|
129
|
-
walk(Rugged::Repository.discover(root), mailmap: mailmap)
|
|
163
|
+
walk(Rugged::Repository.discover(root), mailmap: mailmap, skip_list: skip_list)
|
|
130
164
|
|
|
131
165
|
return self
|
|
132
166
|
end
|
|
@@ -151,8 +185,10 @@ module Bake
|
|
|
151
185
|
|
|
152
186
|
DEFAULT_SORT = Rugged::SORT_DATE | Rugged::SORT_TOPO | Rugged::SORT_REVERSE
|
|
153
187
|
|
|
154
|
-
def walk(repository, mailmap: nil, show: "HEAD")
|
|
188
|
+
def walk(repository, mailmap: nil, skip_list: nil, show: "HEAD")
|
|
155
189
|
Rugged::Walker.walk(repository, show: show, sort: DEFAULT_SORT) do |commit|
|
|
190
|
+
next if skip_list&.ignore?(commit)
|
|
191
|
+
|
|
156
192
|
diff = commit.diff
|
|
157
193
|
|
|
158
194
|
# We relax the threshold for copy and rename detection because we want to detect files that have been moved and modified more generously.
|
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.
|
|
4
|
+
version: 0.17.4
|
|
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-
|
|
41
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
|
42
42
|
dependencies:
|
|
43
43
|
- !ruby/object:Gem::Dependency
|
|
44
44
|
name: async-http
|
|
@@ -110,20 +110,6 @@ dependencies:
|
|
|
110
110
|
- - ">="
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
112
|
version: '0'
|
|
113
|
-
- !ruby/object:Gem::Dependency
|
|
114
|
-
name: sus
|
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
|
116
|
-
requirements:
|
|
117
|
-
- - ">="
|
|
118
|
-
- !ruby/object:Gem::Version
|
|
119
|
-
version: '0'
|
|
120
|
-
type: :development
|
|
121
|
-
prerelease: false
|
|
122
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
123
|
-
requirements:
|
|
124
|
-
- - ">="
|
|
125
|
-
- !ruby/object:Gem::Version
|
|
126
|
-
version: '0'
|
|
127
113
|
description:
|
|
128
114
|
email:
|
|
129
115
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|