Sha256: c5e2c3c254b33d4daf115bca2963a8c13d8c174fd1758e530fa9bbd4148ef196

Contents?: true

Size: 635 Bytes

Versions: 4

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

require "tocer"

module Gemsmith
  module Generators
    # Generates documentation support.
    class Documentation < Base
      def run
        create_files
        update_readme
      end

      private

      def create_files
        template "%gem_name%/README.md.tt"
        template "%gem_name%/CONTRIBUTING.md.tt"
        template "%gem_name%/CODE_OF_CONDUCT.md.tt"
        template "%gem_name%/LICENSE.md.tt"
        template "%gem_name%/CHANGES.md.tt"
      end

      def update_readme
        gem_root.join("README.md").then { |path| Tocer::Writer.new(path).call }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gemsmith-15.3.0 lib/gemsmith/generators/documentation.rb
gemsmith-15.2.0 lib/gemsmith/generators/documentation.rb
gemsmith-15.1.1 lib/gemsmith/generators/documentation.rb
gemsmith-15.1.0 lib/gemsmith/generators/documentation.rb