rubysmith 0.13.0 → 0.16.1
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 +93 -32
- data/{bin → exe}/rubysmith +0 -0
- data/lib/rubysmith/builder.rb +1 -1
- data/lib/rubysmith/builders/bundler.rb +1 -1
- data/lib/rubysmith/builders/circle_ci.rb +26 -0
- data/lib/rubysmith/builders/documentation/change.rb +32 -0
- data/lib/rubysmith/builders/documentation/conduct.rb +32 -0
- data/lib/rubysmith/builders/documentation/contribution.rb +32 -0
- data/lib/rubysmith/builders/documentation/license.rb +36 -0
- data/lib/rubysmith/builders/documentation/readme.rb +44 -0
- data/lib/rubysmith/builders/git_hub.rb +34 -0
- data/lib/rubysmith/cli/actions/build.rb +7 -1
- data/lib/rubysmith/cli/configuration/content.rb +26 -7
- data/lib/rubysmith/cli/configuration/defaults.yml +13 -6
- data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +26 -0
- data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +33 -0
- data/lib/rubysmith/cli/configuration/enhancers/version.rb +26 -0
- data/lib/rubysmith/cli/configuration/loader.rb +13 -5
- data/lib/rubysmith/cli/parsers/build.rb +145 -21
- data/lib/rubysmith/cli/parsers/core.rb +1 -1
- data/lib/rubysmith/cli/shell.rb +4 -2
- data/lib/rubysmith/identity.rb +1 -1
- data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +31 -0
- data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +14 -0
- data/lib/rubysmith/templates/%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb +8 -0
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +9 -6
- data/lib/rubysmith/templates/%project_name%/README.adoc.erb +4 -0
- data/lib/rubysmith/templates/%project_name%/README.md.erb +3 -0
- data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +0 -3
- data/lib/rubysmith.rb +4 -1
- data.tar.gz.sig +0 -0
- metadata +51 -10
- metadata.gz.sig +0 -0
- data/lib/rubysmith/builders/documentation.rb +0 -57
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Rubysmith
|
4
|
-
module Builders
|
5
|
-
# Builds project skeleton documentation.
|
6
|
-
class Documentation
|
7
|
-
def self.call(...) = new(...).call
|
8
|
-
|
9
|
-
def initialize configuration, builder: Builder
|
10
|
-
@configuration = configuration
|
11
|
-
@builder = builder
|
12
|
-
end
|
13
|
-
|
14
|
-
def call
|
15
|
-
return unless configuration.build_documentation
|
16
|
-
|
17
|
-
private_methods.sort.grep(/render_/).each { |method| __send__ method }
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
attr_reader :configuration, :builder
|
23
|
-
|
24
|
-
def render_changes
|
25
|
-
builder.call(configuration.with(template_path: "%project_name%/CHANGES.#{kind}.erb"))
|
26
|
-
.render
|
27
|
-
end
|
28
|
-
|
29
|
-
def render_conduct
|
30
|
-
configuration.with(template_path: "%project_name%/CODE_OF_CONDUCT.#{kind}.erb")
|
31
|
-
.then { |updated_configuration| builder.call(updated_configuration).render }
|
32
|
-
end
|
33
|
-
|
34
|
-
def render_contributions
|
35
|
-
builder.call(configuration.with(template_path: "%project_name%/CONTRIBUTING.#{kind}.erb"))
|
36
|
-
.render
|
37
|
-
end
|
38
|
-
|
39
|
-
def render_license
|
40
|
-
configuration.with(template_path: "%project_name%/LICENSE-#{license}.#{kind}.erb")
|
41
|
-
.then do |updated_configuration|
|
42
|
-
builder.call(updated_configuration).render.rename "LICENSE.#{kind}"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def render_readme
|
47
|
-
builder.call(configuration.with(template_path: "%project_name%/README.#{kind}.erb"))
|
48
|
-
.render
|
49
|
-
.replace("\n\n\n", "\n\n")
|
50
|
-
end
|
51
|
-
|
52
|
-
def kind = configuration.documentation_format || "md"
|
53
|
-
|
54
|
-
def license = configuration.documentation_license || "mit"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|