Class: Fontcustom::Generator::Template
- Inherits:
-
Object
- Object
- Fontcustom::Generator::Template
- Includes:
- Utility
- Defined in:
- lib/fontcustom/generator/template.rb
Instance Attribute Summary collapse
-
#manifest ⇒ Object
readonly
Returns the value of attribute manifest.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(manifest) ⇒ Template
constructor
A new instance of Template.
Methods included from Utility
#behavior, #destination_root, #line_break, #methodize_hash, #options, #project_root, #say_changed, #say_message, #say_status, #shell, shell, #source_paths, #symbolize_hash, #write_file
Constructor Details
#initialize(manifest) ⇒ Template
Returns a new instance of Template.
12 13 14 15 |
# File 'lib/fontcustom/generator/template.rb', line 12 def initialize(manifest) @manifest = Fontcustom::Manifest.new manifest @options = @manifest.get :options end |
Instance Attribute Details
#manifest ⇒ Object (readonly)
Returns the value of attribute manifest.
10 11 12 |
# File 'lib/fontcustom/generator/template.rb', line 10 def manifest @manifest end |
Instance Method Details
#generate ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/fontcustom/generator/template.rb', line 17 def generate if ! @manifest.get(:fonts).empty? delete_old_templates set_relative_paths create_files else raise Fontcustom::Error, "No generated fonts were detected - aborting template generation." end end |