Class Limelight::Production
In: lib/limelight/production.rb
Parent: Object

The root object of Limelight Production. Every Prop in a production has access to its Production object. Therefore it is typical to store reasources in the Production.

Productions are configured, and attributes are added, by the ProductionBuilder.

Methods

Included Modules

UI::Api::Production

External Aliases

name -> getName

Attributes

name  [R] 
producer  [RW] 
root  [R] 
theater  [RW] 

Public Class methods

Users typically need not create Production objects.

[Source]

    # File lib/limelight/production.rb, line 36
36:     def initialize(path)
37:       @root = FileLoader.for_root(path)
38:       @name = File.basename(path)
39:     end

Public Instance methods

allowClose()

Alias for allow_close?

Returns true if the production allows itself to be closed. The system will call this methods when it wishes to close the production, perhaps when the user quits the application. By default the production will always return true.

[Source]

     # File lib/limelight/production.rb, line 109
109:     def allow_close?
110:       return true
111:     end

Closes the production. If there are no more productions open, the Limelight runtime will shutdown. The production will actually delegate to it‘s producer and the producer will close the production down.

[Source]

     # File lib/limelight/production.rb, line 152
152:     def close
153:       @producer.close
154:     end

returns true if the production has been closed.

[Source]

     # File lib/limelight/production.rb, line 145
145:     def closed?
146:       return @closed
147:     end

Returned the name of the default scene. This is only used when there are not stages defined in the production. Defaults to :root, the production‘s root directory is the default scene. Return nil if there are not defaults.

[Source]

     # File lib/limelight/production.rb, line 173
173:     def default_scene
174:       return :root
175:     end

Returns the path to the production‘s gems directory

[Source]

    # File lib/limelight/production.rb, line 80
80:     def gems_directory
81:       return @root.path_to("__resources/gems/gems")
82:     end

Returns the path to the productions gems root

[Source]

    # File lib/limelight/production.rb, line 86
86:     def gems_root
87:       return @root.path_to("__resources/gems")
88:     end

Returns the path to the production‘s init file

[Source]

    # File lib/limelight/production.rb, line 56
56:     def init_file
57:       return @root.path_to("init.rb")
58:     end

Returns the minimum version of limelight required to run this production. Default: "0.0.0" If the version of limelight used to open this production is less than the minimum, an error will be displayed (starting with version 0.4.0).

[Source]

     # File lib/limelight/production.rb, line 101
101:     def minimum_limelight_version
102:       return "0.0.0"
103:     end

Sets the name of the Production. The name must be unique amongst all Productions in memory.

[Source]

    # File lib/limelight/production.rb, line 43
43:     def name=(value)
44:       Context.instance.studio.error_if_duplicate_name(value)
45:       @name = value
46:     end

Return the path to the root directory of the production

[Source]

    # File lib/limelight/production.rb, line 50
50:     def path
51:       return @root.root
52:     end

Called when the production is fully closed. The default implementation does nothing but you may re-implement it in the production.rb file.

[Source]

     # File lib/limelight/production.rb, line 140
140:     def production_closed
141:     end

Called when the production is about to be closed. The default implementation does nothing but you may re-implement it in the production.rb file.

[Source]

     # File lib/limelight/production.rb, line 134
134:     def production_closing
135:     end

Returns the path to the production‘s production.rb file

[Source]

    # File lib/limelight/production.rb, line 62
62:     def production_file
63:       return @root.path_to("production.rb")
64:     end

Called when the production has been loaded. That is, when all the gems have been loaded stages have been instantiated.

[Source]

     # File lib/limelight/production.rb, line 122
122:     def production_loaded
123:     end

Called when the production is fully opened. The default implementation does nothing but you may re-implement it in the production.rb file.

[Source]

     # File lib/limelight/production.rb, line 128
128:     def production_opened
129:     end

Called when the production is about to be opened. The default implementation does nothing but you may re-implement it in the production.rb file.

[Source]

     # File lib/limelight/production.rb, line 116
116:     def production_opening
117:     end

Publish this production using DRb on the specified port. The production will delegate to its producer to actually do the publishing.

[Source]

     # File lib/limelight/production.rb, line 159
159:     def publish_on_drb(port)
160:       @producer.publish_production_on_drb(port)
161:     end

A production with multiple Scenes may have a ‘styles.rb’ file in the root directory. This is called the root_styles. This method loads the root_styles, if they haven‘t already been loaded, and returns them.

[Source]

     # File lib/limelight/production.rb, line 180
180:     def root_styles
181:       unless @root_styles
182:         if File.exists?(styles_file)
183:           @root_styles = Limelight.build_styles_from_file(styles_file)
184:         else
185:           @root_styles = {}
186:         end
187:       end
188:       return @root_styles
189:     end

Returns the path to the named Scene‘s directory within the Production

[Source]

    # File lib/limelight/production.rb, line 92
92:     def scene_directory(name)
93:       return @root.root if name == :root
94:       return @root.path_to(name)
95:     end
setName(value)

Alias for name=

Returns the path to the production‘s stages file

[Source]

    # File lib/limelight/production.rb, line 68
68:     def stages_file
69:       return @root.path_to("stages.rb")
70:     end

Returns the path to the production‘s styles file

[Source]

    # File lib/limelight/production.rb, line 74
74:     def styles_file
75:       return @root.path_to("styles.rb")
76:     end

Called when the last stage in this production‘s theater is closed. If the allow_close? returns true this production will be closed.

[Source]

     # File lib/limelight/production.rb, line 166
166:     def theater_empty!
167:       close if allow_close? && !closed?
168:     end

[Validate]