bake-modernize 0.14.0 → 0.14.2
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/bake/modernize/git.rb +2 -2
- data/lib/bake/modernize/license.rb +41 -0
- data/lib/bake/modernize/version.rb +1 -1
- data/license.md +1 -1
- data/template/actions/.github/workflows/coverage.yaml +2 -2
- data/template/actions/.github/workflows/documentation.yaml +1 -1
- data/template/actions/.github/workflows/test-external.yaml +1 -0
- data/template/actions/.github/workflows/test.yaml +1 -0
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: d59918cbe614fb303d0eb679b167205430ba98ad6584fb24408466a7d1a4da7a
|
4
|
+
data.tar.gz: 8a0fa7d2d03cd7851fabc5a38812f01e61704229a7be2caee72cc75769a7def9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d8594e2e976bd22619bbb34016c96e8fcd1622adba9610105a64c86ff06809405d6b16cd57a46215bb5b1262fbad05f2f6597dd1acaa991edaeb520bd1be57
|
7
|
+
data.tar.gz: b8db4b4096a4a409d179062c8652d2f10f6394fa92ca6bed74d82b7693dd1ada770f106f191014269183a0a07ce2ef8b1a63dc8625c7e60d0e163081ed0413e6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/modernize/git.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2023, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'bake/modernize'
|
7
7
|
|
@@ -10,7 +10,7 @@ def git
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def update(root:)
|
13
|
-
if current_branch
|
13
|
+
if current_branch == "master"
|
14
14
|
# https://github.com/github/renaming
|
15
15
|
system("git", "branch", "-M", "main")
|
16
16
|
system("git", "push", "-u", "origin", "main")
|
@@ -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)
|
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/license.md
CHANGED
@@ -21,7 +21,7 @@ jobs:
|
|
21
21
|
- macos
|
22
22
|
|
23
23
|
ruby:
|
24
|
-
- "3.
|
24
|
+
- "3.2"
|
25
25
|
|
26
26
|
steps:
|
27
27
|
- uses: actions/checkout@v3
|
@@ -47,7 +47,7 @@ jobs:
|
|
47
47
|
- uses: actions/checkout@v3
|
48
48
|
- uses: ruby/setup-ruby@v1
|
49
49
|
with:
|
50
|
-
ruby-version: "3.
|
50
|
+
ruby-version: "3.2"
|
51
51
|
bundler-cache: true
|
52
52
|
|
53
53
|
- uses: actions/download-artifact@v3
|
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.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:
|
41
|
+
date: 2023-01-17 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: async-http
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
175
|
+
rubygems_version: 3.4.1
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: Automatically modernize parts of your project/gem.
|
metadata.gz.sig
CHANGED
Binary file
|