bake-modernize 0.29.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bba8fc2c7522df213477f099086795a9f6f4d2a28fadd6e4c677ec7314e76cd0
4
- data.tar.gz: 68786fb1ff96742dbc013b5d0249a4a0e4768b7353524dbd1ba8a2dbf0382f8d
3
+ metadata.gz: 81bf9409585e5870cf25f0c79771e23c9cf30e0ab15f7521f6cf8aac990d2df3
4
+ data.tar.gz: ac8a8397d88e76bcd9e76f7220bbfb88092e21702291f1c8a30c84ad4340ae0f
5
5
  SHA512:
6
- metadata.gz: 10c3abf5c3cea6004c39079ab439b3dc222c1e94797ad45bcdb3ed31e37f857840a135ad35ae338cb01ce4bb58d70cae4e8a6f27152889136888db657c35ee8f
7
- data.tar.gz: f7b7d77c154e767f618977d283fb42b6d322a4c868ff2dd0476e89fed7cf03827f7571993c7f15b2e4d3842833525959919a57da93c809ea226076831152d503
6
+ metadata.gz: 90bde03bfe765581c7b7d1073c559486b9652bd7cd57222de042e647ace23cab24955fe60b2683251f9ea5b0a36e4a056e2285415e22dc345655cf0c3aedcd57
7
+ data.tar.gz: 691f768f63cd7e9bbcea80668abfcd6491decfdd23d79b63a599b685200f4863bea8a6fe98ae014e147d7e8dca5ed03d467baa37e528cbda13a2393c01f25ba8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -3,10 +3,10 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2020-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
7
- require 'rugged'
8
- require 'markly'
9
- require 'build/files/system'
6
+ require "bake/modernize"
7
+ require "rugged"
8
+ require "markly"
9
+ require "build/files/system"
10
10
 
11
11
  def actions
12
12
  update(root: Dir.pwd)
@@ -21,7 +21,7 @@ def update(root:)
21
21
 
22
22
  update_filenames(root)
23
23
 
24
- template_root = Bake::Modernize.template_path_for('actions')
24
+ template_root = Bake::Modernize.template_path_for("actions")
25
25
  Bake::Modernize.copy_template(template_root, root)
26
26
 
27
27
  readme_path = ["README.md", "readme.md"].find{|path| File.exist?(File.expand_path(path, root))}
@@ -62,7 +62,7 @@ end
62
62
 
63
63
  def repository_url(root)
64
64
  repository = Rugged::Repository.discover(root)
65
- git_url = repository.remotes['origin'].url
65
+ git_url = repository.remotes["origin"].url
66
66
 
67
67
  if match = git_url.match(/@(?<url>.*?):(?<path>.*?)(\.git)?\z/)
68
68
  return "https://#{match[:url]}/#{match[:path]}"
@@ -3,15 +3,15 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
7
- require 'markly'
6
+ require "bake/modernize"
7
+ require "markly"
8
8
 
9
9
  def contributing
10
10
  if conduct_path = Dir["conduct.md"]
11
11
  FileUtils.rm_f(conduct_path)
12
12
  end
13
13
 
14
- update_contributing(File.join(Dir.pwd, 'readme.md'))
14
+ update_contributing(File.join(Dir.pwd, "readme.md"))
15
15
  end
16
16
 
17
17
  private
@@ -6,7 +6,7 @@
6
6
  def initialize(context)
7
7
  super
8
8
 
9
- require 'bake/modernize/license'
9
+ require "bake/modernize/license"
10
10
  end
11
11
 
12
12
  # Extract changes from a repository and generate a list of contributors.
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2020-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
6
+ require "bake/modernize"
7
7
 
8
8
  def editorconfig
9
9
  update(root: Dir.pwd)
10
10
  end
11
11
 
12
12
  def update(root:)
13
- template_root = Bake::Modernize.template_path_for('editorconfig')
13
+ template_root = Bake::Modernize.template_path_for("editorconfig")
14
14
  Bake::Modernize.copy_template(template_root, root)
15
15
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2022, by Samuel Williams.
4
+ # Copyright, 2020-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
6
+ require "bake/modernize"
7
7
 
8
8
  def gemfile
9
9
  update(root: Dir.pwd)
@@ -51,12 +51,12 @@ def update(path: default_gemspec_path, output: $stdout)
51
51
  output.puts "\tspec.authors = #{spec.authors.inspect}"
52
52
  output.puts "\tspec.license = #{spec.license.inspect}"
53
53
 
54
- certificate_path = File.expand_path('release.cert', root)
54
+ certificate_path = File.expand_path("release.cert", root)
55
55
 
56
56
  if File.exist?(certificate_path)
57
57
  output.puts "\t"
58
- output.puts "\tspec.cert_chain = ['release.cert']"
59
- output.puts "\tspec.signing_key = File.expand_path('~/.gem/release.pem')"
58
+ output.puts "\tspec.cert_chain = [\"release.cert\"]"
59
+ output.puts "\tspec.signing_key = File.expand_path(\"~/.gem/release.pem\")"
60
60
  end
61
61
 
62
62
  if spec.homepage and !spec.homepage.empty?
@@ -76,8 +76,8 @@ def update(path: default_gemspec_path, output: $stdout)
76
76
  output.puts "\t"
77
77
  output.puts "\tspec.files = #{directory_glob_for(spec)}"
78
78
 
79
- if spec.require_paths != ['lib']
80
- output.puts "\tspec.require_paths = ['lib']"
79
+ if spec.require_paths != ["lib"]
80
+ output.puts "\tspec.require_paths = [\"lib\"]"
81
81
  end
82
82
 
83
83
  if executables = spec.executables and executables.any?
@@ -132,15 +132,15 @@ def directory_glob_for(spec, paths = spec.files)
132
132
  directories[directory] = true
133
133
  end
134
134
 
135
- if basename.start_with?('.')
135
+ if basename.start_with?(".")
136
136
  dotfiles = true
137
137
  end
138
138
  end
139
139
 
140
140
  if dotfiles
141
- return "Dir.glob(['{#{directories.keys.join(',')}}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)"
141
+ return "Dir.glob([\"{#{directories.keys.join(',')}}/**/*\", \"*.md\"], File::FNM_DOTMATCH, base: __dir__)"
142
142
  else
143
- return "Dir['{#{directories.keys.join(',')}}/**/*', '*.md', base: __dir__]"
143
+ return "Dir[\"{#{directories.keys.join(',')}}/**/*\", \"*.md\", base: __dir__]"
144
144
  end
145
145
  end
146
146
 
@@ -174,8 +174,8 @@ def version_path(root)
174
174
  Dir["lib/**/version.rb", base: root].first
175
175
  end
176
176
 
177
- require 'async'
178
- require 'async/http/internet'
177
+ require "async"
178
+ require "async/http/internet"
179
179
 
180
180
  def valid_uri?(uri)
181
181
  Sync do
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2023, by Samuel Williams.
4
+ # Copyright, 2021-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
6
+ require "bake/modernize"
7
7
 
8
8
  def git
9
9
  update(root: Dir.pwd)
@@ -18,7 +18,7 @@ def update(root:)
18
18
 
19
19
  current_gitignore_custom_lines = self.current_gitignore_custom_lines(root)
20
20
 
21
- template_root = Bake::Modernize.template_path_for('git')
21
+ template_root = Bake::Modernize.template_path_for("git")
22
22
  Bake::Modernize.copy_template(template_root, root)
23
23
 
24
24
  if current_gitignore_custom_lines
@@ -44,7 +44,7 @@ def current_gitignore_custom_lines(root)
44
44
  end
45
45
 
46
46
  def current_branch
47
- require 'open3'
47
+ require "open3"
48
48
 
49
49
  output, status = Open3.capture2("git", "branch", "--show-current")
50
50
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
7
- require 'markly'
6
+ require "bake/modernize"
7
+ require "markly"
8
8
 
9
9
  LICENSE = <<~LICENSE
10
10
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
7
- require 'build/files/system'
6
+ require "bake/modernize"
7
+ require "build/files/system"
8
8
 
9
9
  def readme
10
10
  update(root: Dir.pwd)
@@ -3,8 +3,8 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
7
- require 'build/files/system'
6
+ require "bake/modernize"
7
+ require "build/files/system"
8
8
 
9
9
  def rubocop
10
10
  update(root: Dir.pwd)
@@ -13,7 +13,7 @@ end
13
13
  def update(root:)
14
14
  system("bundle", "add", "rubocop", "--group", "test", chdir: root)
15
15
 
16
- template_root = Bake::Modernize.template_path_for('rubocop')
16
+ template_root = Bake::Modernize.template_path_for("rubocop")
17
17
  Bake::Modernize.copy_template(template_root, root)
18
18
 
19
19
  system("bundle", "update", chdir: root)
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2022, by Samuel Williams.
4
+ # Copyright, 2021-2024, by Samuel Williams.
5
5
 
6
- require 'bake/modernize'
6
+ require "bake/modernize"
7
7
 
8
8
  def signing
9
9
  update(root: Dir.pwd)
data/bake/modernize.rb CHANGED
@@ -5,15 +5,15 @@
5
5
 
6
6
  def modernize
7
7
  call(
8
- 'modernize:git',
9
- 'modernize:readme',
10
- 'modernize:actions',
11
- 'modernize:editorconfig',
12
- 'modernize:gemfile',
13
- 'modernize:rubocop',
14
- 'modernize:signing',
15
- 'modernize:gemspec',
16
- 'modernize:license',
17
- 'modernize:contributing',
8
+ "modernize:git",
9
+ "modernize:readme",
10
+ "modernize:actions",
11
+ "modernize:editorconfig",
12
+ "modernize:gemfile",
13
+ "modernize:rubocop",
14
+ "modernize:signing",
15
+ "modernize:gemspec",
16
+ "modernize:license",
17
+ "modernize:contributing",
18
18
  )
19
19
  end
@@ -3,8 +3,8 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
- require 'rugged'
7
- require 'yaml'
6
+ require "rugged"
7
+ require "yaml"
8
8
 
9
9
  module Bake
10
10
  module Modernize
@@ -34,7 +34,7 @@ module Bake
34
34
 
35
35
  # Extract the revisions from the given path.
36
36
  def extract(path)
37
- File.open(path, 'r') do |file|
37
+ File.open(path, "r") do |file|
38
38
  file.each_line do |line|
39
39
  # Skip empty lines and comments
40
40
  next if line =~ /^\s*(#|$)/
@@ -54,7 +54,7 @@ module Bake
54
54
  class Mailmap
55
55
  # Load the mailmap from a directory.
56
56
  def self.for(root)
57
- full_path = File.join(root, '.mailmap')
57
+ full_path = File.join(root, ".mailmap")
58
58
 
59
59
  if File.exist?(full_path)
60
60
  mailmap = self.new
@@ -73,7 +73,7 @@ module Bake
73
73
 
74
74
  # Extract the mailmap from the given path.
75
75
  def extract(path)
76
- File.open(path, 'r') do |file|
76
+ File.open(path, "r") do |file|
77
77
  file.each_line do |line|
78
78
  # Skip comments
79
79
  next if line =~ /^#/
@@ -107,11 +107,11 @@ module Bake
107
107
  # Extract contributors from a YAML file which can be generated from another repository.
108
108
  class Contributors
109
109
  # 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.
110
- DEFAULT_PATH = '.'
110
+ DEFAULT_PATH = "."
111
111
 
112
112
  # Load contributors from a directory.
113
113
  def self.for(root)
114
- full_path = File.join(root, '.contributors.yaml')
114
+ full_path = File.join(root, ".contributors.yaml")
115
115
 
116
116
  if File.exist?(full_path)
117
117
  contributors = self.new
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Bake
7
7
  module Modernize
8
- VERSION = "0.29.0"
8
+ VERSION = "0.31.0"
9
9
  end
10
10
  end
@@ -3,10 +3,10 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2020-2024, by Samuel Williams.
5
5
 
6
- require_relative 'modernize/license'
7
- require_relative 'modernize/version'
8
- require 'build/files/glob'
9
- require 'fileutils'
6
+ require_relative "modernize/license"
7
+ require_relative "modernize/version"
8
+ require "build/files/glob"
9
+ require "fileutils"
10
10
 
11
11
  # @namespace
12
12
  module Bake
@@ -35,7 +35,7 @@ module Bake
35
35
  # @parameter source_path [String] The source path.
36
36
  # @parameter destination_path [String] The destination path.
37
37
  def self.copy_template(source_path, destination_path)
38
- glob = Build::Files::Glob.new(source_path, '**/*')
38
+ glob = Build::Files::Glob.new(source_path, "**/*")
39
39
 
40
40
  glob.each do |path|
41
41
  full_path = File.join(destination_path, path.relative_path)
@@ -36,6 +36,8 @@ jobs:
36
36
 
37
37
  - uses: actions/upload-artifact@v4
38
38
  with:
39
+ include-hidden-files: true
40
+ if-no-files-found: error
39
41
  name: coverage-${{matrix.os}}-${{matrix.ruby}}
40
42
  path: .covered.db
41
43
 
@@ -47,3 +47,7 @@ Layout/EmptyLinesAroundModuleBody:
47
47
 
48
48
  Style/FrozenStringLiteralComment:
49
49
  Enabled: true
50
+
51
+ Style/StringLiterals:
52
+ Enabled: true
53
+ EnforcedStyle: double_quotes
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.29.0
4
+ version: 0.31.0
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: 2024-09-03 00:00:00.000000000 Z
41
+ date: 2024-09-17 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