rubysmith 6.10.0 → 7.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 +0 -0
- data/README.adoc +46 -57
- data/lib/rubysmith/builder.rb +9 -9
- data/lib/rubysmith/builders/abstract.rb +4 -4
- data/lib/rubysmith/builders/bundler.rb +2 -2
- data/lib/rubysmith/builders/caliber.rb +4 -4
- data/lib/rubysmith/builders/circle_ci.rb +3 -3
- data/lib/rubysmith/builders/console.rb +3 -3
- data/lib/rubysmith/builders/core.rb +6 -6
- data/lib/rubysmith/builders/documentation/citation.rb +3 -3
- data/lib/rubysmith/builders/documentation/license.rb +8 -9
- data/lib/rubysmith/builders/documentation/readme.rb +4 -4
- data/lib/rubysmith/builders/documentation/version.rb +4 -5
- data/lib/rubysmith/builders/git/commit.rb +4 -8
- data/lib/rubysmith/builders/git/ignore.rb +3 -3
- data/lib/rubysmith/builders/git/safe.rb +3 -3
- data/lib/rubysmith/builders/git/setup.rb +3 -3
- data/lib/rubysmith/builders/git_hub/ci.rb +27 -0
- data/lib/rubysmith/builders/git_hub/funding.rb +23 -0
- data/lib/rubysmith/builders/git_hub/template.rb +32 -0
- data/lib/rubysmith/builders/guard.rb +4 -4
- data/lib/rubysmith/builders/init.rb +2 -2
- data/lib/rubysmith/builders/rake/binstub.rb +24 -0
- data/lib/rubysmith/builders/rake/configuration.rb +29 -0
- data/lib/rubysmith/builders/reek.rb +3 -3
- data/lib/rubysmith/builders/rspec/binstub.rb +3 -3
- data/lib/rubysmith/builders/rspec/context.rb +6 -6
- data/lib/rubysmith/builders/rspec/helper.rb +3 -3
- data/lib/rubysmith/builders/setup.rb +3 -3
- data/lib/rubysmith/builders/version.rb +2 -2
- data/lib/rubysmith/cli/actions/amazing_print.rb +3 -3
- data/lib/rubysmith/cli/actions/caliber.rb +3 -3
- data/lib/rubysmith/cli/actions/circle_ci.rb +4 -4
- data/lib/rubysmith/cli/actions/citation.rb +3 -3
- data/lib/rubysmith/cli/actions/community.rb +3 -3
- data/lib/rubysmith/cli/actions/conduct.rb +3 -3
- data/lib/rubysmith/cli/actions/console.rb +3 -3
- data/lib/rubysmith/cli/actions/contributions.rb +3 -3
- data/lib/rubysmith/cli/actions/debug.rb +3 -3
- data/lib/rubysmith/cli/actions/funding.rb +4 -4
- data/lib/rubysmith/cli/actions/git.rb +3 -3
- data/lib/rubysmith/cli/actions/git_hub.rb +3 -3
- data/lib/rubysmith/cli/actions/git_hub_ci.rb +3 -3
- data/lib/rubysmith/cli/actions/git_lint.rb +3 -3
- data/lib/rubysmith/cli/actions/guard.rb +3 -3
- data/lib/rubysmith/cli/actions/irb_kit.rb +3 -3
- data/lib/rubysmith/cli/actions/license.rb +3 -3
- data/lib/rubysmith/cli/actions/maximum.rb +4 -4
- data/lib/rubysmith/cli/actions/minimum.rb +4 -4
- data/lib/rubysmith/cli/actions/name.rb +2 -2
- data/lib/rubysmith/cli/actions/rake.rb +3 -3
- data/lib/rubysmith/cli/actions/readme.rb +3 -3
- data/lib/rubysmith/cli/actions/reek.rb +3 -3
- data/lib/rubysmith/cli/actions/refinements.rb +3 -3
- data/lib/rubysmith/cli/actions/rspec.rb +3 -3
- data/lib/rubysmith/cli/actions/rtc.rb +3 -3
- data/lib/rubysmith/cli/actions/security.rb +3 -3
- data/lib/rubysmith/cli/actions/setup.rb +3 -3
- data/lib/rubysmith/cli/actions/simple_cov.rb +3 -3
- data/lib/rubysmith/cli/actions/versions.rb +3 -3
- data/lib/rubysmith/cli/actions/zeitwerk.rb +3 -3
- data/lib/rubysmith/cli/commands/build.rb +33 -31
- data/lib/rubysmith/cli/shell.rb +0 -1
- data/lib/rubysmith/configuration/contract.rb +16 -14
- data/lib/rubysmith/configuration/defaults.yml +21 -1
- data/lib/rubysmith/configuration/model.rb +30 -28
- data/lib/rubysmith/configuration/transformers/git_hub_user.rb +2 -2
- data/lib/rubysmith/container.rb +19 -9
- data/lib/rubysmith/extensions/bundler.rb +7 -7
- data/lib/rubysmith/extensions/pragmater.rb +10 -10
- data/lib/rubysmith/extensions/rubocop.rb +7 -7
- data/lib/rubysmith/extensions/tocer.rb +8 -8
- data/lib/rubysmith/renderers/erb.rb +4 -4
- data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/.github/FUNDING.yml.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/.github/workflows/ci.yml.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/CITATION.cff.erb +12 -12
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +18 -18
- data/lib/rubysmith/templates/%project_name%/LICENSE-apache.adoc.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/LICENSE-apache.md.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/LICENSE-mit.adoc.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/LICENSE-mit.md.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/README.adoc.erb +21 -21
- data/lib/rubysmith/templates/%project_name%/README.md.erb +21 -21
- data/lib/rubysmith/templates/%project_name%/Rakefile.erb +10 -10
- data/lib/rubysmith/templates/%project_name%/VERSIONS.adoc.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/VERSIONS.md.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/bin/console.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/bin/setup.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/lib/%project_path%.rb.erb +7 -7
- data/lib/rubysmith/templates/%project_name%/spec/lib/%project_path%_spec.rb.erb +2 -2
- data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +4 -4
- data/lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb +3 -3
- data/lib/rubysmith.rb +1 -0
- data/rubysmith.gemspec +11 -12
- data.tar.gz.sig +0 -0
- metadata +28 -43
- metadata.gz.sig +4 -2
- data/lib/rubysmith/builders/git_hub.rb +0 -39
- data/lib/rubysmith/builders/git_hub_ci.rb +0 -25
- data/lib/rubysmith/builders/rake.rb +0 -39
- data/lib/rubysmith/cli/actions/publish.rb +0 -35
- data/lib/rubysmith/configuration/transformers/target_root.rb +0 -18
- data/lib/rubysmith/extensions/milestoner.rb +0 -23
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores readme flag.
|
9
9
|
class Readme < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add readme documentation."
|
13
13
|
|
14
14
|
on "--[no-]readme"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_readme }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_readme = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores Reek flag.
|
9
9
|
class Reek < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add Reek gem."
|
13
13
|
|
14
14
|
on "--[no-]reek"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_reek }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_reek = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores Refinements flag.
|
9
9
|
class Refinements < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add Refinements gem."
|
13
13
|
|
14
14
|
on "--[no-]refinements"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_refinements }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_refinements = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores RSpec flag.
|
9
9
|
class RSpec < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add RSpec gem."
|
13
13
|
|
14
14
|
on "--[no-]rspec"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_rspec }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_rspec = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores Repl Type Completor flag.
|
9
9
|
class RTC < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add Repl Type Completor gem."
|
13
13
|
|
14
14
|
on "--[no-]rtc"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_rtc }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_rtc = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores security flag.
|
9
9
|
class Security < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add security."
|
13
13
|
|
14
14
|
on "--[no-]security"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_security }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_security = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores setup flag.
|
9
9
|
class Setup < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add setup script."
|
13
13
|
|
14
14
|
on "--[no-]setup"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_setup }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_setup = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores SimpleCov flag.
|
9
9
|
class SimpleCov < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add SimpleCov gem."
|
13
13
|
|
14
14
|
on "--[no-]simple_cov"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_simple_cov }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_simple_cov = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores versions flag.
|
9
9
|
class Versions < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add version history."
|
13
13
|
|
14
14
|
on "--[no-]versions"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_versions }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_versions = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Rubysmith
|
|
7
7
|
module Actions
|
8
8
|
# Stores Zeitwerk flag.
|
9
9
|
class Zeitwerk < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Add Zeitwerk gem."
|
13
13
|
|
14
14
|
on "--[no-]zeitwerk"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].build_zeitwerk }
|
17
17
|
|
18
|
-
def call(value = nil) =
|
18
|
+
def call(value = nil) = settings.build_zeitwerk = value
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -8,38 +8,40 @@ module Rubysmith
|
|
8
8
|
module Commands
|
9
9
|
# Stores table of contents root path.
|
10
10
|
class Build < Sod::Command
|
11
|
-
include Import[:
|
11
|
+
include Import[:settings, :kernel, :logger]
|
12
12
|
|
13
13
|
# Order is important.
|
14
14
|
BUILDERS = [
|
15
|
-
Builders::Init,
|
16
|
-
Builders::Core,
|
17
|
-
Builders::Version,
|
18
|
-
Builders::Documentation::Readme,
|
19
|
-
Builders::Documentation::Citation,
|
20
|
-
Builders::Documentation::License,
|
21
|
-
Builders::Documentation::Version,
|
22
|
-
Builders::Git::Setup,
|
23
|
-
Builders::Git::Ignore,
|
24
|
-
Builders::Git::Safe,
|
25
|
-
Builders::Bundler,
|
26
|
-
Builders::Rake,
|
27
|
-
Builders::
|
28
|
-
Builders::
|
29
|
-
Builders::
|
30
|
-
Builders::
|
31
|
-
Builders::
|
32
|
-
Builders::
|
33
|
-
Builders::
|
34
|
-
Builders::
|
35
|
-
Builders::
|
36
|
-
Builders::RSpec::
|
37
|
-
Builders::
|
38
|
-
|
39
|
-
|
40
|
-
Extensions::
|
41
|
-
Extensions::
|
42
|
-
|
15
|
+
Builders::Init.new,
|
16
|
+
Builders::Core.new,
|
17
|
+
Builders::Version.new,
|
18
|
+
Builders::Documentation::Readme.new,
|
19
|
+
Builders::Documentation::Citation.new,
|
20
|
+
Builders::Documentation::License.new,
|
21
|
+
Builders::Documentation::Version.new,
|
22
|
+
Builders::Git::Setup.new,
|
23
|
+
Builders::Git::Ignore.new,
|
24
|
+
Builders::Git::Safe.new,
|
25
|
+
Builders::Bundler.new,
|
26
|
+
Builders::Rake::Binstub.new,
|
27
|
+
Builders::Rake::Configuration.new,
|
28
|
+
Builders::Console.new,
|
29
|
+
Builders::CircleCI.new,
|
30
|
+
Builders::Setup.new,
|
31
|
+
Builders::GitHub::Template.new,
|
32
|
+
Builders::GitHub::Funding.new,
|
33
|
+
Builders::GitHub::CI.new,
|
34
|
+
Builders::Guard.new,
|
35
|
+
Builders::Reek.new,
|
36
|
+
Builders::RSpec::Binstub.new,
|
37
|
+
Builders::RSpec::Context.new,
|
38
|
+
Builders::RSpec::Helper.new,
|
39
|
+
Builders::Caliber.new,
|
40
|
+
Extensions::Bundler.new,
|
41
|
+
Extensions::Pragmater.new,
|
42
|
+
Extensions::Tocer.new,
|
43
|
+
Extensions::Rubocop.new,
|
44
|
+
Builders::Git::Commit.new
|
43
45
|
].freeze
|
44
46
|
|
45
47
|
handle "build"
|
@@ -84,8 +86,8 @@ module Rubysmith
|
|
84
86
|
end
|
85
87
|
|
86
88
|
def call
|
87
|
-
log_info "Building project skeleton: #{
|
88
|
-
builders.each
|
89
|
+
log_info "Building project skeleton: #{settings.project_name}..."
|
90
|
+
builders.each(&:call)
|
89
91
|
log_info "Project skeleton complete!"
|
90
92
|
end
|
91
93
|
|
data/lib/rubysmith/cli/shell.rb
CHANGED
@@ -11,7 +11,8 @@ module Rubysmith
|
|
11
11
|
optional(:author_email).filled :string
|
12
12
|
optional(:author_family_name).filled :string
|
13
13
|
optional(:author_given_name).filled :string
|
14
|
-
|
14
|
+
required(:author_handle).filled :string
|
15
|
+
required(:author_uri).filled :string
|
15
16
|
required(:build_amazing_print).filled :bool
|
16
17
|
required(:build_caliber).filled :bool
|
17
18
|
required(:build_circle_ci).filled :bool
|
@@ -47,25 +48,26 @@ module Rubysmith
|
|
47
48
|
optional(:citation_message).filled :string
|
48
49
|
optional(:citation_orcid).filled :string
|
49
50
|
required(:documentation_format).filled :string
|
50
|
-
optional(:git_hub_user).filled :string
|
51
51
|
required(:loaded_at).filled :time
|
52
52
|
required(:license_label).filled :string
|
53
53
|
required(:license_name).filled :string
|
54
54
|
required(:license_version).filled :string
|
55
|
-
|
55
|
+
required(:organization_uri).filled :string
|
56
56
|
optional(:project_name).filled :string
|
57
|
-
optional(:
|
58
|
-
optional(:
|
59
|
-
optional(:
|
60
|
-
optional(:
|
61
|
-
optional(:
|
62
|
-
optional(:
|
63
|
-
optional(:
|
64
|
-
optional(:
|
65
|
-
optional(:
|
66
|
-
optional(:
|
67
|
-
optional(:
|
57
|
+
optional(:project_uri_community).filled :string
|
58
|
+
optional(:project_uri_conduct).filled :string
|
59
|
+
optional(:project_uri_contributions).filled :string
|
60
|
+
optional(:project_uri_download).filled :string
|
61
|
+
optional(:project_uri_funding).filled :string
|
62
|
+
optional(:project_uri_home).filled :string
|
63
|
+
optional(:project_uri_issues).filled :string
|
64
|
+
optional(:project_uri_license).filled :string
|
65
|
+
optional(:project_uri_security).filled :string
|
66
|
+
optional(:project_uri_source).filled :string
|
67
|
+
optional(:project_uri_versions).filled :string
|
68
68
|
required(:project_version).filled :string
|
69
|
+
required(:repository_handle).filled :string
|
70
|
+
required(:repository_uri).filled :string
|
69
71
|
required(:target_root).filled Etcher::Types::Pathname
|
70
72
|
optional(:template_path).filled Etcher::Types::Pathname
|
71
73
|
required(:template_roots).array Etcher::Types::Pathname
|
@@ -1,3 +1,6 @@
|
|
1
|
+
author:
|
2
|
+
handle: undefined
|
3
|
+
uri: "%<organization_uri>s/team/%<author_handle>s"
|
1
4
|
build:
|
2
5
|
amazing_print: true
|
3
6
|
caliber: true
|
@@ -15,7 +18,7 @@ build:
|
|
15
18
|
git_hub_ci: false
|
16
19
|
git_lint: true
|
17
20
|
guard: true
|
18
|
-
irb_kit:
|
21
|
+
irb_kit: true
|
19
22
|
license: true
|
20
23
|
maximum: false
|
21
24
|
minimum: false
|
@@ -38,5 +41,22 @@ license:
|
|
38
41
|
label: Hippocratic
|
39
42
|
name: hippocratic
|
40
43
|
version: "2.1"
|
44
|
+
organization:
|
45
|
+
uri: https://undefined.io
|
41
46
|
project:
|
47
|
+
uri:
|
48
|
+
community: "%<organization_uri>s/community"
|
49
|
+
conduct: "%<organization_uri>s/policies/code_of_conduct"
|
50
|
+
contributions: "%<organization_uri>s/policies/contributions"
|
51
|
+
download: "https://rubygems.org/gems/%<project_name>s"
|
52
|
+
funding: "%<repository_uri>s/sponsors/%<repository_handle>s"
|
53
|
+
home: "%<organization_uri>s/projects/%<project_name>s"
|
54
|
+
issues: "%<repository_uri>s/%<repository_handle>s/%<project_name>s/issues"
|
55
|
+
license: "%<organization_uri>s/policies/license"
|
56
|
+
security: "%<organization_uri>s/policies/security"
|
57
|
+
source: "%<repository_uri>s/%<repository_handle>s/%<project_name>s"
|
58
|
+
versions: "%<organization_uri>s/projects/%<project_name>s/versions"
|
42
59
|
version: 0.0.0
|
60
|
+
repository:
|
61
|
+
handle: undefined
|
62
|
+
uri: https://github.com
|
@@ -12,7 +12,8 @@ module Rubysmith
|
|
12
12
|
:author_email,
|
13
13
|
:author_family_name,
|
14
14
|
:author_given_name,
|
15
|
-
:
|
15
|
+
:author_handle,
|
16
|
+
:author_uri,
|
16
17
|
:build_amazing_print,
|
17
18
|
:build_caliber,
|
18
19
|
:build_circle_ci,
|
@@ -48,25 +49,26 @@ module Rubysmith
|
|
48
49
|
:citation_message,
|
49
50
|
:citation_orcid,
|
50
51
|
:documentation_format,
|
51
|
-
:git_hub_user,
|
52
52
|
:license_label,
|
53
53
|
:license_name,
|
54
54
|
:license_version,
|
55
55
|
:loaded_at,
|
56
|
-
:
|
56
|
+
:organization_uri,
|
57
57
|
:project_name,
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
58
|
+
:project_uri_community,
|
59
|
+
:project_uri_conduct,
|
60
|
+
:project_uri_contributions,
|
61
|
+
:project_uri_download,
|
62
|
+
:project_uri_funding,
|
63
|
+
:project_uri_home,
|
64
|
+
:project_uri_issues,
|
65
|
+
:project_uri_license,
|
66
|
+
:project_uri_security,
|
67
|
+
:project_uri_source,
|
68
|
+
:project_uri_versions,
|
69
69
|
:project_version,
|
70
|
+
:repository_handle,
|
71
|
+
:repository_uri,
|
70
72
|
:target_root,
|
71
73
|
:template_path,
|
72
74
|
:template_roots
|
@@ -95,27 +97,27 @@ module Rubysmith
|
|
95
97
|
|
96
98
|
def project_root = target_root.join(project_name)
|
97
99
|
|
98
|
-
def
|
100
|
+
def computed_project_uri_community = format_uri(__method__)
|
99
101
|
|
100
|
-
def
|
102
|
+
def computed_project_uri_conduct = format_uri(__method__)
|
101
103
|
|
102
|
-
def
|
104
|
+
def computed_project_uri_contributions = format_uri(__method__)
|
103
105
|
|
104
|
-
def
|
106
|
+
def computed_project_uri_download = format_uri(__method__)
|
105
107
|
|
106
|
-
def
|
108
|
+
def computed_project_uri_funding = format_uri(__method__)
|
107
109
|
|
108
|
-
def
|
110
|
+
def computed_project_uri_home = format_uri(__method__)
|
109
111
|
|
110
|
-
def
|
112
|
+
def computed_project_uri_issues = format_uri(__method__)
|
111
113
|
|
112
|
-
def
|
114
|
+
def computed_project_uri_license = format_uri(__method__)
|
113
115
|
|
114
|
-
def
|
116
|
+
def computed_project_uri_security = format_uri(__method__)
|
115
117
|
|
116
|
-
def
|
118
|
+
def computed_project_uri_source = format_uri(__method__)
|
117
119
|
|
118
|
-
def
|
120
|
+
def computed_project_uri_versions = format_uri(__method__)
|
119
121
|
|
120
122
|
def ascii_doc? = documentation_format == "adoc"
|
121
123
|
|
@@ -132,12 +134,12 @@ module Rubysmith
|
|
132
134
|
|
133
135
|
private
|
134
136
|
|
135
|
-
def
|
137
|
+
def format_uri kind
|
136
138
|
kind.to_s
|
137
139
|
.sub("computed_", "")
|
138
140
|
.then { |method| public_send method }
|
139
|
-
.then { |
|
140
|
-
.then { |
|
141
|
+
.then { |uri| String uri }
|
142
|
+
.then { |uri| uri.sub "%<project_name>s", project_name }
|
141
143
|
end
|
142
144
|
|
143
145
|
def update_build_options value
|
@@ -5,12 +5,12 @@ require "dry/monads"
|
|
5
5
|
module Rubysmith
|
6
6
|
module Configuration
|
7
7
|
module Transformers
|
8
|
-
# Dynamically
|
8
|
+
# Dynamically updates repository handle if GitHub user is defined.
|
9
9
|
class GitHubUser
|
10
10
|
include Import[:git]
|
11
11
|
include Dry::Monads[:result]
|
12
12
|
|
13
|
-
def initialize(key = :
|
13
|
+
def initialize(key = :repository_handle, **)
|
14
14
|
@key = key
|
15
15
|
super(**)
|
16
16
|
end
|
data/lib/rubysmith/container.rb
CHANGED
@@ -12,28 +12,38 @@ module Rubysmith
|
|
12
12
|
module Container
|
13
13
|
extend Containable
|
14
14
|
|
15
|
-
register :
|
16
|
-
self[:defaults].add_loader(:yaml, self[:xdg_config].active)
|
17
|
-
.then { |registry| Etcher.call registry }
|
18
|
-
end
|
19
|
-
|
20
|
-
register :defaults do
|
15
|
+
register :registry do
|
21
16
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
22
17
|
.add_loader(:yaml, self[:defaults_path])
|
18
|
+
.add_loader(:yaml, self[:xdg_config].active)
|
23
19
|
.add_transformer(Configuration::Transformers::GitHubUser.new)
|
24
20
|
.add_transformer(Configuration::Transformers::GitEmail.new)
|
25
21
|
.add_transformer(Configuration::Transformers::GitUser.new)
|
26
22
|
.add_transformer(Configuration::Transformers::TemplateRoot.new)
|
27
|
-
.add_transformer(
|
28
|
-
.add_transformer(:
|
23
|
+
.add_transformer(:root, :target_root)
|
24
|
+
.add_transformer(:format, :author_uri)
|
25
|
+
.add_transformer(:format, :author_uri)
|
26
|
+
.add_transformer(:format, :project_uri_community)
|
27
|
+
.add_transformer(:format, :project_uri_conduct)
|
28
|
+
.add_transformer(:format, :project_uri_contributions)
|
29
|
+
.add_transformer(:format, :project_uri_download, :project_name)
|
30
|
+
.add_transformer(:format, :project_uri_funding)
|
31
|
+
.add_transformer(:format, :project_uri_home, :project_name)
|
32
|
+
.add_transformer(:format, :project_uri_issues, :project_name)
|
33
|
+
.add_transformer(:format, :project_uri_license)
|
34
|
+
.add_transformer(:format, :project_uri_security)
|
35
|
+
.add_transformer(:format, :project_uri_source, :project_name)
|
36
|
+
.add_transformer(:format, :project_uri_versions, :project_name)
|
37
|
+
.add_transformer(:time, :loaded_at)
|
29
38
|
end
|
30
39
|
|
40
|
+
register(:settings) { Etcher.call(self[:registry]).dup }
|
31
41
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec" }
|
32
|
-
register(:input) { self[:configuration].dup }
|
33
42
|
register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
|
34
43
|
register(:xdg_config) { Runcom::Config.new "rubysmith/configuration.yml" }
|
35
44
|
register(:git) { Gitt::Repository.new }
|
36
45
|
register(:logger) { Cogger.new id: :rubysmith }
|
37
46
|
register :kernel, Kernel
|
47
|
+
register :io, STDOUT
|
38
48
|
end
|
39
49
|
end
|
@@ -9,28 +9,28 @@ module Rubysmith
|
|
9
9
|
module Extensions
|
10
10
|
# Ensures gem dependencies are installed.
|
11
11
|
class Bundler
|
12
|
+
include Import[:settings]
|
13
|
+
|
12
14
|
using Refinements::IO
|
13
15
|
using Refinements::Pathname
|
14
16
|
|
15
|
-
def
|
16
|
-
|
17
|
-
def initialize configuration, client: ::Bundler::CLI
|
18
|
-
@configuration = configuration
|
17
|
+
def initialize(client: ::Bundler::CLI, **)
|
19
18
|
@client = client
|
19
|
+
super(**)
|
20
20
|
end
|
21
21
|
|
22
22
|
def call
|
23
|
-
|
23
|
+
settings.project_root.change_dir do
|
24
24
|
client.start %w[install --quiet]
|
25
25
|
STDOUT.squelch { client.start %w[lock --add-platform x86_64-linux --update] }
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
true
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
attr_reader :
|
33
|
+
attr_reader :client
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -7,30 +7,30 @@ module Rubysmith
|
|
7
7
|
module Extensions
|
8
8
|
# Ensures project skeleton has pragmas.
|
9
9
|
class Pragmater
|
10
|
-
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
|
-
|
12
|
+
using Refinements::Pathname
|
13
13
|
|
14
|
-
|
15
|
-
::Pragmater::Configuration::Model[
|
14
|
+
CLIENT = ::Pragmater::Inserter.new(
|
15
|
+
settings: ::Pragmater::Configuration::Model[
|
16
16
|
comments: ["# frozen_string_literal: true"],
|
17
17
|
patterns: %w[**/*.rake **/*.rb *.gemspec exe/* bin/* config.ru *file]
|
18
18
|
]
|
19
|
-
|
19
|
+
).freeze
|
20
20
|
|
21
|
-
def initialize
|
22
|
-
@configuration = configuration
|
21
|
+
def initialize(client: CLIENT, **)
|
23
22
|
@client = client
|
23
|
+
super(**)
|
24
24
|
end
|
25
25
|
|
26
26
|
def call
|
27
|
-
|
28
|
-
|
27
|
+
settings.project_root.change_dir { client.call }
|
28
|
+
true
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
attr_reader :
|
33
|
+
attr_reader :client
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -8,29 +8,29 @@ module Rubysmith
|
|
8
8
|
module Extensions
|
9
9
|
# Ensures project skeleton adheres to style guide.
|
10
10
|
class Rubocop
|
11
|
+
include Import[:settings]
|
12
|
+
|
11
13
|
using Refinements::IO
|
12
14
|
using Refinements::Pathname
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
-
def initialize configuration, client: ::RuboCop::CLI.new
|
17
|
-
@configuration = configuration
|
16
|
+
def initialize(client: ::RuboCop::CLI.new, **)
|
18
17
|
@client = client
|
18
|
+
super(**)
|
19
19
|
end
|
20
20
|
|
21
21
|
def call
|
22
|
-
project_root =
|
22
|
+
project_root = settings.project_root
|
23
23
|
|
24
24
|
project_root.change_dir do
|
25
25
|
STDOUT.squelch { client.run ["--autocorrect-all", project_root.to_s] }
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
true
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
attr_reader :
|
33
|
+
attr_reader :client
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|