Class: SleepingKingStudios::Docs::Commands::Generators::Base
- Inherits:
-
Cuprum::Command
- Object
- Cuprum::Command
- SleepingKingStudios::Docs::Commands::Generators::Base
- Includes:
- Cuprum::ExceptionHandling
- Defined in:
- lib/sleeping_king_studios/docs/commands/generators/base.rb
Overview
Abstract base class for writing generator classes.
Direct Known Subclasses
SleepingKingStudios::Docs::Commands::Generate, DataGenerator, ReferenceGenerator
Instance Attribute Summary collapse
-
#docs_path ⇒ String
readonly
The directory path for generating the documentation files.
-
#options ⇒ Hash
readonly
The configured options for the generator.
Instance Method Summary collapse
-
#dry_run? ⇒ Boolean
If true, does not make any changes to the filesystem.
-
#force? ⇒ Boolean
If true, overwrites any existing files.
-
#initialize(docs_path:, **options) ⇒ Base
constructor
A new instance of Base.
-
#template_path ⇒ String
The relative path to the Jekyll templates for each data type.
-
#verbose? ⇒ Boolean
If true, prints status messages to STDOUT.
-
#version ⇒ String
The code version for the generated documentation.
Constructor Details
#initialize(docs_path:, **options) ⇒ Base
Returns a new instance of Base.
25 26 27 28 29 30 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 25 def initialize(docs_path:, **) super() @docs_path = docs_path = .merge() end |
Instance Attribute Details
#docs_path ⇒ String (readonly)
Returns the directory path for generating the documentation files.
34 35 36 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 34 def docs_path @docs_path end |
#options ⇒ Hash (readonly)
Returns the configured options for the generator.
37 38 39 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 37 def end |
Instance Method Details
#dry_run? ⇒ Boolean
Returns if true, does not make any changes to the filesystem.
40 41 42 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 40 def dry_run? [:dry_run] end |
#force? ⇒ Boolean
Returns if true, overwrites any existing files.
45 46 47 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 45 def force? [:force] end |
#template_path ⇒ String
Returns the relative path to the Jekyll templates for each data type.
51 52 53 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 51 def template_path .fetch(:template_path, 'reference') end |
#verbose? ⇒ Boolean
Returns if true, prints status messages to STDOUT.
56 57 58 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 56 def verbose? [:verbose] end |
#version ⇒ String
Returns the code version for the generated documentation.
61 62 63 |
# File 'lib/sleeping_king_studios/docs/commands/generators/base.rb', line 61 def version [:version] end |