rubysmith 5.8.1 → 6.0.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 +3 -2
- data/README.adoc +1 -39
- data/lib/rubysmith/builder.rb +2 -2
- data/lib/rubysmith/builders/bundler.rb +3 -3
- data/lib/rubysmith/builders/caliber.rb +2 -2
- data/lib/rubysmith/builders/circle_ci.rb +2 -2
- data/lib/rubysmith/builders/console.rb +2 -2
- data/lib/rubysmith/builders/core.rb +18 -6
- data/lib/rubysmith/builders/documentation/citation.rb +2 -2
- data/lib/rubysmith/builders/documentation/license.rb +2 -2
- data/lib/rubysmith/builders/documentation/readme.rb +2 -2
- data/lib/rubysmith/builders/documentation/version.rb +2 -2
- data/lib/rubysmith/builders/git/ignore.rb +2 -2
- data/lib/rubysmith/builders/git/safe.rb +2 -2
- data/lib/rubysmith/builders/git_hub.rb +2 -2
- data/lib/rubysmith/builders/git_hub_ci.rb +2 -2
- data/lib/rubysmith/builders/guard.rb +2 -2
- data/lib/rubysmith/builders/init.rb +2 -2
- data/lib/rubysmith/builders/rake.rb +2 -2
- data/lib/rubysmith/builders/reek.rb +2 -2
- data/lib/rubysmith/builders/rspec/binstub.rb +2 -2
- data/lib/rubysmith/builders/rspec/context.rb +2 -2
- data/lib/rubysmith/builders/rspec/helper.rb +2 -2
- data/lib/rubysmith/builders/setup.rb +2 -2
- data/lib/rubysmith/builders/version.rb +2 -2
- data/lib/rubysmith/cli/actions/maximum.rb +2 -2
- data/lib/rubysmith/cli/actions/minimum.rb +2 -2
- data/lib/rubysmith/cli/actions/publish.rb +8 -5
- data/lib/rubysmith/cli/commands/build.rb +1 -2
- data/lib/rubysmith/configuration/contract.rb +0 -7
- data/lib/rubysmith/configuration/defaults.yml +0 -30
- data/lib/rubysmith/configuration/model.rb +6 -13
- data/lib/rubysmith/configuration/transformers/template_root.rb +2 -2
- data/lib/rubysmith/extensions/bundler.rb +9 -3
- data/lib/rubysmith/extensions/milestoner.rb +3 -16
- data/lib/rubysmith/extensions/pragmater.rb +3 -16
- data/lib/rubysmith/extensions/rubocop.rb +2 -2
- data/lib/rubysmith/extensions/tocer.rb +3 -16
- data/lib/rubysmith/pathway.rb +2 -2
- data/lib/rubysmith/renderers/namespace.rb +2 -2
- data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +5 -5
- data/lib/rubysmith/templates/%project_name%/.github/workflows/ci.yml.erb +3 -3
- data/lib/rubysmith/templates/%project_name%/.gitignore.erb +0 -6
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +8 -14
- data/lib/rubysmith/templates/%project_name%/Rakefile.erb +2 -11
- data/lib/rubysmith/templates/%project_name%/spec/lib/%project_path%_spec.rb.erb +14 -0
- data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb +1 -1
- data/rubysmith.gemspec +15 -15
- data.tar.gz.sig +0 -0
- metadata +31 -34
- metadata.gz.sig +0 -0
- data/lib/rubysmith/cli/actions/yard.rb +0 -22
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pathname"
|
4
|
-
require "refinements/
|
5
|
-
require "refinements/
|
6
|
-
require "refinements/
|
4
|
+
require "refinements/array"
|
5
|
+
require "refinements/string"
|
6
|
+
require "refinements/struct"
|
7
7
|
|
8
8
|
module Rubysmith
|
9
9
|
module Configuration
|
@@ -41,18 +41,11 @@ module Rubysmith
|
|
41
41
|
:build_setup,
|
42
42
|
:build_simple_cov,
|
43
43
|
:build_versions,
|
44
|
-
:build_yard,
|
45
44
|
:build_zeitwerk,
|
46
45
|
:citation_affiliation,
|
47
46
|
:citation_message,
|
48
47
|
:citation_orcid,
|
49
48
|
:documentation_format,
|
50
|
-
:extensions_milestoner_documentation_format,
|
51
|
-
:extensions_milestoner_prefixes,
|
52
|
-
:extensions_pragmater_comments,
|
53
|
-
:extensions_pragmater_patterns,
|
54
|
-
:extensions_tocer_patterns,
|
55
|
-
:extensions_tocer_label,
|
56
49
|
:git_hub_user,
|
57
50
|
:license_label,
|
58
51
|
:license_name,
|
@@ -75,9 +68,9 @@ module Rubysmith
|
|
75
68
|
:template_path,
|
76
69
|
:template_roots
|
77
70
|
) do
|
78
|
-
using Refinements::
|
79
|
-
using Refinements::
|
80
|
-
using Refinements::
|
71
|
+
using Refinements::Array
|
72
|
+
using Refinements::String
|
73
|
+
using Refinements::Struct
|
81
74
|
|
82
75
|
def maximize = update_build_options true
|
83
76
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/monads"
|
4
|
-
require "refinements/
|
4
|
+
require "refinements/array"
|
5
5
|
|
6
6
|
module Rubysmith
|
7
7
|
module Configuration
|
@@ -10,7 +10,7 @@ module Rubysmith
|
|
10
10
|
class TemplateRoot
|
11
11
|
include Dry::Monads[:result]
|
12
12
|
|
13
|
-
using Refinements::
|
13
|
+
using Refinements::Array
|
14
14
|
|
15
15
|
def initialize key = :template_roots, default: Pathname(__dir__).join("../../templates")
|
16
16
|
@key = key
|
@@ -2,13 +2,15 @@
|
|
2
2
|
|
3
3
|
require "bundler"
|
4
4
|
require "bundler/cli"
|
5
|
-
require "refinements/
|
5
|
+
require "refinements/io"
|
6
|
+
require "refinements/pathname"
|
6
7
|
|
7
8
|
module Rubysmith
|
8
9
|
module Extensions
|
9
10
|
# Ensures gem dependencies are installed.
|
10
11
|
class Bundler
|
11
|
-
using Refinements::
|
12
|
+
using Refinements::IO
|
13
|
+
using Refinements::Pathname
|
12
14
|
|
13
15
|
def self.call(...) = new(...).call
|
14
16
|
|
@@ -18,7 +20,11 @@ module Rubysmith
|
|
18
20
|
end
|
19
21
|
|
20
22
|
def call
|
21
|
-
configuration.project_root.change_dir
|
23
|
+
configuration.project_root.change_dir do
|
24
|
+
client.start %w[install --quiet]
|
25
|
+
STDOUT.squelch { client.start %w[lock --add-platform x86_64-linux --update] }
|
26
|
+
end
|
27
|
+
|
22
28
|
configuration
|
23
29
|
end
|
24
30
|
|
@@ -1,36 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "milestoner"
|
4
|
-
require "refinements/structs"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Extensions
|
8
7
|
# Ensures project can be published (tagged) in a reliable and consistent fashion.
|
9
8
|
class Milestoner
|
10
|
-
using Refinements::Structs
|
11
|
-
|
12
9
|
def self.call(...) = new(...).call
|
13
10
|
|
14
|
-
def initialize configuration,
|
15
|
-
client: ::Milestoner::Tags::Publisher.new,
|
16
|
-
content: ::Milestoner::Configuration::Model.new
|
11
|
+
def initialize configuration, client: ::Milestoner::Tags::Publisher.new
|
17
12
|
@configuration = configuration
|
18
13
|
@client = client
|
19
|
-
@content = content
|
20
14
|
end
|
21
15
|
|
22
|
-
def call = client.call(
|
16
|
+
def call = client.call(configuration.project_version) && configuration
|
23
17
|
|
24
18
|
private
|
25
19
|
|
26
|
-
attr_reader :configuration, :client
|
27
|
-
|
28
|
-
def settings
|
29
|
-
content.transmute configuration,
|
30
|
-
documentation_format: :extensions_milestoner_documentation_format,
|
31
|
-
prefixes: :extensions_milestoner_prefixes,
|
32
|
-
version: :project_version
|
33
|
-
end
|
20
|
+
attr_reader :configuration, :client
|
34
21
|
end
|
35
22
|
end
|
36
23
|
end
|
@@ -1,36 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pragmater"
|
4
|
-
require "refinements/structs"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Extensions
|
8
7
|
# Ensures project skeleton has pragmas.
|
9
8
|
class Pragmater
|
10
|
-
using Refinements::Structs
|
11
|
-
|
12
9
|
def self.call(...) = new(...).call
|
13
10
|
|
14
|
-
def initialize configuration,
|
15
|
-
client: ::Pragmater::Inserter.new,
|
16
|
-
record: ::Pragmater::Configuration::Model.new
|
11
|
+
def initialize configuration, client: ::Pragmater::Inserter.new
|
17
12
|
@configuration = configuration
|
18
13
|
@client = client
|
19
|
-
@record = record
|
20
14
|
end
|
21
15
|
|
22
|
-
def call = client.call
|
16
|
+
def call = client.call && configuration
|
23
17
|
|
24
18
|
private
|
25
19
|
|
26
|
-
attr_reader :configuration, :client
|
27
|
-
|
28
|
-
def settings
|
29
|
-
record.merge(root_dir: configuration.project_root)
|
30
|
-
.transmute! configuration,
|
31
|
-
comments: :extensions_pragmater_comments,
|
32
|
-
patterns: :extensions_pragmater_patterns
|
33
|
-
end
|
20
|
+
attr_reader :configuration, :client
|
34
21
|
end
|
35
22
|
end
|
36
23
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/
|
3
|
+
require "refinements/io"
|
4
4
|
require "rubocop"
|
5
5
|
|
6
6
|
module Rubysmith
|
7
7
|
module Extensions
|
8
8
|
# Ensures project skeleton adheres to style guide.
|
9
9
|
class Rubocop
|
10
|
-
using Refinements::
|
10
|
+
using Refinements::IO
|
11
11
|
|
12
12
|
def self.call(...) = new(...).call
|
13
13
|
|
@@ -1,39 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "tocer"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Extensions
|
8
7
|
# Ensures project skeleton documentation has table of content.
|
9
8
|
class Tocer
|
10
|
-
using Refinements::Structs
|
11
|
-
|
12
9
|
def self.call(...) = new(...).call
|
13
10
|
|
14
|
-
def initialize configuration,
|
15
|
-
client: ::Tocer::Runner.new,
|
16
|
-
record: ::Tocer::Configuration::Model.new
|
11
|
+
def initialize configuration, client: ::Tocer::Runner.new
|
17
12
|
@configuration = configuration
|
18
13
|
@client = client
|
19
|
-
@record = record
|
20
14
|
end
|
21
15
|
|
22
16
|
def call
|
23
|
-
client.call
|
17
|
+
client.call ::Tocer::Container[:configuration] if configuration.build_readme
|
24
18
|
configuration
|
25
19
|
end
|
26
20
|
|
27
21
|
private
|
28
22
|
|
29
|
-
attr_reader :configuration, :client
|
30
|
-
|
31
|
-
def settings
|
32
|
-
record.merge(root_dir: configuration.project_root)
|
33
|
-
.transmute! configuration,
|
34
|
-
label: :extensions_tocer_label,
|
35
|
-
patterns: :extensions_tocer_patterns
|
36
|
-
end
|
23
|
+
attr_reader :configuration, :client
|
37
24
|
end
|
38
25
|
end
|
39
26
|
end
|
data/lib/rubysmith/pathway.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/
|
3
|
+
require "refinements/pathname"
|
4
4
|
|
5
5
|
module Rubysmith
|
6
6
|
# Represents a pathway which has source start and destination end.
|
7
7
|
Pathway = Struct.new :start_root, :start_path, :end_root, keyword_init: true do
|
8
|
-
using Refinements::
|
8
|
+
using Refinements::Pathname
|
9
9
|
|
10
10
|
# :reek:TooManyStatements
|
11
11
|
def initialize *arguments
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/
|
3
|
+
require "refinements/string"
|
4
4
|
|
5
5
|
module Rubysmith
|
6
6
|
module Renderers
|
7
7
|
# Renders single or multiple modules with correct, two-space indentation for templates.
|
8
8
|
class Namespace
|
9
|
-
using Refinements::
|
9
|
+
using Refinements::String
|
10
10
|
|
11
11
|
def initialize namespace, delimiter: "::"
|
12
12
|
@namespace = namespace
|
@@ -8,31 +8,31 @@ jobs:
|
|
8
8
|
- checkout
|
9
9
|
|
10
10
|
- restore_cache:
|
11
|
-
name:
|
11
|
+
name: Gems Restore
|
12
12
|
keys:
|
13
13
|
- gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
|
14
14
|
- gem-cache-
|
15
15
|
|
16
16
|
- run:
|
17
|
-
name:
|
17
|
+
name: Gems Install
|
18
18
|
command: |
|
19
19
|
gem update --system
|
20
20
|
bundle config set path "vendor/bundle"
|
21
21
|
bundle install
|
22
22
|
|
23
23
|
- save_cache:
|
24
|
-
name:
|
24
|
+
name: Gems Store
|
25
25
|
key: gem-cache-{{.Branch}}-{{checksum "Gemfile.lock"}}
|
26
26
|
paths:
|
27
27
|
- vendor/bundle
|
28
28
|
|
29
29
|
- run:
|
30
|
-
name:
|
30
|
+
name: Rake
|
31
31
|
command: bundle exec rake
|
32
32
|
|
33
33
|
<% if configuration.build_simple_cov %>
|
34
34
|
- store_artifacts:
|
35
|
-
name: SimpleCov
|
35
|
+
name: SimpleCov Report
|
36
36
|
path: ~/project/coverage
|
37
37
|
destination: coverage
|
38
38
|
<% end %>
|
@@ -11,16 +11,16 @@ jobs:
|
|
11
11
|
- name: Checkout
|
12
12
|
uses: actions/checkout@v3
|
13
13
|
|
14
|
-
- name: Setup
|
14
|
+
- name: Ruby Setup
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
17
|
bundler-cache: true
|
18
18
|
|
19
|
-
- name:
|
19
|
+
- name: Build
|
20
20
|
run: bundle exec rake
|
21
21
|
|
22
22
|
<% if configuration.build_simple_cov %>
|
23
|
-
- name:
|
23
|
+
- name: SimpleCov Report
|
24
24
|
uses: actions/upload-artifact@v3
|
25
25
|
with:
|
26
26
|
name: coverage
|
@@ -3,21 +3,21 @@ ruby file: ".ruby-version"
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
<% if configuration.build_refinements %>
|
6
|
-
gem "refinements", "~>
|
6
|
+
gem "refinements", "~> 12.0"
|
7
7
|
<% end %>
|
8
8
|
<% if configuration.build_zeitwerk %>
|
9
9
|
gem "zeitwerk", "~> 2.6"
|
10
10
|
<% end %>
|
11
11
|
|
12
|
-
group :
|
12
|
+
group :quality do
|
13
13
|
<% if configuration.build_caliber %>
|
14
|
-
gem "caliber", "~> 0.
|
14
|
+
gem "caliber", "~> 0.47"
|
15
15
|
<% end %>
|
16
16
|
<% if configuration.build_git && configuration.build_git_lint %>
|
17
|
-
gem "git-lint", "~>
|
17
|
+
gem "git-lint", "~> 7.0"
|
18
18
|
<% end %>
|
19
19
|
<% if configuration.build_reek %>
|
20
|
-
gem "reek", "~> 6.
|
20
|
+
gem "reek", "~> 6.2", require: false
|
21
21
|
<% end %>
|
22
22
|
<% if configuration.build_simple_cov %>
|
23
23
|
gem "simplecov", "~> 0.22", require: false
|
@@ -25,17 +25,11 @@ group :code_quality do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
group :development do
|
28
|
-
<% if configuration.build_yard && configuration.ascii_doc? %>
|
29
|
-
gem "asciidoctor", "~> 2.0"
|
30
|
-
<% end %>
|
31
28
|
<% if configuration.build_rake %>
|
32
|
-
gem "rake", "~> 13.
|
29
|
+
gem "rake", "~> 13.1"
|
33
30
|
<% end %>
|
34
31
|
<% if configuration.markdown? %>
|
35
|
-
gem "tocer", "~>
|
36
|
-
<% end %>
|
37
|
-
<% if configuration.build_yard %>
|
38
|
-
gem "yard", "~> 0.9"
|
32
|
+
gem "tocer", "~> 17.0"
|
39
33
|
<% end %>
|
40
34
|
end
|
41
35
|
|
@@ -50,7 +44,7 @@ end
|
|
50
44
|
|
51
45
|
group :tools do
|
52
46
|
<% if configuration.build_amazing_print %>
|
53
|
-
gem "amazing_print", "~> 1.
|
47
|
+
gem "amazing_print", "~> 1.5"
|
54
48
|
<% end %>
|
55
49
|
<% if configuration.build_debug %>
|
56
50
|
gem "debug", "~> 1.8"
|
@@ -12,9 +12,6 @@ require "bundler/setup"
|
|
12
12
|
<% if configuration.build_caliber %>
|
13
13
|
require "rubocop/rake_task"
|
14
14
|
<% end %>
|
15
|
-
<% if configuration.build_yard %>
|
16
|
-
require "yard"
|
17
|
-
<% end %>
|
18
15
|
|
19
16
|
<% if configuration.build_git && configuration.build_git_lint %>
|
20
17
|
Git::Lint::Rake::Register.call
|
@@ -29,13 +26,7 @@ require "bundler/setup"
|
|
29
26
|
RuboCop::RakeTask.new
|
30
27
|
<% end %>
|
31
28
|
|
32
|
-
<% if configuration.build_yard %>
|
33
|
-
YARD::Rake::YardocTask.new do |task|
|
34
|
-
task.options = ["--title", "<%= configuration.project_label %>", "--output-dir", "doc/yard"]
|
35
|
-
end
|
36
|
-
<% end %>
|
37
|
-
|
38
29
|
desc "Run code quality checks"
|
39
|
-
task
|
30
|
+
task quality: %i[<% if configuration.build_git && configuration.build_git_lint %>git_lint<% end %> <% if configuration.build_reek %>reek<% end %> <% if configuration.build_caliber %>rubocop<% end %>]
|
40
31
|
|
41
|
-
task default: %i[
|
32
|
+
task default: %i[quality <% if configuration.build_rspec %>spec<% end %>]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe <%= configuration.project_namespaced_class %> do
|
4
|
+
describe ".loader" do
|
5
|
+
it "eager loads" do
|
6
|
+
expectation = proc { described_class.loader.eager_load force: true }
|
7
|
+
expect(&expectation).not_to raise_error
|
8
|
+
end
|
9
|
+
|
10
|
+
it "answers unique tag" do
|
11
|
+
expect(described_class.loader.tag).to eq("<%= configuration.project_name %>")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -21,7 +21,7 @@ require "refinements"
|
|
21
21
|
<% if configuration.build_refinements %>
|
22
22
|
SPEC_ROOT = Pathname(__dir__).realpath.freeze
|
23
23
|
|
24
|
-
using Refinements::
|
24
|
+
using Refinements::Pathname
|
25
25
|
|
26
26
|
Pathname.require_tree SPEC_ROOT.join("support/shared_contexts")
|
27
27
|
<% else %>
|
data/rubysmith.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "rubysmith"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "6.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/rubysmith"
|
@@ -22,23 +22,23 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
|
-
spec.required_ruby_version =
|
26
|
-
spec.add_dependency "cogger", "~> 0.
|
25
|
+
spec.required_ruby_version = "~> 3.3"
|
26
|
+
spec.add_dependency "cogger", "~> 0.15"
|
27
27
|
spec.add_dependency "dry-container", "~> 0.11"
|
28
28
|
spec.add_dependency "dry-monads", "~> 1.6"
|
29
29
|
spec.add_dependency "dry-schema", "~> 1.13"
|
30
|
-
spec.add_dependency "etcher", "~> 0
|
31
|
-
spec.add_dependency "gitt", "~>
|
32
|
-
spec.add_dependency "infusible", "~>
|
33
|
-
spec.add_dependency "milestoner", "~>
|
34
|
-
spec.add_dependency "pragmater", "~>
|
35
|
-
spec.add_dependency "refinements", "~>
|
36
|
-
spec.add_dependency "rubocop", "~> 1.
|
37
|
-
spec.add_dependency "runcom", "~>
|
38
|
-
spec.add_dependency "sod", "~> 0.
|
39
|
-
spec.add_dependency "spek", "~>
|
40
|
-
spec.add_dependency "tocer", "~>
|
41
|
-
spec.add_dependency "tone", "~> 0
|
30
|
+
spec.add_dependency "etcher", "~> 1.0"
|
31
|
+
spec.add_dependency "gitt", "~> 3.0"
|
32
|
+
spec.add_dependency "infusible", "~> 3.0"
|
33
|
+
spec.add_dependency "milestoner", "~> 17.0"
|
34
|
+
spec.add_dependency "pragmater", "~> 14.0"
|
35
|
+
spec.add_dependency "refinements", "~> 12.0"
|
36
|
+
spec.add_dependency "rubocop", "~> 1.59"
|
37
|
+
spec.add_dependency "runcom", "~> 11.0"
|
38
|
+
spec.add_dependency "sod", "~> 0.4"
|
39
|
+
spec.add_dependency "spek", "~> 3.0"
|
40
|
+
spec.add_dependency "tocer", "~> 17.0"
|
41
|
+
spec.add_dependency "tone", "~> 1.0"
|
42
42
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
43
43
|
|
44
44
|
spec.bindir = "exe"
|
data.tar.gz.sig
CHANGED
Binary file
|