Sha256: d7d96de4e7db82f8ade88863ccb9ce8a7c7c9d976ae25ab44e792f7b80be01d0
Contents?: true
Size: 1.5 KB
Versions: 3
Compression:
Stored size: 1.5 KB
Contents
# frozen_string_literal: true module Rubysmith module Builders # Builds project skeleton documentation. class Documentation def self.call realm, builder: Builder new(realm, builder: builder).call end def initialize realm, builder: Builder @realm = realm @builder = builder end def call return unless realm.build_documentation private_methods.sort.grep(/render_/).each { |method| __send__ method } end private attr_reader :realm, :builder def render_changes builder.call(realm.with(template_path: "%project_name%/CHANGES.#{kind}.erb")) .render end def render_conduct builder.call(realm.with(template_path: "%project_name%/CODE_OF_CONDUCT.#{kind}.erb")) .render end def render_contributions builder.call(realm.with(template_path: "%project_name%/CONTRIBUTING.#{kind}.erb")) .render end def render_license builder.call(realm.with(template_path: "%project_name%/LICENSE-#{license}.#{kind}.erb")) .render .rename "LICENSE.#{kind}" end def render_readme builder.call(realm.with(template_path: "%project_name%/README.#{kind}.erb")) .render .replace("\n\n\n", "\n\n") end def kind realm.documentation_format || "md" end def license realm.documentation_license || "mit" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubysmith-0.9.1 | lib/rubysmith/builders/documentation.rb |
rubysmith-0.9.0 | lib/rubysmith/builders/documentation.rb |
rubysmith-0.8.0 | lib/rubysmith/builders/documentation.rb |