rubysmith 5.1.0 → 5.3.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/lib/rubysmith/builder.rb +15 -4
- data/lib/rubysmith/builders/init.rb +29 -0
- data/lib/rubysmith/builders/rake.rb +1 -1
- data/lib/rubysmith/builders/rspec/helper.rb +1 -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 +7 -3
- data/lib/rubysmith/configuration/transformers/git_hub_user.rb +7 -3
- data/lib/rubysmith/configuration/transformers/git_user.rb +12 -2
- data/lib/rubysmith/templates/%project_name%/Rakefile.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/bin/console.erb +1 -1
- data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +2 -3
- 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: cc23eb9d3a6f0e1d1d06c596462a9c8622b921d51b637890fdd37fc4141b30d7
|
4
|
+
data.tar.gz: 67da0c327b758738432249bb9f061c76ed5c7db30697d81bbd66cde1502b354f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 252f2eaf5a0e6c6c5c73173ad3a1e8cec42e15f87ed6791f40433cd5daf066039e4971bed9bde24af7d71fd815b82c4becb9fb61a44c85e87b0ecb0be63e5631
|
7
|
+
data.tar.gz: 3ed51c609c79770c5e080400a89464ea1a517e5c2278c190ecd32b9ae7fcebbc025a545856327a889fd809d8c921cca2fb8b52132da72c00b0652701a96eb506
|
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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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 =
|
18
|
+
def call(value = nil) = 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
|
@@ -10,10 +10,14 @@ module Rubysmith
|
|
10
10
|
include Import[:git]
|
11
11
|
include Dry::Monads[:result]
|
12
12
|
|
13
|
-
def call content
|
14
|
-
return Success content if content[:author_email]
|
13
|
+
def call(content) = content[:author_email] ? Success(content) : email_or(content)
|
15
14
|
|
16
|
-
|
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 }
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -10,10 +10,14 @@ module Rubysmith
|
|
10
10
|
include Import[:git]
|
11
11
|
include Dry::Monads[:result]
|
12
12
|
|
13
|
-
def call content
|
14
|
-
return Success content if content[:git_hub_user]
|
13
|
+
def call(content) = content[:git_hub_user] ? Success(content) : user_or(content)
|
15
14
|
|
16
|
-
|
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 }
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -13,9 +13,19 @@ module Rubysmith
|
|
13
13
|
def call content
|
14
14
|
return Success content if content[:author_given_name] || content[:author_family_name]
|
15
15
|
|
16
|
-
|
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
|
26
|
+
|
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
|
@@ -23,7 +23,7 @@ require "bundler/setup"
|
|
23
23
|
Reek::Rake::Task.new
|
24
24
|
<% end %>
|
25
25
|
<% if configuration.build_rspec %>
|
26
|
-
RSpec::Core::RakeTask.new
|
26
|
+
RSpec::Core::RakeTask.new { |task| task.verbose = false }
|
27
27
|
<% end %>
|
28
28
|
<% if configuration.build_caliber %>
|
29
29
|
RuboCop::RakeTask.new
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
Bundler.require :tools
|
3
|
-
|
4
1
|
<% if configuration.build_simple_cov %>
|
5
2
|
require "simplecov"
|
6
3
|
|
@@ -14,6 +11,8 @@ unless ENV["NO_COVERAGE"]
|
|
14
11
|
end
|
15
12
|
<% end %>
|
16
13
|
|
14
|
+
Bundler.require :tools
|
15
|
+
|
17
16
|
require "<%= configuration.project_path %>"
|
18
17
|
<% if configuration.build_refinements %>
|
19
18
|
require "refinements"
|
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.
|
4
|
+
version: 5.3.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-22 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
|