Class Limelight::Templates::SceneTemplater
In: lib/limelight/templates/scene_templater.rb
Parent: Templater

A derivative of Templater that generates all the files for a scene. When created with the path "midnight_romance" the following will result:

   creating directory:  ./midnight_romance
   creating file:       ./midnight_romance/props.rb
   creating file:       ./midnight_romance/styles.rb
   creating directory:  ./midnight_romance/players


generate   new  


tokens  [R] 

Public Class methods

The scene_path should be path to a desired scene inside a production directory.


    # File lib/limelight/templates/scene_templater.rb, line 24
24:       def initialize(options)
25:         @production_path = options[:production_path]
26:         @scene_path = options[:scene_path]
27:         @spec_path = options[:spec_path]
28:         super(@production_path, Templater.source_dir)
29:         @scene_name = File.basename(@scene_path)
30:         @tokens = {}
31:         @tokens[:SCENE_NAME] = @scene_name
32:         @tokens[:SCENE_TITLE] = @scene_name.titleized
33:       end

Public Instance methods

Generates the files


    # File lib/limelight/templates/scene_templater.rb, line 37
37:       def generate
38:         file(File.join(@scene_path, "props.rb"), "scene/props.rb.template", @tokens)
39:         file(File.join(@scene_path, "styles.rb"), "scene/styles.rb.template", @tokens)
40:         directory(File.join(@scene_path, "players"))
41:         file(File.join(@spec_path, @scene_path, "#{@scene_name}_spec.rb"), "scene_spec/scene_spec.rb.template", @tokens)
42:       end