Class: Llama::Template
- Inherits:
-
Object
- Object
- Llama::Template
- Defined in:
- lib/llama/template.rb
Instance Attribute Summary collapse
-
#repo_path ⇒ Object
Returns the value of attribute repo_path.
-
#template_name ⇒ Object
Returns the value of attribute template_name.
Instance Method Summary collapse
-
#initialize(template) ⇒ Template
constructor
A new instance of Template.
- #render!(output_path, project_name) ⇒ Object
Constructor Details
#initialize(template) ⇒ Template
Returns a new instance of Template.
5 6 7 8 9 10 11 12 13 |
# File 'lib/llama/template.rb', line 5 def initialize(template) if template.include?('.git') @template_name = template.match(/\/(.+)\.git$/)[1] @repo_path = template else @template_name = template.split('/').last @repo_path = "[email protected]:#{template_name}.git" end end |
Instance Attribute Details
#repo_path ⇒ Object
Returns the value of attribute repo_path.
3 4 5 |
# File 'lib/llama/template.rb', line 3 def repo_path @repo_path end |
#template_name ⇒ Object
Returns the value of attribute template_name.
3 4 5 |
# File 'lib/llama/template.rb', line 3 def template_name @template_name end |
Instance Method Details
#render!(output_path, project_name) ⇒ Object
15 16 17 18 |
# File 'lib/llama/template.rb', line 15 def render!(output_path, project_name) fetch_template Llama::DirProcessor.new(template_path, output_path, project_name).process! end |