bake-modernize 0.14.1 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/bake/modernize/license.rb +41 -0
- data/lib/bake/modernize/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: e47d126f23b96ed593098da55ac6b7d66d8da92e92e7c2e68525a8ac9d492702
|
4
|
+
data.tar.gz: 7f3c41662a9fd909a721d6e68286ab8968cb5f11717010a5d6adb230fdb51b71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fb1cd52d9464fe4c6b746003b170204fba329c24bf485ab8da6bb40add0415821fd753d2a9a2397667d302b50f3632b7f3ff693aada11e5e6e3031f6be416e9
|
7
|
+
data.tar.gz: a485d8c283beb8a6414abd52e1823635950f743a6f9dfdf4471fc6cf4756d8ce796ebcf138b59270f8e16f8795e6798731cc3095cb78b02dfae8d7e4a11e0990
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# Copyright, 2022, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'rugged'
|
7
|
+
require 'yaml'
|
7
8
|
|
8
9
|
module Bake
|
9
10
|
module Modernize
|
@@ -42,6 +43,35 @@ module Bake
|
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
46
|
+
class Contributors
|
47
|
+
# The default path is the root of the repository and for authors who have contributed to the entire repository or unspecified paths in the past.
|
48
|
+
DEFAULT_PATH = '.'
|
49
|
+
|
50
|
+
def self.for(root)
|
51
|
+
full_path = File.join(root, '.contributors.yaml')
|
52
|
+
|
53
|
+
if File.exist?(full_path)
|
54
|
+
contributors = self.new
|
55
|
+
contributors.extract(full_path)
|
56
|
+
return contributors
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def initialize
|
61
|
+
@contributions = []
|
62
|
+
end
|
63
|
+
|
64
|
+
def each(&block)
|
65
|
+
@contributions.each do |contribution|
|
66
|
+
yield (contribution[:path] || DEFAULT_PATH), contribution[:author], contribution[:time]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def extract(path)
|
71
|
+
YAML.load_file(path, aliases: true, symbolize_names: true, permitted_classes: [Date, Time])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
45
75
|
class Authorship
|
46
76
|
Modification = Struct.new(:author, :time, :path) do
|
47
77
|
def full_name
|
@@ -66,9 +96,20 @@ module Bake
|
|
66
96
|
|
67
97
|
attr :paths
|
68
98
|
|
99
|
+
def add(author, time, path)
|
100
|
+
@paths[path] ||= []
|
101
|
+
@paths[path] << Modification.new(author, time, path)
|
102
|
+
end
|
103
|
+
|
69
104
|
def extract(root = Dir.pwd)
|
70
105
|
mailmap = Mailmap.for(root)
|
71
106
|
|
107
|
+
if contributors = Contributors.for(root)
|
108
|
+
contributors.each do |author, time, path|
|
109
|
+
add(author, time, path)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
72
113
|
walk(Rugged::Repository.discover(root), mailmap: mailmap)
|
73
114
|
|
74
115
|
return self
|
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.14.
|
4
|
+
version: 0.14.3
|
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-01-
|
41
|
+
date: 2023-01-18 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
|