bake-modernize 0.10.1 → 0.11.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: ca6a04bbfc198174280655c629b6bdcaac8fe08f9ca5ec79ce854507649678bb
4
- data.tar.gz: d1491c619a975a72cdd03c46fbb52e4d3946608a650df10e9d1c59696d1b6cae
3
+ metadata.gz: 012e9e59e04aa7059ad4abf12835bdb6a5d8f35e6b6d76db9981a354fded0822
4
+ data.tar.gz: 0d0a46d21507a7740157d5a1821dc519623a3459d9a3c5799a84d3ac423c578f
5
5
  SHA512:
6
- metadata.gz: 5d5f5ca77e21a434dd60d6625858982cc0e3ebe6420a3e4a1cc79eda4c787549e54b9e10736dbea704bbd7ad3f1495517dcc401592ab4be84ca5ac54449f5bfc
7
- data.tar.gz: 1d3326be2cdfc4ad94a8a903af3529bd0fe8cbbdd04e86e45a6f2bb70a06e853552a93de0cea71c4e3575b1d923fe5437e778d8e057c00eb8104c04f48853b38
6
+ metadata.gz: 217d8a4315aae3596336aca9f095e091a2a6b438af5d676d6b610bcf8ac77c35bea347d38cfea73cf93d0d3262dc9edff2eb83d473f7c9cc07c911eb309d8aea
7
+ data.tar.gz: ac4f26b016cbc70611081b911a2e7d53e713949477c546d41c927f6d238115db31ff6b1de80c2906e5233930920cec1bfd4ec4e29739ecd1880438594bbd269c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -20,8 +20,11 @@ def update(root:)
20
20
  template_root = Bake::Modernize.template_path_for('actions')
21
21
  Bake::Modernize.copy_template(template_root, root)
22
22
 
23
- readme_path = File.expand_path("README.md", root)
24
- update_badges(readme_path, repository_url(root))
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
25
28
  end
26
29
 
27
30
  private
@@ -33,14 +36,14 @@ def update_filenames(root)
33
36
  # Move all .yml files to .yaml files :)
34
37
  yml_files.each do |path|
35
38
  new_path = path.with(extension: ".yaml", basename: true)
36
- FileUtils.mv(path, new_path)
39
+ FileUtils::Verbose.mv(path, new_path)
37
40
  end
38
41
 
39
42
  # Move development.yaml to test.yaml
40
43
  development_path = actions_root + "development.yaml"
41
44
  test_path = actions_root + "test.yaml"
42
45
  if development_path.exist?
43
- FileUtils.mv(development_path, test_path)
46
+ FileUtils::Verbose.mv(development_path, test_path)
44
47
  end
45
48
  end
46
49
 
@@ -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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Bake
22
22
  module Modernize
23
- VERSION = "0.10.1"
23
+ VERSION = "0.11.0"
24
24
  end
25
25
  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.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -135,6 +135,7 @@ 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
metadata.gz.sig CHANGED
Binary file