lib/gemsmith/skeletons/documentation_skeleton.rb in gemsmith-5.6.0 vs lib/gemsmith/skeletons/documentation_skeleton.rb in gemsmith-6.0.0

- old
+ new

@@ -1,14 +1,26 @@ +require "tocer" + module Gemsmith module Skeletons # Configures documentation support. class DocumentationSkeleton < BaseSkeleton + 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 + + def update_readme + file = File.join cli.destination_root, configuration.gem_name, "README.md" + Tocer::Writer.new(file).write + end + def create - cli.template "%gem_name%/README.md.tt", cli.template_options - cli.template "%gem_name%/CONTRIBUTING.md.tt", cli.template_options - cli.template "%gem_name%/CODE_OF_CONDUCT.md.tt", cli.template_options - cli.template "%gem_name%/LICENSE.md.tt", cli.template_options - cli.template "%gem_name%/CHANGELOG.md.tt", cli.template_options + create_files + update_readme end end end end