Class: FaviconMaker::Generator
- Inherits:
-
Object
- Object
- FaviconMaker::Generator
- Extended by:
- Forwardable
- Defined in:
- lib/favicon_maker/generator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#creators ⇒ Object
Returns the value of attribute creators.
-
#finished_block ⇒ Object
Returns the value of attribute finished_block.
Instance Method Summary collapse
- #each_icon(&block) ⇒ Object
- #from(template_filename, options = "", &block) ⇒ Object
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
- #setup(&block) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
21 22 23 |
# File 'lib/favicon_maker/generator.rb', line 21 def initialize @creators = {} end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
15 16 17 |
# File 'lib/favicon_maker/generator.rb', line 15 def config @config end |
#creators ⇒ Object
Returns the value of attribute creators.
16 17 18 |
# File 'lib/favicon_maker/generator.rb', line 16 def creators @creators end |
#finished_block ⇒ Object
Returns the value of attribute finished_block.
17 18 19 |
# File 'lib/favicon_maker/generator.rb', line 17 def finished_block @finished_block end |
Instance Method Details
#each_icon(&block) ⇒ Object
33 34 35 |
# File 'lib/favicon_maker/generator.rb', line 33 def each_icon(&block) @finished_block = block end |
#from(template_filename, options = "", &block) ⇒ Object
29 30 31 |
# File 'lib/favicon_maker/generator.rb', line 29 def from(template_filename, ="", &block) creators[template_filename] = [, block] end |
#setup(&block) ⇒ Object
25 26 27 |
# File 'lib/favicon_maker/generator.rb', line 25 def setup(&block) @config = Docile.dsl_eval(MakerConfig.new, &block) end |
#start ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/favicon_maker/generator.rb', line 37 def start creators.each do |template_filename, | template_file = File.join(template_dir, template_filename) , creator_block = * Docile.dsl_eval(Creator.new(template_file, output_dir, , finished_block), &creator_block).run end end |