rubysmith 5.0.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rubysmith/builder.rb +15 -4
- data/lib/rubysmith/builders/init.rb +29 -0
- data/lib/rubysmith/cli/actions/amazing_print.rb +1 -4
- data/lib/rubysmith/cli/actions/caliber.rb +1 -4
- data/lib/rubysmith/cli/actions/circle_ci.rb +1 -4
- data/lib/rubysmith/cli/actions/citation.rb +1 -4
- data/lib/rubysmith/cli/actions/community.rb +1 -4
- data/lib/rubysmith/cli/actions/conduct.rb +1 -4
- data/lib/rubysmith/cli/actions/console.rb +1 -4
- data/lib/rubysmith/cli/actions/contributions.rb +1 -4
- data/lib/rubysmith/cli/actions/debug.rb +1 -4
- data/lib/rubysmith/cli/actions/funding.rb +1 -4
- data/lib/rubysmith/cli/actions/git.rb +1 -4
- data/lib/rubysmith/cli/actions/git_hub.rb +1 -4
- data/lib/rubysmith/cli/actions/git_hub_ci.rb +1 -4
- data/lib/rubysmith/cli/actions/git_lint.rb +1 -4
- data/lib/rubysmith/cli/actions/guard.rb +1 -4
- data/lib/rubysmith/cli/actions/license.rb +1 -4
- data/lib/rubysmith/cli/actions/maximum.rb +1 -1
- data/lib/rubysmith/cli/actions/minimum.rb +1 -1
- data/lib/rubysmith/cli/actions/name.rb +1 -4
- data/lib/rubysmith/cli/actions/publish.rb +2 -2
- data/lib/rubysmith/cli/actions/rake.rb +1 -4
- data/lib/rubysmith/cli/actions/readme.rb +1 -4
- data/lib/rubysmith/cli/actions/reek.rb +1 -4
- data/lib/rubysmith/cli/actions/refinements.rb +1 -4
- data/lib/rubysmith/cli/actions/rspec.rb +1 -4
- data/lib/rubysmith/cli/actions/security.rb +1 -4
- data/lib/rubysmith/cli/actions/setup.rb +1 -4
- data/lib/rubysmith/cli/actions/simple_cov.rb +1 -4
- data/lib/rubysmith/cli/actions/versions.rb +1 -4
- data/lib/rubysmith/cli/actions/yard.rb +1 -4
- data/lib/rubysmith/cli/actions/zeitwerk.rb +1 -4
- data/lib/rubysmith/cli/commands/build.rb +1 -2
- data/lib/rubysmith/configuration/model.rb +0 -2
- data/lib/rubysmith/configuration/transformers/git_email.rb +12 -6
- data/lib/rubysmith/configuration/transformers/git_hub_user.rb +12 -6
- data/lib/rubysmith/configuration/transformers/git_user.rb +19 -9
- data/lib/rubysmith/configuration/transformers/template_root.rb +16 -6
- data/lib/rubysmith/container.rb +6 -4
- data/rubysmith.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -2
- 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: cba3bd0c9495f7d9eac9352aaddcbff8697352579b03fc66c34cb476870ca967
|
4
|
+
data.tar.gz: 5792c9c7a7cc5a6d1265bbd4461acb1195d7e19107dd84b4b8f61d7a68946830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9edc097233d311cd1d5f7978842aa1e97d8ce49f948221c21b7363aa778be090a890e9b8b41e86c65837d6cd0146dcddcd21590148a198acafc56b700abd533b
|
7
|
+
data.tar.gz: 076e94f6361e25ab206e7ec2528485a34c62a654452dea13919c655803ccae818c53df0166daecc7c960d2e4f40b25b94997af13dd82f8a6af20a3946e63a538
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rubysmith/builder.rb
CHANGED
@@ -7,11 +7,11 @@ require "refinements/pathnames"
|
|
7
7
|
module Rubysmith
|
8
8
|
# Provides common functionality necessary for all builders.
|
9
9
|
class Builder
|
10
|
-
include Import[:logger]
|
10
|
+
include Import[:kernel, :logger]
|
11
11
|
|
12
12
|
using Refinements::Pathnames
|
13
13
|
|
14
|
-
HELPERS = {inserter: Text::Inserter, renderer: Renderers::ERB,
|
14
|
+
HELPERS = {inserter: Text::Inserter, renderer: Renderers::ERB, executor: Open3}.freeze
|
15
15
|
|
16
16
|
def self.call(...) = new(...)
|
17
17
|
|
@@ -27,6 +27,17 @@ module Rubysmith
|
|
27
27
|
self
|
28
28
|
end
|
29
29
|
|
30
|
+
def check
|
31
|
+
path = build_path
|
32
|
+
|
33
|
+
if path.exist?
|
34
|
+
log_error "Path exists: #{path}."
|
35
|
+
kernel.abort
|
36
|
+
else
|
37
|
+
log_debug "Checked: #{path}."
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
30
41
|
def delete
|
31
42
|
log_debug "Deleting: #{relative_build_path}"
|
32
43
|
build_path.delete
|
@@ -104,7 +115,7 @@ module Rubysmith
|
|
104
115
|
attr_reader :configuration, :helpers
|
105
116
|
|
106
117
|
def execute *command
|
107
|
-
|
118
|
+
executor.capture2e(*command).then do |result, status|
|
108
119
|
log_error result unless status.success?
|
109
120
|
end
|
110
121
|
end
|
@@ -113,7 +124,7 @@ module Rubysmith
|
|
113
124
|
|
114
125
|
def renderer = helpers.fetch(__method__).new(configuration)
|
115
126
|
|
116
|
-
def
|
127
|
+
def executor = helpers.fetch(__method__)
|
117
128
|
|
118
129
|
def relative_build_path = build_path.relative_path_from(configuration.target_root)
|
119
130
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
4
|
+
require "refinements/structs"
|
5
|
+
|
6
|
+
module Rubysmith
|
7
|
+
module Builders
|
8
|
+
# Initializes building of project by checking for existence first.
|
9
|
+
class Init
|
10
|
+
using Refinements::Structs
|
11
|
+
|
12
|
+
def self.call(...) = new(...).call
|
13
|
+
|
14
|
+
def initialize configuration, builder: Builder
|
15
|
+
@configuration = configuration
|
16
|
+
@builder = builder
|
17
|
+
end
|
18
|
+
|
19
|
+
def call
|
20
|
+
builder.call(configuration.merge(template_path: "%project_name%")).check
|
21
|
+
configuration
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :configuration, :builder
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class AmazingPrint < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Amazing Print gem."
|
16
13
|
|
17
14
|
on "--[no-]amazing_print"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_amazing_print }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_amazing_print = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Caliber < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Caliber gem."
|
16
13
|
|
17
14
|
on "--[no-]caliber"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_caliber }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_caliber = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class CircleCI < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Circle CI configuration."
|
16
13
|
|
17
14
|
on "--[no-]circle_ci"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_circle_ci }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_circle_ci = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Citation < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add citation documentation."
|
16
13
|
|
17
14
|
on "--[no-]citation"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_citation }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_citation = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Community < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add community documentation."
|
16
13
|
|
17
14
|
on "--[no-]community"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_community }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_community = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Conduct < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add code of conduct documentation."
|
16
13
|
|
17
14
|
on "--[no-]conduct"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_conduct }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_conduct = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Console < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add console script."
|
16
13
|
|
17
14
|
on "--[no-]console"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_console }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_console = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Contributions < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add contributions documentation."
|
16
13
|
|
17
14
|
on "--[no-]contributions"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_contributions }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_contributions = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Debug < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Debug gem."
|
16
13
|
|
17
14
|
on "--[no-]debug"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_debug }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_debug = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Funding < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add GitHub funding configuration."
|
16
13
|
|
17
14
|
on "--[no-]funding"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_funding }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_funding = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Git < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Git repository."
|
16
13
|
|
17
14
|
on "--[no-]git"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_git }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_git = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class GitHub < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add GitHub templates."
|
16
13
|
|
17
14
|
on "--[no-]git_hub"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_git_hub }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_git_hub = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class GitHubCI < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add GitHub continuous integration."
|
16
13
|
|
17
14
|
on "--[no-]git_hub_ci"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_git_hub_ci }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_git_hub_ci = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class GitLint < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Git Lint gem."
|
16
13
|
|
17
14
|
on "--[no-]git-lint"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_git_lint }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_git_lint = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Guard < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Guard gem."
|
16
13
|
|
17
14
|
on "--[no-]guard"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_guard }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_guard = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class License < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add license documentation."
|
16
13
|
|
17
14
|
on "--[no-]license"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_license }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_license = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,13 +9,11 @@ module Rubysmith
|
|
10
9
|
class Name < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Set project name."
|
16
13
|
|
17
14
|
on %w[-n --name], argument: "NAME"
|
18
15
|
|
19
|
-
def call(name) = input.
|
16
|
+
def call(name) = input.project_name = name
|
20
17
|
end
|
21
18
|
end
|
22
19
|
end
|
@@ -8,7 +8,7 @@ module Rubysmith
|
|
8
8
|
module Actions
|
9
9
|
# Publishes project.
|
10
10
|
class Publish < Sod::Action
|
11
|
-
include Import[:
|
11
|
+
include Import[:input]
|
12
12
|
|
13
13
|
using ::Refinements::Structs
|
14
14
|
|
@@ -21,7 +21,7 @@ module Rubysmith
|
|
21
21
|
@extension = extension
|
22
22
|
end
|
23
23
|
|
24
|
-
def call(version) = extension.call
|
24
|
+
def call(version) = extension.call input.merge(project_version: version)
|
25
25
|
|
26
26
|
private
|
27
27
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Rake < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Rake gem."
|
16
13
|
|
17
14
|
on "--[no-]rake"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_rake }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_rake = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Readme < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add readme documentation."
|
16
13
|
|
17
14
|
on "--[no-]readme"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_readme }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_readme = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Reek < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Reek gem."
|
16
13
|
|
17
14
|
on "--[no-]reek"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_reek }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_reek = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Refinements < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Refinements gem."
|
16
13
|
|
17
14
|
on "--[no-]refinements"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_refinements }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_refinements = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class RSpec < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add RSpec gem."
|
16
13
|
|
17
14
|
on "--[no-]rspec"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_rspec }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_rspec = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Security < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add security."
|
16
13
|
|
17
14
|
on "--[no-]security"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_security }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_security = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Setup < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add setup script."
|
16
13
|
|
17
14
|
on "--[no-]setup"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_setup }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_setup = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class SimpleCov < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add SimpleCov gem."
|
16
13
|
|
17
14
|
on "--[no-]simple_cov"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_simple_cov }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_simple_cov = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Versions < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add version history."
|
16
13
|
|
17
14
|
on "--[no-]versions"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_versions }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_versions = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Yard < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Yard gem."
|
16
13
|
|
17
14
|
on "--[no-]yard"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_yard }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_yard = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/structs"
|
4
3
|
require "sod"
|
5
4
|
|
6
5
|
module Rubysmith
|
@@ -10,15 +9,13 @@ module Rubysmith
|
|
10
9
|
class Zeitwerk < Sod::Action
|
11
10
|
include Import[:input]
|
12
11
|
|
13
|
-
using ::Refinements::Structs
|
14
|
-
|
15
12
|
description "Add Zeitwerk gem."
|
16
13
|
|
17
14
|
on "--[no-]zeitwerk"
|
18
15
|
|
19
16
|
default { Container[:configuration].build_zeitwerk }
|
20
17
|
|
21
|
-
def call(value = default) = input.
|
18
|
+
def call(value = default) = input.build_zeitwerk = value
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -11,8 +11,8 @@ module Rubysmith
|
|
11
11
|
include Import[:input, :kernel, :logger]
|
12
12
|
|
13
13
|
# Order is important.
|
14
|
-
# rubocop:todo Metrics/CollectionLiteralLength
|
15
14
|
BUILDERS = [
|
15
|
+
Builders::Init,
|
16
16
|
Builders::Core,
|
17
17
|
Builders::Version,
|
18
18
|
Builders::Documentation::Readme,
|
@@ -41,7 +41,6 @@ module Rubysmith
|
|
41
41
|
Extensions::Rubocop,
|
42
42
|
Builders::Git::Commit
|
43
43
|
].freeze
|
44
|
-
# rubocop:enable Metrics/CollectionLiteralLength
|
45
44
|
|
46
45
|
handle "build"
|
47
46
|
|
@@ -6,7 +6,6 @@ require "refinements/strings"
|
|
6
6
|
require "refinements/structs"
|
7
7
|
|
8
8
|
module Rubysmith
|
9
|
-
# rubocop:disable Metrics/ModuleLength
|
10
9
|
module Configuration
|
11
10
|
# Defines the common configuration content for use throughout the gem.
|
12
11
|
Model = Struct.new(
|
@@ -158,5 +157,4 @@ module Rubysmith
|
|
158
157
|
end
|
159
158
|
end
|
160
159
|
end
|
161
|
-
# rubocop:enable Metrics/ModuleLength
|
162
160
|
end
|
@@ -1,18 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/monads"
|
4
|
-
require "gitt"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Configuration
|
8
|
-
# Dynamically adds Git email if defined.
|
9
7
|
module Transformers
|
10
|
-
|
8
|
+
# Dynamically adds Git email if defined.
|
9
|
+
class GitEmail
|
10
|
+
include Import[:git]
|
11
|
+
include Dry::Monads[:result]
|
11
12
|
|
12
|
-
|
13
|
-
return Dry::Monads::Success content if content[:author_email]
|
13
|
+
def call(content) = content[:author_email] ? Success(content) : email_or(content)
|
14
14
|
|
15
|
-
|
15
|
+
private
|
16
|
+
|
17
|
+
def email_or content
|
18
|
+
git.get("user.email", nil)
|
19
|
+
.fmap { |email| email ? content.merge!(author_email: email) : content }
|
20
|
+
.or { Success content }
|
21
|
+
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -1,18 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/monads"
|
4
|
-
require "gitt"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Configuration
|
8
|
-
# Dynamically adds GitHub user if user is defined.
|
9
7
|
module Transformers
|
10
|
-
|
8
|
+
# Dynamically adds GitHub user if user is defined.
|
9
|
+
class GitHubUser
|
10
|
+
include Import[:git]
|
11
|
+
include Dry::Monads[:result]
|
11
12
|
|
12
|
-
|
13
|
-
return Dry::Monads::Success content if content[:git_hub_user]
|
13
|
+
def call(content) = content[:git_hub_user] ? Success(content) : user_or(content)
|
14
14
|
|
15
|
-
|
15
|
+
private
|
16
|
+
|
17
|
+
def user_or content
|
18
|
+
git.get("github.user", nil)
|
19
|
+
.fmap { |user| user ? content.merge!(git_hub_user: user) : content }
|
20
|
+
.or { Success content }
|
21
|
+
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -1,21 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/monads"
|
4
|
-
require "gitt"
|
5
4
|
|
6
5
|
module Rubysmith
|
7
6
|
module Configuration
|
8
|
-
# Dynamically adds Git user if defined.
|
9
7
|
module Transformers
|
10
|
-
|
8
|
+
# Dynamically adds Git user if defined.
|
9
|
+
class GitUser
|
10
|
+
include Import[:git]
|
11
|
+
include Dry::Monads[:result]
|
12
|
+
|
13
|
+
def call content
|
14
|
+
return Success content if content[:author_given_name] || content[:author_family_name]
|
15
|
+
|
16
|
+
name_or content
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def name_or(content) = split(content).or { Success content }
|
22
|
+
|
23
|
+
def split content
|
24
|
+
git.get("user.name", nil).fmap do |name|
|
25
|
+
next content unless name
|
11
26
|
|
12
|
-
GitUser = lambda do |content, git: Gitt::Repository.new|
|
13
|
-
if content[:author_given_name] || content[:author_family_name]
|
14
|
-
Dry::Monads::Success content
|
15
|
-
else
|
16
|
-
git.get("user.name").fmap do |name|
|
17
27
|
first, last = String(name).split
|
18
|
-
content.merge author_given_name: first, author_family_name: last
|
28
|
+
content.merge! author_given_name: first, author_family_name: last
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
@@ -5,17 +5,27 @@ require "refinements/arrays"
|
|
5
5
|
|
6
6
|
module Rubysmith
|
7
7
|
module Configuration
|
8
|
-
# Prepends template roots to existing content.
|
9
8
|
module Transformers
|
10
|
-
|
9
|
+
# Appends custom content to default template roots.
|
10
|
+
class TemplateRoot
|
11
|
+
include Dry::Monads[:result]
|
11
12
|
|
12
|
-
|
13
|
+
using Refinements::Arrays
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
def initialize default = Pathname(__dir__).join("../../templates")
|
16
|
+
@default = default
|
17
|
+
end
|
18
|
+
|
19
|
+
def call content
|
20
|
+
Array(default).map { |path| Pathname path }
|
16
21
|
.including(content[:template_roots])
|
17
22
|
.compact
|
18
|
-
.then { |paths|
|
23
|
+
.then { |paths| Success content.merge!(template_roots: paths) }
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
attr_reader :default
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
data/lib/rubysmith/container.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "cogger"
|
4
4
|
require "dry-container"
|
5
5
|
require "etcher"
|
6
|
+
require "gitt"
|
6
7
|
require "runcom"
|
7
8
|
require "spek"
|
8
9
|
|
@@ -20,10 +21,10 @@ module Rubysmith
|
|
20
21
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
21
22
|
.add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
|
22
23
|
.add_transformer(Configuration::Transformers::CurrentTime)
|
23
|
-
.add_transformer(Configuration::Transformers::GitHubUser)
|
24
|
-
.add_transformer(Configuration::Transformers::GitEmail)
|
25
|
-
.add_transformer(Configuration::Transformers::GitUser)
|
26
|
-
.add_transformer(Configuration::Transformers::TemplateRoot)
|
24
|
+
.add_transformer(Configuration::Transformers::GitHubUser.new)
|
25
|
+
.add_transformer(Configuration::Transformers::GitEmail.new)
|
26
|
+
.add_transformer(Configuration::Transformers::GitUser.new)
|
27
|
+
.add_transformer(Configuration::Transformers::TemplateRoot.new)
|
27
28
|
.add_transformer(Configuration::Transformers::TargetRoot)
|
28
29
|
end
|
29
30
|
|
@@ -31,6 +32,7 @@ module Rubysmith
|
|
31
32
|
register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
|
32
33
|
register(:xdg_config) { Runcom::Config.new "rubysmith/configuration.yml" }
|
33
34
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec" }
|
35
|
+
register(:git) { Gitt::Repository.new }
|
34
36
|
register(:kernel) { Kernel }
|
35
37
|
register(:logger) { Cogger.new formatter: :emoji }
|
36
38
|
end
|
data/rubysmith.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-06-
|
38
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -306,6 +306,7 @@ files:
|
|
306
306
|
- lib/rubysmith/builders/git_hub.rb
|
307
307
|
- lib/rubysmith/builders/git_hub_ci.rb
|
308
308
|
- lib/rubysmith/builders/guard.rb
|
309
|
+
- lib/rubysmith/builders/init.rb
|
309
310
|
- lib/rubysmith/builders/rake.rb
|
310
311
|
- lib/rubysmith/builders/reek.rb
|
311
312
|
- lib/rubysmith/builders/rspec/binstub.rb
|
metadata.gz.sig
CHANGED
Binary file
|