Class: ReadmeGenerator::Generator
- Inherits:
-
Object
- Object
- ReadmeGenerator::Generator
- Defined in:
- lib/readme_generator.rb
Overview
Main entry point for the README Generator
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_path.
Instance Method Summary collapse
- #generate(output_filename = 'README.md') ⇒ Object
-
#initialize(project_path = Dir.pwd, options = {}) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(project_path = Dir.pwd, options = {}) ⇒ Generator
Returns a new instance of Generator.
14 15 16 17 |
# File 'lib/readme_generator.rb', line 14 def initialize(project_path = Dir.pwd, = {}) @project_path = File.(project_path) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/readme_generator.rb', line 12 def @options end |
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
12 13 14 |
# File 'lib/readme_generator.rb', line 12 def project_path @project_path end |
Instance Method Details
#generate(output_filename = 'README.md') ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/readme_generator.rb', line 19 def generate(output_filename = 'README.md') scanner = Scanner.new(project_path) project_info = scanner.scan template_builder = TemplateBuilder.new(project_info, ) readme_content = template_builder.build output_path = File.join(project_path, output_filename) File.write(output_path, readme_content) output_path end |