Class: CapicuaGen::Gaspar::CSProyectRESTFulFeature
- Inherits:
-
CSProyectFeature
- Object
- TemplateFeature
- CSProyectFeature
- CapicuaGen::Gaspar::CSProyectRESTFulFeature
- Includes:
- CapicuaGen, CapicuaGen::Gaspar
- Defined in:
- lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Source/cs_proyect_rest_ful_feature.rb
Overview
Caracteristica generadora para crear un proyecto RestFul
Instance Method Summary collapse
-
#configure_template_targets ⇒ Object
Configura los objetivos de las platillas (despues de establecer el generador).
-
#get_app_config_file ⇒ Object
Devuelve la localizacion del archivo app.config.
-
#initialize(values = {}) ⇒ CSProyectRESTFulFeature
constructor
Inicializa la caracteristica.
Methods included from CapicuaGen::Gaspar
#get_about_class_full_name, #get_about_class_name, #get_db_connection_name_method, #get_db_connection_provider_method, #get_db_connection_string_method, #get_entity_by_catalog_name, #get_entity_catalogs_full_name, #get_entity_catalogs_name, #get_entity_data_access_full_name, #get_entity_data_access_name, #get_entity_full_name, #get_entity_interface_full_name, #get_entity_interface_name, #get_entity_name, #get_main_form_class_full_name, #get_main_form_class_name, #get_namespaces, #get_namespaces_text, #get_splash_class_full_name, #get_splash_class_name
Methods inherited from CSProyectFeature
#configure_attributes, #get_proyect_files, #get_type, #reset_attributes
Constructor Details
#initialize(values = {}) ⇒ CSProyectRESTFulFeature
Inicializa la caracteristica
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Source/cs_proyect_rest_ful_feature.rb', line 41 def initialize(values= {}) super(values) # Configuro los tipos si estos no han sido configurados previamente self.types= [:proyect, :soluction, :app_config] if self.types.blank? # Configuro los templates set_template('soluction', Template.new(:file => 'Soluction.erb')) set_template('proyect', Template.new(:file => 'Proyect.erb')) set_template('web.config', Template.new(:file => 'Web.erb')) set_template('assemblyInfo', Template.new(:file => 'AssemblyInfo.erb')) set_template('excepcion_controlada', Template.new(:file => 'ExcepcionControlada.erb')) # Configuro los Guid de la solucion self.generation_attributes[:soluction_guid]= UUIDTools::UUID.random_create.to_s.upcase self.generation_attributes[:project_guid] = UUIDTools::UUID.random_create.to_s.upcase end |
Instance Method Details
#configure_template_targets ⇒ Object
Configura los objetivos de las platillas (despues de establecer el generador)
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Source/cs_proyect_rest_ful_feature.rb', line 63 def configure_template_targets # Configuro los templates set_template_target('soluction', TemplateTarget.new(:out_file => "../#{@generator.generation_attributes[:namespace]}.sln", :types => :soluction)) set_template_target('proyect', TemplateTarget.new(:out_file => "#{@generator.generation_attributes[:namespace]}.csproj", :types => :proyect)) set_template_target('web.config', TemplateTarget.new(:out_file => "Web.Config", :types => :proyect_file)) set_template_target('assemblyInfo', TemplateTarget.new(:out_file => 'Properties/AssemblyInfo.cs', :types => :proyect_file)) set_template_target('excepcion_controlada', TemplateTarget.new(:out_file => "ExcepcionControlada.cs", :types => :proyect_file)) end |
#get_app_config_file ⇒ Object
Devuelve la localizacion del archivo app.config
76 77 78 |
# File 'lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Source/cs_proyect_rest_ful_feature.rb', line 76 def get_app_config_file return File.join(generation_attributes[:out_dir], get_template_target_by_name('web.config').out_file) end |