rubysmith 0.13.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +93 -32
  4. data/{bin → exe}/rubysmith +0 -0
  5. data/lib/rubysmith/builder.rb +1 -1
  6. data/lib/rubysmith/builders/bundler.rb +1 -1
  7. data/lib/rubysmith/builders/circle_ci.rb +26 -0
  8. data/lib/rubysmith/builders/documentation/change.rb +32 -0
  9. data/lib/rubysmith/builders/documentation/conduct.rb +32 -0
  10. data/lib/rubysmith/builders/documentation/contribution.rb +32 -0
  11. data/lib/rubysmith/builders/documentation/license.rb +36 -0
  12. data/lib/rubysmith/builders/documentation/readme.rb +44 -0
  13. data/lib/rubysmith/builders/git_hub.rb +34 -0
  14. data/lib/rubysmith/cli/actions/build.rb +7 -1
  15. data/lib/rubysmith/cli/configuration/content.rb +26 -7
  16. data/lib/rubysmith/cli/configuration/defaults.yml +13 -6
  17. data/lib/rubysmith/cli/configuration/enhancers/current_time.rb +26 -0
  18. data/lib/rubysmith/cli/configuration/enhancers/git_hub_user.rb +33 -0
  19. data/lib/rubysmith/cli/configuration/enhancers/version.rb +26 -0
  20. data/lib/rubysmith/cli/configuration/loader.rb +13 -5
  21. data/lib/rubysmith/cli/parsers/build.rb +145 -21
  22. data/lib/rubysmith/cli/parsers/core.rb +1 -1
  23. data/lib/rubysmith/cli/shell.rb +4 -2
  24. data/lib/rubysmith/identity.rb +1 -1
  25. data/lib/rubysmith/templates/%project_name%/.circleci/config.yml.erb +31 -0
  26. data/lib/rubysmith/templates/%project_name%/.github/ISSUE_TEMPLATE.md.erb +14 -0
  27. data/lib/rubysmith/templates/%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb +8 -0
  28. data/lib/rubysmith/templates/%project_name%/Gemfile.erb +9 -6
  29. data/lib/rubysmith/templates/%project_name%/README.adoc.erb +4 -0
  30. data/lib/rubysmith/templates/%project_name%/README.md.erb +3 -0
  31. data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +0 -3
  32. data/lib/rubysmith.rb +4 -1
  33. data.tar.gz.sig +0 -0
  34. metadata +51 -10
  35. metadata.gz.sig +0 -0
  36. 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