Class: FreemarkerTemplateEngine
- Inherits:
-
VraptorScaffold::Base
- Object
- Thor::Group
- VraptorScaffold::Base
- FreemarkerTemplateEngine
- Defined in:
- lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb
Class Method Summary collapse
Instance Method Summary collapse
- #configure ⇒ Object
- #decorators_path ⇒ Object
- #extension ⇒ Object
-
#initialize(project_path, options) ⇒ FreemarkerTemplateEngine
constructor
A new instance of FreemarkerTemplateEngine.
- #package ⇒ Object
Constructor Details
#initialize(project_path, options) ⇒ FreemarkerTemplateEngine
Returns a new instance of FreemarkerTemplateEngine.
7 8 9 10 11 12 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 7 def initialize(project_path, ) super self.destination_root=(project_path) @project_path = project_path @options = end |
Class Method Details
.source_root ⇒ Object
3 4 5 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 3 def self.source_root File.join(File.dirname(__FILE__), "templates", "freemarker") end |
Instance Method Details
#configure ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 14 def configure directory("macros", File.join(Configuration::WEB_APP, "macros")) template("../decorators.erb", File.join(Configuration::WEB_INF, "decorators.xml")) template("main.ftl.erb", File.join(Configuration::WEB_INF, decorators_path, "main.ftl")) #copy_file("main.ftl", File.join(Configuration::WEB_INF, decorators_path, "main.ftl")) directory("infrastructure", infra_path) append_freemarker_servlet end |
#decorators_path ⇒ Object
27 28 29 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 27 def decorators_path File.join "views", "decorators" end |
#extension ⇒ Object
23 24 25 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 23 def extension "ftl" end |
#package ⇒ Object
31 32 33 34 |
# File 'lib/vraptor-scaffold/generators/app/freemarker_template_engine.rb', line 31 def package file = File.join(@project_path, Configuration::FILENAME) package = YAML.load_file(file)['package'] end |