bake-modernize 0.9.1 → 0.11.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/actions.rb +27 -3
- data/bake/modernize/readme.rb +28 -0
- data/bake/modernize.rb +1 -1
- data/lib/bake/modernize/version.rb +1 -1
- data/template/actions/.github/workflows/{coverage.yml → coverage.yaml} +1 -1
- data/template/actions/.github/workflows/{documentation.yml → documentation.yaml} +1 -1
- data/template/actions/.github/workflows/test-external.yaml +36 -0
- data/template/actions/.github/workflows/{development.yml → test.yaml} +4 -4
- data.tar.gz.sig +0 -0
- metadata +7 -5
- 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: 012e9e59e04aa7059ad4abf12835bdb6a5d8f35e6b6d76db9981a354fded0822
|
4
|
+
data.tar.gz: 0d0a46d21507a7740157d5a1821dc519623a3459d9a3c5799a84d3ac423c578f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 217d8a4315aae3596336aca9f095e091a2a6b438af5d676d6b610bcf8ac77c35bea347d38cfea73cf93d0d3262dc9edff2eb83d473f7c9cc07c911eb309d8aea
|
7
|
+
data.tar.gz: ac4f26b016cbc70611081b911a2e7d53e713949477c546d41c927f6d238115db31ff6b1de80c2906e5233930920cec1bfd4ec4e29739ecd1880438594bbd269c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/modernize/actions.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'bake/modernize'
|
3
3
|
require 'rugged'
|
4
4
|
require 'markly'
|
5
|
+
require 'build/files/system'
|
5
6
|
|
6
7
|
def actions
|
7
8
|
update(root: Dir.pwd)
|
@@ -14,15 +15,38 @@ def update(root:)
|
|
14
15
|
FileUtils.rm_rf(travis_path)
|
15
16
|
end
|
16
17
|
|
18
|
+
update_filenames(root)
|
19
|
+
|
17
20
|
template_root = Bake::Modernize.template_path_for('actions')
|
18
21
|
Bake::Modernize.copy_template(template_root, root)
|
19
22
|
|
20
|
-
readme_path =
|
21
|
-
|
23
|
+
readme_path = ["README.md", "readme.md"].find{|path| File.exist?(File.expand_path(path, root))}
|
24
|
+
|
25
|
+
if readme_path
|
26
|
+
update_badges(readme_path, repository_url(root))
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
30
|
private
|
25
31
|
|
32
|
+
def update_filenames(root)
|
33
|
+
actions_root = Build::Files::Path.new(root) + ".github/workflows"
|
34
|
+
yml_files = actions_root.glob("*.yml")
|
35
|
+
|
36
|
+
# Move all .yml files to .yaml files :)
|
37
|
+
yml_files.each do |path|
|
38
|
+
new_path = path.with(extension: ".yaml", basename: true)
|
39
|
+
FileUtils::Verbose.mv(path, new_path)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Move development.yaml to test.yaml
|
43
|
+
development_path = actions_root + "development.yaml"
|
44
|
+
test_path = actions_root + "test.yaml"
|
45
|
+
if development_path.exist?
|
46
|
+
FileUtils::Verbose.mv(development_path, test_path)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
26
50
|
def repository_url(root)
|
27
51
|
repository = Rugged::Repository.discover(root)
|
28
52
|
git_url = repository.remotes['origin'].url
|
@@ -33,7 +57,7 @@ def repository_url(root)
|
|
33
57
|
end
|
34
58
|
|
35
59
|
def badge_for(repository_url)
|
36
|
-
"[![Development Status](#{repository_url}/workflows/
|
60
|
+
"[![Development Status](#{repository_url}/workflows/Test/badge.svg)](#{repository_url}/actions?workflow=Test)"
|
37
61
|
end
|
38
62
|
|
39
63
|
def badge?(node)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
require 'bake/modernize'
|
3
|
+
require 'build/files/system'
|
4
|
+
|
5
|
+
def readme
|
6
|
+
update(root: Dir.pwd)
|
7
|
+
end
|
8
|
+
|
9
|
+
def update(root:)
|
10
|
+
update_filenames(root)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def update_filenames(root)
|
16
|
+
root = Build::Files::Path.new(root)
|
17
|
+
md_files = root.glob("*.md")
|
18
|
+
|
19
|
+
# Move all .yml files to .yaml files :)
|
20
|
+
md_files.each do |path|
|
21
|
+
new_path = path.with(basename: path.basename.downcase)
|
22
|
+
|
23
|
+
unless new_path == path
|
24
|
+
Console.logger.info(self, "Moving #{path} to #{new_path}...")
|
25
|
+
system("git", "mv", "-f", path, new_path)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/bake/modernize.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
|
2
2
|
def modernize
|
3
|
-
call('modernize:git', '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')
|
4
4
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: Test External
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
|
8
|
+
env:
|
9
|
+
CONSOLE_OUTPUT: XTerm
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: ${{matrix.ruby}} on ${{matrix.os}}
|
14
|
+
runs-on: ${{matrix.os}}-latest
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
os:
|
19
|
+
- ubuntu
|
20
|
+
- macos
|
21
|
+
|
22
|
+
ruby:
|
23
|
+
- "2.7"
|
24
|
+
- "3.0"
|
25
|
+
- "3.1"
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{matrix.ruby}}
|
32
|
+
bundler-cache: true
|
33
|
+
|
34
|
+
- name: Run tests
|
35
|
+
timeout-minutes: 10
|
36
|
+
run: bundle exec bake test:external
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: Test
|
2
2
|
|
3
3
|
on: [push, pull_request]
|
4
4
|
|
@@ -6,7 +6,7 @@ permissions:
|
|
6
6
|
contents: read
|
7
7
|
|
8
8
|
env:
|
9
|
-
CONSOLE_OUTPUT:
|
9
|
+
CONSOLE_OUTPUT: XTerm
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
test:
|
@@ -46,5 +46,5 @@ jobs:
|
|
46
46
|
bundler-cache: true
|
47
47
|
|
48
48
|
- name: Run tests
|
49
|
-
timeout-minutes:
|
50
|
-
run: bundle exec
|
49
|
+
timeout-minutes: 10
|
50
|
+
run: bundle exec bake test
|
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.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
38
38
|
HiLJ8VOFx6w=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2022-06
|
40
|
+
date: 2022-08-06 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async-http
|
@@ -135,12 +135,14 @@ files:
|
|
135
135
|
- bake/modernize/gemfile.rb
|
136
136
|
- bake/modernize/gemspec.rb
|
137
137
|
- bake/modernize/git.rb
|
138
|
+
- bake/modernize/readme.rb
|
138
139
|
- bake/modernize/signing.rb
|
139
140
|
- lib/bake/modernize.rb
|
140
141
|
- lib/bake/modernize/version.rb
|
141
|
-
- template/actions/.github/workflows/coverage.
|
142
|
-
- template/actions/.github/workflows/
|
143
|
-
- template/actions/.github/workflows/
|
142
|
+
- template/actions/.github/workflows/coverage.yaml
|
143
|
+
- template/actions/.github/workflows/documentation.yaml
|
144
|
+
- template/actions/.github/workflows/test-external.yaml
|
145
|
+
- template/actions/.github/workflows/test.yaml
|
144
146
|
- template/editorconfig/.editorconfig
|
145
147
|
- template/readme/README.md
|
146
148
|
homepage: https://github.com/ioquatix/bake-modernize
|
metadata.gz.sig
CHANGED
Binary file
|