lib/power_stencil/project/base.rb in power_stencil-0.6.3 vs lib/power_stencil/project/base.rb in power_stencil-0.7.0

- old
+ new

@@ -3,10 +3,11 @@ require 'power_stencil/project/config' require 'power_stencil/project/versioning' require 'power_stencil/project/info' require 'power_stencil/project/templates' require 'power_stencil/project/plugins' +require 'power_stencil/project/git' require 'power_stencil/engine/project_engine' require 'power_stencil/engine/entity_engine' module PowerStencil @@ -28,10 +29,11 @@ include PowerStencil::Project::Config include PowerStencil::Project::Versioning include PowerStencil::Project::Templates include PowerStencil::Project::Plugins include PowerStencil::Project::Info + include PowerStencil::Project::Git extend PowerStencil::Project::Create attr_reader :engine, :entity_engine def name @@ -42,42 +44,43 @@ initialize_paths search_from_path load_project_specific_config check_project_version bootstrap_plugins build_engines - register_system_templates - register_plugins_templates - register_project_templates + register_system_templates_templates + register_plugins_templates_templates + register_project_templates_templates + setup_git_tracking end private - def register_plugins_templates + def register_plugins_templates_templates plugins.each do |_, plugin| - plugin.register_plugin_templates + plugin.register_plugin_templates_templates end end - def register_project_templates - dir = project_templates_path + def register_project_templates_templates + dir = project_templates_templates_path if Dir.exist? dir and File.readable? dir logger.info 'Registering project specific templates.' Dir.entries(dir).each do |potential_entity_type| next if potential_entity_type.match /^\./ template_dir = File.join(dir, potential_entity_type) next unless File.directory? template_dir - register_template_path_for_type potential_entity_type.to_sym, template_dir + register_template_template_path_for_type potential_entity_type.to_sym, template_dir end end end - def register_system_templates + def register_system_templates_templates logger.debug 'Registering system templates' %i(plugin_definition simple_exec).each do |template_name| - template_path = template_path template_name - register_template_path_for_type template_name, template_path + template_path = system_template_template_path template_name + register_template_template_path_for_type template_name, template_path end end def build_engines @@ -86,6 +89,6 @@ end end end -end \ No newline at end of file +end