Class: Gemsmith::Skeletons::DocumentationSkeleton

Inherits:
BaseSkeleton
  • Object
show all
Defined in:
lib/gemsmith/skeletons/documentation_skeleton.rb

Overview

Configures documentation support.

Instance Method Summary collapse

Methods inherited from BaseSkeleton

create, #initialize

Constructor Details

This class inherits a constructor from Gemsmith::Skeletons::BaseSkeleton

Instance Method Details

#createObject



20
21
22
23
# File 'lib/gemsmith/skeletons/documentation_skeleton.rb', line 20

def create
  create_files
  update_readme
end

#create_filesObject



7
8
9
10
11
12
13
# File 'lib/gemsmith/skeletons/documentation_skeleton.rb', line 7

def create_files
  cli.template "%gem_name%/README.md.tt", configuration.to_h
  cli.template "%gem_name%/CONTRIBUTING.md.tt", configuration.to_h
  cli.template "%gem_name%/CODE_OF_CONDUCT.md.tt", configuration.to_h
  cli.template "%gem_name%/LICENSE.md.tt", configuration.to_h
  cli.template "%gem_name%/CHANGELOG.md.tt", configuration.to_h
end

#update_readmeObject



15
16
17
18
# File 'lib/gemsmith/skeletons/documentation_skeleton.rb', line 15

def update_readme
  file = File.join cli.destination_root, configuration.gem_name, "README.md"
  Tocer::Writer.new(file).write
end