bake-modernize 0.11.0 → 0.12.0
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/license.rb +100 -0
- data/bake/modernize.rb +1 -1
- data/lib/bake/modernize/version.rb +1 -1
- data/template/actions/.github/workflows/coverage.yaml +1 -1
- data.tar.gz.sig +0 -0
- metadata +29 -27
- 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: b651d9ec9908359c42ea7d28ac252a68aac3f501747ffd8686d72b2af9092ad8
|
4
|
+
data.tar.gz: 51cec1d69dde6eb4793004914fb9ae75e732f1cb742228aaf61392b4a11ab6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44fa671dfdb50020b465379804792c01ea58ccfcd03acf8ec7ececea09b72cba68dcf03c9b2ecee34465f4d160c8ee34bbccba5d63b61001333abea940e8fda0
|
7
|
+
data.tar.gz: f51cbb00b3ccb8cacc58a76d24fb9d51732506f7d35edf4ac8d54142a01ee4b35bbf88e6f7f307c2a9aaaef4e21e2a0b3ff23e486eee9be9bceea36a8b6f3d43
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,100 @@
|
|
1
|
+
|
2
|
+
require 'console'
|
3
|
+
|
4
|
+
LICENSE = <<~LICENSE
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
LICENSE
|
23
|
+
|
24
|
+
# @parameter root [String] The root directory to scan for changes.
|
25
|
+
def license
|
26
|
+
update(root: Dir.pwd)
|
27
|
+
end
|
28
|
+
|
29
|
+
def update(root:)
|
30
|
+
authors = self.authors(root)
|
31
|
+
|
32
|
+
buffer = StringIO.new
|
33
|
+
buffer.puts "# MIT License"
|
34
|
+
buffer.puts
|
35
|
+
|
36
|
+
authors.map do |author, dates|
|
37
|
+
years = dates.map(&:year).uniq
|
38
|
+
|
39
|
+
buffer.puts "Copyright, #{years.join('-')}, by #{author}."
|
40
|
+
end
|
41
|
+
|
42
|
+
buffer.puts
|
43
|
+
buffer.puts LICENSE
|
44
|
+
|
45
|
+
File.open("license.md", "w") do |file|
|
46
|
+
file.write(buffer.string)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def authors(root)
|
53
|
+
paths = {}
|
54
|
+
authors = {}
|
55
|
+
|
56
|
+
total = `git rev-list --count HEAD`.to_i
|
57
|
+
|
58
|
+
input, output = IO.pipe
|
59
|
+
pid = Process.spawn("git", "log", "--name-only", "--pretty=format:%ad\t%an", out: output, chdir: root)
|
60
|
+
|
61
|
+
output.close
|
62
|
+
|
63
|
+
progress = Console.logger.progress(self, total)
|
64
|
+
|
65
|
+
while header = (input.readline.chomp rescue nil)
|
66
|
+
break if header.empty?
|
67
|
+
progress.increment
|
68
|
+
|
69
|
+
date, author = header.split("\t", 2)
|
70
|
+
date = Date.parse(date)
|
71
|
+
|
72
|
+
while path = (input.readline.chomp rescue nil)
|
73
|
+
break if path.empty?
|
74
|
+
|
75
|
+
paths[path] ||= {}
|
76
|
+
paths[path][author] ||= []
|
77
|
+
paths[path][author] << date
|
78
|
+
|
79
|
+
authors[author] ||= []
|
80
|
+
authors[author] << date
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
input.close
|
85
|
+
Process.wait2(pid)
|
86
|
+
|
87
|
+
paths.each do |path, authors|
|
88
|
+
authors.transform_values! do |dates|
|
89
|
+
dates.minmax
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
authors.transform_values! do |dates|
|
94
|
+
dates.minmax
|
95
|
+
end.to_a.sort_by! do |author, dates|
|
96
|
+
dates
|
97
|
+
end
|
98
|
+
|
99
|
+
return authors
|
100
|
+
end
|
data/bake/modernize.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
|
2
2
|
def modernize
|
3
|
-
call('modernize:git', 'modernize:readme', 'modernize:actions', 'modernize:editorconfig', 'modernize:gemfile', 'modernize:signing', 'modernize:gemspec')
|
3
|
+
call('modernize:git', 'modernize:readme', 'modernize:actions', 'modernize:editorconfig', 'modernize:gemfile', 'modernize:signing', 'modernize:gemspec', 'modernize:license')
|
4
4
|
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.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -11,33 +11,34 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12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HgQ2Csg=
|
39
40
|
-----END CERTIFICATE-----
|
40
|
-
date: 2022-08-
|
41
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
41
42
|
dependencies:
|
42
43
|
- !ruby/object:Gem::Dependency
|
43
44
|
name: async-http
|
@@ -135,6 +136,7 @@ files:
|
|
135
136
|
- bake/modernize/gemfile.rb
|
136
137
|
- bake/modernize/gemspec.rb
|
137
138
|
- bake/modernize/git.rb
|
139
|
+
- bake/modernize/license.rb
|
138
140
|
- bake/modernize/readme.rb
|
139
141
|
- bake/modernize/signing.rb
|
140
142
|
- lib/bake/modernize.rb
|
metadata.gz.sig
CHANGED
Binary file
|