Class: LtiTemplateBuilder::Recipe
- Inherits:
-
Object
- Object
- LtiTemplateBuilder::Recipe
- Defined in:
- lib/lti_template_builder/recipe.rb
Direct Known Subclasses
BootstrapSass, CorsSupport, Extra, Gems, LtiExtension, Rspec
Instance Attribute Summary collapse
-
#after_bundle_commands ⇒ Object
Returns the value of attribute after_bundle_commands.
-
#gem_dependencies ⇒ Object
Returns the value of attribute gem_dependencies.
-
#gem_dev_dependencies ⇒ Object
Returns the value of attribute gem_dev_dependencies.
Instance Method Summary collapse
-
#initialize ⇒ Recipe
constructor
A new instance of Recipe.
- #render ⇒ Object
- #setup(args = {}) ⇒ Object
- #template(template_name) ⇒ Object
Constructor Details
#initialize ⇒ Recipe
Returns a new instance of Recipe.
7 8 9 10 11 |
# File 'lib/lti_template_builder/recipe.rb', line 7 def initialize @gem_dependencies = [] @gem_dev_dependencies = [] @after_bundle_commands = [] end |
Instance Attribute Details
#after_bundle_commands ⇒ Object
Returns the value of attribute after_bundle_commands.
5 6 7 |
# File 'lib/lti_template_builder/recipe.rb', line 5 def after_bundle_commands @after_bundle_commands end |
#gem_dependencies ⇒ Object
Returns the value of attribute gem_dependencies.
5 6 7 |
# File 'lib/lti_template_builder/recipe.rb', line 5 def gem_dependencies @gem_dependencies end |
#gem_dev_dependencies ⇒ Object
Returns the value of attribute gem_dev_dependencies.
5 6 7 |
# File 'lib/lti_template_builder/recipe.rb', line 5 def gem_dev_dependencies @gem_dev_dependencies end |
Instance Method Details
#render ⇒ Object
22 23 24 25 26 |
# File 'lib/lti_template_builder/recipe.rb', line 22 def render puts "CLASS: #{self.class.name}" erb = ERB.new(File.read(File.("../recipes/#{recipe_name}/template.erb", __FILE__))) erb.result(self.instance_eval { binding }) end |
#setup(args = {}) ⇒ Object
13 14 15 |
# File 'lib/lti_template_builder/recipe.rb', line 13 def setup(args={}) raise "Please override this method!!!" end |
#template(template_name) ⇒ Object
17 18 19 20 |
# File 'lib/lti_template_builder/recipe.rb', line 17 def template(template_name) erb = ERB.new(File.read(File.("../recipes/#{recipe_name}/#{template_name}.erb", __FILE__))) erb.result(self.instance_eval { binding }) end |