Sha256: 2c3c5cd8e05910f42c3a133323a50d3d0614ddf8acf1a5fe6308ccda8d699eae

Contents?: true

Size: 639 Bytes

Versions: 12

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

require "refinements/struct"

module Rubysmith
  module Builders
    module Documentation
      # Builds project skeleton README documentation.
      class Readme < Abstract
        using Refinements::Struct

        def call
          return false unless settings.build_readme

          builder.call(settings.merge(template_path: "%project_name%/README.#{kind}.erb"))
                 .render
                 .replace(/\n{2,}/, "\n\n")
                 .replace("\n    \n", "\n")

          true
        end

        protected

        def kind = settings.documentation_format
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubysmith-8.1.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-8.0.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.9.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.8.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.7.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.6.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.5.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.4.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.3.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.2.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.1.0 lib/rubysmith/builders/documentation/readme.rb
rubysmith-7.0.0 lib/rubysmith/builders/documentation/readme.rb