Class: Agilib::Composer::Templater
- Inherits:
-
Object
- Object
- Agilib::Composer::Templater
- Defined in:
- lib/agilib/composer/templater.rb
Instance Attribute Summary collapse
-
#post_bundler_strategies ⇒ Object
readonly
Returns the value of attribute post_bundler_strategies.
Instance Method Summary collapse
-
#initialize ⇒ Templater
constructor
A new instance of Templater.
- #load_snippet(name, group) ⇒ Object
- #post_bundler(&block) ⇒ Object
- #recipe(name) ⇒ Object
- #snippet_path(group) ⇒ Object
Constructor Details
#initialize ⇒ Templater
Returns a new instance of Templater.
7 8 9 10 |
# File 'lib/agilib/composer/templater.rb', line 7 def initialize @post_bundler_strategies = [] @template_framework_path = File.join(File.dirname(__FILE__), 'templates') end |
Instance Attribute Details
#post_bundler_strategies ⇒ Object (readonly)
Returns the value of attribute post_bundler_strategies.
5 6 7 |
# File 'lib/agilib/composer/templater.rb', line 5 def post_bundler_strategies @post_bundler_strategies end |
Instance Method Details
#load_snippet(name, group) ⇒ Object
24 25 26 27 |
# File 'lib/agilib/composer/templater.rb', line 24 def load_snippet(name, group) group_path = snippet_path(group) File.read File.("#{name}.rb", group_path) end |
#post_bundler(&block) ⇒ Object
12 13 14 |
# File 'lib/agilib/composer/templater.rb', line 12 def post_bundler(&block) @post_bundler_strategies << block end |
#recipe(name) ⇒ Object
16 17 18 |
# File 'lib/agilib/composer/templater.rb', line 16 def recipe(name) File.("recipes/#{name}.rb", @template_framework_path) end |
#snippet_path(group) ⇒ Object
20 21 22 |
# File 'lib/agilib/composer/templater.rb', line 20 def snippet_path(group) File.("snippets/#{group}", @template_framework_path) end |