Class: Gemsmith::Generators::Documentation
- Inherits:
-
Base
- Object
- Base
- Gemsmith::Generators::Documentation
show all
- Defined in:
- lib/gemsmith/generators/documentation.rb
Overview
Generates documentation support.
Instance Method Summary
collapse
Methods inherited from Base
#initialize, run
Instance Method Details
#create_files ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/gemsmith/generators/documentation.rb', line 9
def create_files
cli.template "%gem_name%/README.md.tt", configuration
cli.template "%gem_name%/CONTRIBUTING.md.tt", configuration
cli.template "%gem_name%/CODE_OF_CONDUCT.md.tt", configuration
cli.template "%gem_name%/LICENSE.md.tt", configuration
cli.template "%gem_name%/CHANGES.md.tt", configuration
end
|
#run ⇒ Object
22
23
24
25
|
# File 'lib/gemsmith/generators/documentation.rb', line 22
def run
create_files
update_readme
end
|
#update_readme ⇒ Object
17
18
19
20
|
# File 'lib/gemsmith/generators/documentation.rb', line 17
def update_readme
file = File.join cli.destination_root, configuration.dig(:gem, :name), "README.md"
Tocer::Writer.new(file).write
end
|