Class: CapicuaGen::ExampleFeature

Inherits:
TemplateFeature show all
Includes:
CapicuaGen
Defined in:
lib/CapicuaGen/Examples/Example/Source/example_feature.rb

Overview

Caracteristica generadora de una pantalla de Bienvenida

Constant Summary

Constants included from CapicuaGen

VERSION

Instance Attribute Summary

Attributes inherited from TemplateFeature

#template_targets, #templates

Attributes inherited from Feature

#generation_attributes, #generator, #name

Instance Method Summary collapse

Methods included from CapicuaGen

#get_attributes, #initialize_array_parameter, #initialize_properties

Methods inherited from TemplateFeature

#add_template, #add_template_target, #clean, #configure_template_directories, #generate, #generator=, #get_template_by_name, #get_template_target_by_name, #remove_template, #remove_template_by_name, #remove_template_target, #remove_template_target_by_name, #set_template, #set_template_target

Methods inherited from Feature

#argv_options, #clean, #clone, #configure_attributes, #generate, #get_out_file_information, #get_relative_out_files, #is_any_type?, #is_type?, #message_helper, #reset_attributes

Constructor Details

#initialize(values = {}) ⇒ ExampleFeature

Inicializa la caracteristica



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/CapicuaGen/Examples/Example/Source/example_feature.rb', line 37

def initialize(values= {})
  super(values)

  # Configuro los tipos si estos no han sido configurados previamente

  self.types= [:example] if self.types.blank?

  # Configuro los templates

  set_template('generator', Template.new(:file => 'example.erb'))
  set_template('GemFile', Template.new(:file => 'GemFile.erb'))
  set_template('instnwnd', Template.new(:file => 'instnwnd.erb'))


end

Instance Method Details

#configure_template_targetsObject

Configura los objetivos de las platillas (despues de establecer el generador)



52
53
54
55
56
57
58
59
# File 'lib/CapicuaGen/Examples/Example/Source/example_feature.rb', line 52

def configure_template_targets

  # Configuro los templates

  set_template_target('generator', TemplateTarget.new(:out_file => "generator.cs", :types => :example, :copy_only => true))
  set_template_target('GemFile', TemplateTarget.new(:out_file => "GemFile", :types => :proyect_file, :copy_only => true))
  set_template_target('instnwnd', TemplateTarget.new(:out_file => "scripts/instnwnd.sql", :types => :proyect_file, :copy_only => true))

end