Class: Charming::Generators::Base
- Inherits:
-
Object
- Object
- Charming::Generators::Base
- Defined in:
- lib/charming/generators/base.rb
Overview
Base is the parent class for all Charming file generators. Subclasses implement ‘generate` to write the appropriate files. The base class provides `create_file`, which writes content to a path under the configured destination and refuses to overwrite existing files unless force was set.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(out:, destination:, force: false) ⇒ Base
constructor
out is the status-output stream.
Constructor Details
#initialize(out:, destination:, force: false) ⇒ Base
out is the status-output stream. destination is the app root for generated files. force (default false) allows overwriting existing files.
14 15 16 17 18 |
# File 'lib/charming/generators/base.rb', line 14 def initialize(out:, destination:, force: false) @out = out @destination = destination @force = force end |