epall-limelight 0.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/icons/icon.ico +0 -0
- data/bin/icons/icon_48.gif +0 -0
- data/bin/icons/limelight.icns +0 -0
- data/bin/limelight +5 -0
- data/bin/ll +10 -0
- data/bin/ll.bat +5 -0
- data/lib/init.rb +16 -0
- data/lib/limelight.jar +0 -0
- data/lib/limelight/animation.rb +41 -0
- data/lib/limelight/builtin/players.rb +16 -0
- data/lib/limelight/builtin/players/button.rb +39 -0
- data/lib/limelight/builtin/players/check_box.rb +50 -0
- data/lib/limelight/builtin/players/combo_box.rb +89 -0
- data/lib/limelight/builtin/players/combo_box_popup_list.rb +19 -0
- data/lib/limelight/builtin/players/combo_box_popup_list_item.rb +21 -0
- data/lib/limelight/builtin/players/curtains.rb +23 -0
- data/lib/limelight/builtin/players/image.rb +54 -0
- data/lib/limelight/builtin/players/password_box.rb +34 -0
- data/lib/limelight/builtin/players/radio_button.rb +65 -0
- data/lib/limelight/builtin/players/stage_mover.rb +31 -0
- data/lib/limelight/builtin/players/stage_sizer.rb +34 -0
- data/lib/limelight/builtin/players/text_area.rb +34 -0
- data/lib/limelight/builtin/players/text_box.rb +34 -0
- data/lib/limelight/builtin/styles.rb +35 -0
- data/lib/limelight/builtin/utilities_production/alert/players/alert.rb +11 -0
- data/lib/limelight/builtin/utilities_production/alert/props.rb +8 -0
- data/lib/limelight/builtin/utilities_production/alert/styles.rb +14 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/props.rb +20 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/styles.rb +12 -0
- data/lib/limelight/builtin/utilities_production/production.rb +62 -0
- data/lib/limelight/builtin/utilities_production/stages.rb +12 -0
- data/lib/limelight/builtin/utilities_production/styles.rb +53 -0
- data/lib/limelight/button_group_cache.rb +11 -0
- data/lib/limelight/casting_director.rb +112 -0
- data/lib/limelight/client/playbills.rb +86 -0
- data/lib/limelight/commands/command.rb +168 -0
- data/lib/limelight/commands/create_command.rb +98 -0
- data/lib/limelight/commands/freeze_command.rb +131 -0
- data/lib/limelight/commands/help_command.rb +61 -0
- data/lib/limelight/commands/open_command.rb +60 -0
- data/lib/limelight/commands/pack_command.rb +45 -0
- data/lib/limelight/commands/unpack_command.rb +44 -0
- data/lib/limelight/commands/version_command.rb +31 -0
- data/lib/limelight/data.rb +37 -0
- data/lib/limelight/dsl/build_exception.rb +55 -0
- data/lib/limelight/dsl/menu_bar.rb +71 -0
- data/lib/limelight/dsl/prop_builder.rb +155 -0
- data/lib/limelight/dsl/stage_builder.rb +105 -0
- data/lib/limelight/dsl/styles_builder.rb +157 -0
- data/lib/limelight/file_chooser.rb +68 -0
- data/lib/limelight/file_filter.rb +33 -0
- data/lib/limelight/file_loader.rb +46 -0
- data/lib/limelight/gems.rb +51 -0
- data/lib/limelight/java_couplings.rb +66 -0
- data/lib/limelight/java_util.rb +49 -0
- data/lib/limelight/limelight_exception.rb +24 -0
- data/lib/limelight/main.rb +108 -0
- data/lib/limelight/paint_action.rb +27 -0
- data/lib/limelight/pen.rb +83 -0
- data/lib/limelight/producer.rb +179 -0
- data/lib/limelight/production.rb +169 -0
- data/lib/limelight/prop.rb +367 -0
- data/lib/limelight/scene.rb +151 -0
- data/lib/limelight/specs/spec_helper.rb +87 -0
- data/lib/limelight/specs/test_scene_opener.rb +60 -0
- data/lib/limelight/stage.rb +292 -0
- data/lib/limelight/string.rb +38 -0
- data/lib/limelight/studio.rb +185 -0
- data/lib/limelight/styles.rb +347 -0
- data/lib/limelight/templates/production_templater.rb +49 -0
- data/lib/limelight/templates/scene_templater.rb +47 -0
- data/lib/limelight/templates/sources/freezing/limelight_init.rb.template +5 -0
- data/lib/limelight/templates/sources/production/init.rb.template +15 -0
- data/lib/limelight/templates/sources/production/production.rb.template +49 -0
- data/lib/limelight/templates/sources/production/spec/spec_helper.rb.template +12 -0
- data/lib/limelight/templates/sources/production/stages.rb.template +17 -0
- data/lib/limelight/templates/sources/production/styles.rb.template +12 -0
- data/lib/limelight/templates/sources/scene/props.rb.template +6 -0
- data/lib/limelight/templates/sources/scene/styles.rb.template +18 -0
- data/lib/limelight/templates/sources/scene_spec/scene_spec.rb.template +13 -0
- data/lib/limelight/templates/templater.rb +131 -0
- data/lib/limelight/templates/templater_logger.rb +39 -0
- data/lib/limelight/theater.rb +77 -0
- data/lib/limelight/util.rb +65 -0
- data/lib/limelight/util/downloader.rb +115 -0
- data/lib/limelight/version.rb +20 -0
- data/productions/examples/8thlight.com/about/about.txt +24 -0
- data/productions/examples/8thlight.com/about/props.rb +11 -0
- data/productions/examples/8thlight.com/about/styles.rb +2 -0
- data/productions/examples/8thlight.com/footer.rb +6 -0
- data/productions/examples/8thlight.com/home/props.rb +28 -0
- data/productions/examples/8thlight.com/home/styles.rb +2 -0
- data/productions/examples/8thlight.com/images/anvil.jpg +0 -0
- data/productions/examples/8thlight.com/images/bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/botticelli.jpg +0 -0
- data/productions/examples/8thlight.com/images/button_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/canvas_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/footer_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/header.jpg +0 -0
- data/productions/examples/8thlight.com/images/moses.jpg +0 -0
- data/productions/examples/8thlight.com/images/statemachine_thumbnail.png +0 -0
- data/productions/examples/8thlight.com/images/thumbnail_book.jpg +0 -0
- data/productions/examples/8thlight.com/menu.rb +11 -0
- data/productions/examples/8thlight.com/services/props.rb +11 -0
- data/productions/examples/8thlight.com/services/services.txt +8 -0
- data/productions/examples/8thlight.com/services/styles.rb +2 -0
- data/productions/examples/8thlight.com/stages.rb +8 -0
- data/productions/examples/8thlight.com/styles.rb +210 -0
- data/productions/examples/calculator/players/button.rb +24 -0
- data/productions/examples/calculator/players/calculator.rb +15 -0
- data/productions/examples/calculator/players/calculator_model.rb +13 -0
- data/productions/examples/calculator/props.rb +23 -0
- data/productions/examples/calculator/styles.rb +36 -0
- data/productions/examples/langstons_ant/html_javascript/ant.css +39 -0
- data/productions/examples/langstons_ant/html_javascript/ant.html +22 -0
- data/productions/examples/langstons_ant/html_javascript/ant.js +23 -0
- data/productions/examples/langstons_ant/init.rb +4 -0
- data/productions/examples/langstons_ant/players/ant.rb +103 -0
- data/productions/examples/langstons_ant/players/log.rb +29 -0
- data/productions/examples/langstons_ant/players/start_stop_button.rb +37 -0
- data/productions/examples/langstons_ant/players/world.rb +35 -0
- data/productions/examples/langstons_ant/props.rb +22 -0
- data/productions/examples/langstons_ant/styles.rb +104 -0
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/props.rb +10 -0
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/styles.rb +32 -0
- data/productions/examples/sandbox/alerts/incompatible_production/production.rb +52 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/default_scene/default_scene_spec.rb +16 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/spec_helper.rb +8 -0
- data/productions/examples/sandbox/alerts/incompatible_production/stages.rb +20 -0
- data/productions/examples/sandbox/alerts/incompatible_production/styles.rb +15 -0
- data/productions/examples/sandbox/alerts/players/alerts.rb +17 -0
- data/productions/examples/sandbox/alerts/props.rb +10 -0
- data/productions/examples/sandbox/alerts/styles.rb +46 -0
- data/productions/examples/sandbox/background_images/props.rb +22 -0
- data/productions/examples/sandbox/background_images/styles.rb +40 -0
- data/productions/examples/sandbox/click_me/players/chromaton.rb +52 -0
- data/productions/examples/sandbox/click_me/props.rb +8 -0
- data/productions/examples/sandbox/click_me/styles.rb +11 -0
- data/productions/examples/sandbox/floaters/players/floater.rb +108 -0
- data/productions/examples/sandbox/floaters/players/surface.rb +21 -0
- data/productions/examples/sandbox/floaters/props.rb +10 -0
- data/productions/examples/sandbox/floaters/styles.rb +24 -0
- data/productions/examples/sandbox/frameing/players/sandbox.rb +17 -0
- data/productions/examples/sandbox/frameing/props.rb +35 -0
- data/productions/examples/sandbox/frameing/styles.rb +45 -0
- data/productions/examples/sandbox/gradients/players/spinner.rb +20 -0
- data/productions/examples/sandbox/gradients/players/teaser.rb +19 -0
- data/productions/examples/sandbox/gradients/players/wave.rb +19 -0
- data/productions/examples/sandbox/gradients/players/waves.rb +19 -0
- data/productions/examples/sandbox/gradients/props.rb +13 -0
- data/productions/examples/sandbox/gradients/styles.rb +47 -0
- data/productions/examples/sandbox/header.rb +22 -0
- data/productions/examples/sandbox/homer/players/homer.rb +24 -0
- data/productions/examples/sandbox/homer/props.rb +10 -0
- data/productions/examples/sandbox/homer/styles.rb +16 -0
- data/productions/examples/sandbox/images/arch.jpg +0 -0
- data/productions/examples/sandbox/images/beach.jpg +0 -0
- data/productions/examples/sandbox/images/homer.jpg +0 -0
- data/productions/examples/sandbox/images/limelight_spotlight.jpg +0 -0
- data/productions/examples/sandbox/images/logo.png +0 -0
- data/productions/examples/sandbox/images/marilyn.jpg +0 -0
- data/productions/examples/sandbox/images/space.png +0 -0
- data/productions/examples/sandbox/images_scene/props.rb +36 -0
- data/productions/examples/sandbox/images_scene/styles.rb +34 -0
- data/productions/examples/sandbox/inputs/players/button_input.rb +48 -0
- data/productions/examples/sandbox/inputs/players/check_box_input.rb +40 -0
- data/productions/examples/sandbox/inputs/players/combo_box_input.rb +41 -0
- data/productions/examples/sandbox/inputs/players/radio_button_input.rb +43 -0
- data/productions/examples/sandbox/inputs/players/text_area_input.rb +36 -0
- data/productions/examples/sandbox/inputs/players/text_box_input.rb +36 -0
- data/productions/examples/sandbox/inputs/props.rb +40 -0
- data/productions/examples/sandbox/inputs/styles.rb +39 -0
- data/productions/examples/sandbox/kiosk/players/kiosk.rb +39 -0
- data/productions/examples/sandbox/kiosk/props.rb +9 -0
- data/productions/examples/sandbox/kiosk/styles.rb +37 -0
- data/productions/examples/sandbox/players/sandbox.rb +11 -0
- data/productions/examples/sandbox/rounded_corners/players/box.rb +11 -0
- data/productions/examples/sandbox/rounded_corners/props.rb +22 -0
- data/productions/examples/sandbox/rounded_corners/styles.rb +17 -0
- data/productions/examples/sandbox/scrolling/players/add_button.rb +19 -0
- data/productions/examples/sandbox/scrolling/players/cell.rb +15 -0
- data/productions/examples/sandbox/scrolling/props.rb +45 -0
- data/productions/examples/sandbox/scrolling/styles.rb +33 -0
- data/productions/examples/sandbox/sketching/players/sketchpad.rb +46 -0
- data/productions/examples/sandbox/sketching/props.rb +25 -0
- data/productions/examples/sandbox/sketching/styles.rb +35 -0
- data/productions/examples/sandbox/sounds/bird.au +0 -0
- data/productions/examples/sandbox/sounds/cat.au +0 -0
- data/productions/examples/sandbox/sounds/cow.au +0 -0
- data/productions/examples/sandbox/sounds/dog.au +0 -0
- data/productions/examples/sandbox/sounds/donkey.au +0 -0
- data/productions/examples/sandbox/sounds/duck.au +0 -0
- data/productions/examples/sandbox/sounds/players/clip.rb +10 -0
- data/productions/examples/sandbox/sounds/props.rb +10 -0
- data/productions/examples/sandbox/sounds/styles.rb +17 -0
- data/productions/examples/sandbox/spec/alerts/alerts_spec.rb +16 -0
- data/productions/examples/sandbox/stage_handles/players/sizer.rb +35 -0
- data/productions/examples/sandbox/stage_handles/props.rb +17 -0
- data/productions/examples/sandbox/stage_handles/styles.rb +58 -0
- data/productions/examples/sandbox/stages.rb +8 -0
- data/productions/examples/sandbox/styles.rb +35 -0
- data/productions/examples/sandbox/teaser/players/fader.rb +58 -0
- data/productions/examples/sandbox/teaser/props.rb +14 -0
- data/productions/examples/sandbox/teaser/styles.rb +21 -0
- data/productions/examples/tutorials/tutorial_1/players/sample.rb +11 -0
- data/productions/examples/tutorials/tutorial_1/props.rb +9 -0
- data/productions/examples/tutorials/tutorial_1/styles.rb +25 -0
- data/productions/playbills.lll +1 -0
- data/productions/stage_composer/init.rb +10 -0
- data/productions/stage_composer/inspector/players/inspector.rb +80 -0
- data/productions/stage_composer/inspector/players/prop_row.rb +12 -0
- data/productions/stage_composer/inspector/players/prop_tree.rb +33 -0
- data/productions/stage_composer/inspector/players/style_table.rb +12 -0
- data/productions/stage_composer/inspector/players/style_value.rb +16 -0
- data/productions/stage_composer/inspector/props.rb +19 -0
- data/productions/stage_composer/inspector/styles.rb +71 -0
- data/productions/stage_composer/lib/init.rb +5 -0
- data/productions/stage_composer/lib/limelight/composer/controller.rb +51 -0
- data/productions/stage_composer/lib/limelight/composer/lethargy.rb +24 -0
- data/productions/stage_composer/production.rb +6 -0
- data/productions/stage_composer/stages.rb +15 -0
- data/productions/startup/images/logo.png +0 -0
- data/productions/startup/images/splash.png +0 -0
- data/productions/startup/production.rb +52 -0
- data/productions/startup/spec/default_scene/default_scene_spec.rb +16 -0
- data/productions/startup/spec/spec_helper.rb +8 -0
- data/productions/startup/stages.rb +9 -0
- data/productions/startup/styles.rb +15 -0
- data/productions/startup/welcome/players/browse_button.rb +10 -0
- data/productions/startup/welcome/players/download_button.rb +17 -0
- data/productions/startup/welcome/players/sandbox_button.rb +11 -0
- data/productions/startup/welcome/props.rb +23 -0
- data/productions/startup/welcome/styles.rb +103 -0
- data/spec/limelight/builtin/players/button_spec.rb +20 -0
- data/spec/limelight/builtin/players/check_box_spec.rb +29 -0
- data/spec/limelight/builtin/players/combo_box_spec.rb +29 -0
- data/spec/limelight/builtin/players/image_spec.rb +43 -0
- data/spec/limelight/builtin/players/password_box_spec.rb +27 -0
- data/spec/limelight/builtin/players/radio_button_spec.rb +64 -0
- data/spec/limelight/builtin/players/stage_mover_spec.rb +36 -0
- data/spec/limelight/builtin/players/stage_sizer_spec.rb +40 -0
- data/spec/limelight/builtin/players/text_area_spec.rb +27 -0
- data/spec/limelight/builtin/players/text_box_spec.rb +27 -0
- data/spec/limelight/builtin/utilities_production/spec_helper.rb +7 -0
- data/spec/limelight/builtin/utilities_production/utilities_production_spec.rb +146 -0
- data/spec/limelight/casting_director_spec.rb +164 -0
- data/spec/limelight/client/playbills_spec.rb +79 -0
- data/spec/limelight/commands/command_spec.rb +26 -0
- data/spec/limelight/commands/create_command_spec.rb +108 -0
- data/spec/limelight/commands/freeze_command_spec.rb +143 -0
- data/spec/limelight/commands/help_command_spec.rb +42 -0
- data/spec/limelight/commands/open_command_spec.rb +52 -0
- data/spec/limelight/commands/pack_command_spec.rb +26 -0
- data/spec/limelight/commands/unpack_command_spec.rb +47 -0
- data/spec/limelight/data_spec.rb +36 -0
- data/spec/limelight/dsl/prop_builder_spec.rb +245 -0
- data/spec/limelight/dsl/stage_builder_spec.rb +90 -0
- data/spec/limelight/dsl/styles_builder_spec.rb +194 -0
- data/spec/limelight/file_chooser_spec.rb +64 -0
- data/spec/limelight/file_filter_spec.rb +29 -0
- data/spec/limelight/file_loader_spec.rb +28 -0
- data/spec/limelight/gems_spec.rb +92 -0
- data/spec/limelight/java_util_spec.rb +37 -0
- data/spec/limelight/main_spec.rb +40 -0
- data/spec/limelight/paint_action_spec.rb +30 -0
- data/spec/limelight/pen_spec.rb +62 -0
- data/spec/limelight/producer_spec.rb +210 -0
- data/spec/limelight/production_spec.rb +100 -0
- data/spec/limelight/prop_spec.rb +431 -0
- data/spec/limelight/scene_spec.rb +173 -0
- data/spec/limelight/stage_spec.rb +202 -0
- data/spec/limelight/string_spec.rb +38 -0
- data/spec/limelight/studio_spec.rb +157 -0
- data/spec/limelight/styles_spec.rb +53 -0
- data/spec/limelight/templates/production_templater_spec.rb +66 -0
- data/spec/limelight/templates/scene_templater_spec.rb +51 -0
- data/spec/limelight/templates/templater_logger_spec.rb +41 -0
- data/spec/limelight/templates/templater_spec.rb +107 -0
- data/spec/limelight/theater_spec.rb +72 -0
- data/spec/limelight/util/downloader_spec.rb +92 -0
- data/spec/spec_helper.rb +70 -0
- metadata +335 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
|
+
|
4
|
+
require 'limelight/templates/templater'
|
5
|
+
require 'limelight/string'
|
6
|
+
require 'limelight/version'
|
7
|
+
|
8
|
+
module Limelight
|
9
|
+
module Templates
|
10
|
+
|
11
|
+
# A Templater that creates all the files and directories for a production. When used with "love_story" as
|
12
|
+
# the production_path, the following will be the result.
|
13
|
+
#
|
14
|
+
# creating directory: ./love_story
|
15
|
+
# creating file: ./love_story/production.rb
|
16
|
+
# creating file: ./love_story/stages.rb
|
17
|
+
# creating file: ./love_story/styles.rb
|
18
|
+
#
|
19
|
+
class ProductionTemplater < Templater
|
20
|
+
|
21
|
+
attr_reader :tokens
|
22
|
+
|
23
|
+
# To create a ProductionTemplater, provide a production_path and the name of the default scene.
|
24
|
+
#
|
25
|
+
def initialize(options)
|
26
|
+
production_path = options[:production_path]
|
27
|
+
default_scene_name = options[:scene_path]
|
28
|
+
super(File.dirname(production_path), Templater.source_dir)
|
29
|
+
@production_path = File.basename(production_path)
|
30
|
+
@spec_path = File.join(@production_path, options[:spec_path])
|
31
|
+
@tokens = {}
|
32
|
+
@tokens[:DEFAULT_SCENE_NAME] = default_scene_name
|
33
|
+
@tokens[:PRODUCTION_NAME] = File.basename(production_path).titleized
|
34
|
+
@tokens[:CURRENT_VERSION] = Limelight::VERSION::STRING
|
35
|
+
end
|
36
|
+
|
37
|
+
# Generates the files
|
38
|
+
#
|
39
|
+
def generate
|
40
|
+
file(File.join(@production_path, "production.rb"), "production/production.rb.template", @tokens)
|
41
|
+
file(File.join(@production_path, "stages.rb"), "production/stages.rb.template", @tokens)
|
42
|
+
file(File.join(@production_path, "styles.rb"), "production/styles.rb.template", @tokens)
|
43
|
+
file(File.join(@spec_path, "spec_helper.rb"), "production/spec/spec_helper.rb.template", @tokens)
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
|
+
|
4
|
+
require 'limelight/templates/templater'
|
5
|
+
require 'limelight/string'
|
6
|
+
|
7
|
+
module Limelight
|
8
|
+
module Templates
|
9
|
+
|
10
|
+
# A derivative of Templater that generates all the files for a scene.
|
11
|
+
# When created with the path "midnight_romance" the following will result:
|
12
|
+
#
|
13
|
+
# creating directory: ./midnight_romance
|
14
|
+
# creating file: ./midnight_romance/props.rb
|
15
|
+
# creating file: ./midnight_romance/styles.rb
|
16
|
+
# creating directory: ./midnight_romance/players
|
17
|
+
#
|
18
|
+
class SceneTemplater < Templater
|
19
|
+
|
20
|
+
attr_reader :tokens
|
21
|
+
|
22
|
+
# The scene_path should be path to a desired scene inside a production directory.
|
23
|
+
#
|
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
|
34
|
+
|
35
|
+
# Generates the files
|
36
|
+
#
|
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
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file (init.rb) is the second file loaded (after production.rb) when a production is loaded.
|
2
|
+
# Initialization code for the production should go here.
|
3
|
+
|
4
|
+
# If your production is using external ruby source code that will be required in player modules, you may
|
5
|
+
# add the path to $: here.
|
6
|
+
#$: << File.expand_path(File.dirname(__FILE__) + "/lib")
|
7
|
+
|
8
|
+
# Acquires a reference to the production.
|
9
|
+
production = Limelight::Production["!-PRODUCTION_NAME-!"]
|
10
|
+
|
11
|
+
# Require any source code that will be used by the production.
|
12
|
+
#require 'seomthing'
|
13
|
+
|
14
|
+
# This is the ideal place to assign values to production attributes.
|
15
|
+
#production.something = MySource::Something.new
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# This file (production.rb) is the first file loaded opening a production. It must define a module named 'Production'.
|
2
|
+
# The containing production will acquire all the behavior defined in this module.
|
3
|
+
# You may define serveral hooks and initialization steps here.
|
4
|
+
|
5
|
+
module Production
|
6
|
+
|
7
|
+
# # Define this method if you want the production name to be different from the default, directory name.
|
8
|
+
# def name
|
9
|
+
# return !-PRODUCTION_NAME-!
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# # Returns the minimum version of limelight required to run this production. Default: "0.0.0"
|
13
|
+
# # If the version of limelight used to open this production is less than the minimum,
|
14
|
+
# # an error will be displayed (starting with version 0.4.0).
|
15
|
+
# #
|
16
|
+
# def minimum_limelight_version
|
17
|
+
# return "!-CURRENT_VERSION-!"
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# # Hook #1. Called when the production is newly created, before any loading has been done.
|
21
|
+
# # This is a good place to require needed files and instantiate objects in the business layer.
|
22
|
+
# def production_opening
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# # Hook #2. Called after internal gems have been loaded and stages have been instantiated, yet before
|
26
|
+
# # any scenes have been opened.
|
27
|
+
# def production_loaded
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# # Hook #3. Called when the production, and all the scenes, have fully opened.
|
31
|
+
# def production_opened
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# # The system will call this methods when it wishes to close the production, perhaps when the user quits the
|
35
|
+
# # application. By default the production will always return true. You may override this behavior by re-implenting
|
36
|
+
# # the methods here.
|
37
|
+
# def allow_close?
|
38
|
+
# return true
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# # Called when the production is about to be closed.
|
42
|
+
# def production_closing
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
# # Called when the production is fully closed.
|
46
|
+
# def production_closed
|
47
|
+
# end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
require 'limelight/specs/spec_helper'
|
4
|
+
|
5
|
+
# Set the Gem home to the frozen gems
|
6
|
+
$PRODUCTION_PATH = File.expand_path(File.dirname(__FILE__) + "/../")
|
7
|
+
Gem.use_paths(File.join($PRODUCTION_PATH , "__resources", "gems"), Gem.default_path)
|
8
|
+
|
9
|
+
|
10
|
+
Dir.glob(File.join("__resources", "gems", "gems", "**", "lib")).each do |dir|
|
11
|
+
$: << dir
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file (stages.rb) is used to define the stages within your production.
|
2
|
+
#
|
3
|
+
# Below is an example statge configuration.
|
4
|
+
#
|
5
|
+
# stage "center_stage" do
|
6
|
+
# default_scene "main"
|
7
|
+
# title "Limelight Center Stage"
|
8
|
+
# location [0, 0]
|
9
|
+
# size [300, 800]
|
10
|
+
# end
|
11
|
+
|
12
|
+
stage "default" do
|
13
|
+
default_scene "!-DEFAULT_SCENE_NAME-!"
|
14
|
+
title "Limelight"
|
15
|
+
location [200, 25]
|
16
|
+
size [800, 800]
|
17
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This file, (styles.rb) in the root directory of the production, should define any styles that are used in multiple
|
2
|
+
# scenes. It makes use of the StyleBuilder DSL.
|
3
|
+
#
|
4
|
+
# For more information see: http://limelightwiki.8thlight.com/index.php/A_Cook%27s_Tour_of_Limelight#Styling_with_styles.rb
|
5
|
+
# For a complete listing of style attributes see: http://limelightwiki.8thlight.com/index.php/Style_Attributes
|
6
|
+
|
7
|
+
# An example style definition
|
8
|
+
#foo {
|
9
|
+
# width 100
|
10
|
+
# height 100
|
11
|
+
# background_color :blue
|
12
|
+
#}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# This file (props.rb) defines all the props that appear in a scene when loaded. It makes use of the
|
2
|
+
# PropBuilder DSL.
|
3
|
+
#
|
4
|
+
# For more information see: http://limelightwiki.8thlight.com/index.php/A_Cook%27s_Tour_of_Limelight#PropBuilder_DSL
|
5
|
+
|
6
|
+
root :text => "This is the !-SCENE_TITLE-! scene."
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file, (styles.rb) inside a scene, should define any styles specific to the containing scene.
|
2
|
+
# It makes use of the StyleBuilder DSL.
|
3
|
+
#
|
4
|
+
# For more information see: http://limelightwiki.8thlight.com/index.php/A_Cook%27s_Tour_of_Limelight#Styling_with_styles.rb
|
5
|
+
# For a complete listing of style attributes see: http://limelightwiki.8thlight.com/index.php/Style_Attributes
|
6
|
+
|
7
|
+
!-SCENE_NAME-! {
|
8
|
+
background_color :black
|
9
|
+
horizontal_alignment :center
|
10
|
+
vertical_alignment :center
|
11
|
+
width "100%"
|
12
|
+
height "100%"
|
13
|
+
}
|
14
|
+
|
15
|
+
root {
|
16
|
+
text_color :white
|
17
|
+
font_size 18
|
18
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
|
+
|
3
|
+
describe "!-SCENE_TITLE-!" do
|
4
|
+
|
5
|
+
uses_scene "!-SCENE_NAME-!", :hidden => true
|
6
|
+
|
7
|
+
it "should have default text" do
|
8
|
+
scene.children.size.should == 1
|
9
|
+
root = scene.children[0]
|
10
|
+
root.text.should == "This is the !-SCENE_TITLE-! scene."
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
|
+
|
4
|
+
require 'limelight/templates/templater_logger'
|
5
|
+
|
6
|
+
module Limelight
|
7
|
+
module Templates
|
8
|
+
|
9
|
+
# A class to create directories and file templates. An instance of Templater must be provided with
|
10
|
+
# a target_root and a source_root. The target_root designates a root directory in which all directories and
|
11
|
+
# files will be created. The source_root designated a directory where all the file template can be found.
|
12
|
+
#
|
13
|
+
# A file template is a plain text file. It may optionally contain token markers in the format !-TOKEN_NAME-!.
|
14
|
+
# When a file template is installed by the templater, all the token margers will be replaced by tokens provided
|
15
|
+
# in a hash.
|
16
|
+
#
|
17
|
+
class Templater
|
18
|
+
|
19
|
+
# Return the default source_root for Limelight related file templates.
|
20
|
+
#
|
21
|
+
# $LIMELIGHT_LIB$/limelight/templates/sources
|
22
|
+
#
|
23
|
+
def self.source_dir
|
24
|
+
return File.join(File.dirname(__FILE__), "sources")
|
25
|
+
end
|
26
|
+
|
27
|
+
# Carifies a path as relative or absolute. Essentially if makes sure a path begins with a . if it's not
|
28
|
+
# an absolute path.
|
29
|
+
#
|
30
|
+
# Templater.clarity('some/path') -> './some/path'
|
31
|
+
# Templater.clarity('/root/path') -> '/root/path'
|
32
|
+
#
|
33
|
+
def self.clarify(path)
|
34
|
+
return path if path[0..0] == '.'
|
35
|
+
return path if path == File.expand_path(path)
|
36
|
+
return File.join(".", path)
|
37
|
+
end
|
38
|
+
|
39
|
+
attr_reader :target_root, :source_root
|
40
|
+
|
41
|
+
# See TemplaterLogger
|
42
|
+
#
|
43
|
+
attr_accessor :logger
|
44
|
+
|
45
|
+
# New instances Templater require a target_root. The source_root may optionally be provided. source_root
|
46
|
+
# defaults to Templater.source_dir
|
47
|
+
#
|
48
|
+
# The logger is initializes as a TemplaterLogger
|
49
|
+
#
|
50
|
+
def initialize(target_root, source_root=Templater.source_dir)
|
51
|
+
@logger = TemplaterLogger.new
|
52
|
+
@target_root = Templater.clarify(target_root)
|
53
|
+
@source_root = source_root
|
54
|
+
end
|
55
|
+
|
56
|
+
# Creates a deirectory. If the specified directory's parent directory is missing, it will be created as will its
|
57
|
+
# parent directory, and so on.
|
58
|
+
#
|
59
|
+
# After the following call,
|
60
|
+
#
|
61
|
+
# templater.directory("dir1/dir2/dir3/dir4")
|
62
|
+
#
|
63
|
+
# The following directories will exist, inside the target_root, whether they existed prior to the call or not.
|
64
|
+
#
|
65
|
+
# dir1
|
66
|
+
# dir1/dir2
|
67
|
+
# dir1/dir2/dir3
|
68
|
+
# dir1/dir2/dir3/dir4
|
69
|
+
#
|
70
|
+
def directory(path)
|
71
|
+
full_path = File.join(@target_root, path)
|
72
|
+
establish_directory(full_path)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Creates the specified file from the specified file template. The file will be created within the target_root.
|
76
|
+
# All parent diretories will be created if needed. The source paramter should be a path pointing to a
|
77
|
+
# file template in the source_root directory.
|
78
|
+
#
|
79
|
+
# Assume the the file <code>src/default.txt.template</code> exists in the source_root with the following content.
|
80
|
+
#
|
81
|
+
# !-SCORES-! score and !-YEARS-! years ago, ...
|
82
|
+
#
|
83
|
+
# When the following command is executed,
|
84
|
+
#
|
85
|
+
# templater.file('dir/foo.txt', 'src/default.txt.template', :SCORES => "Four", :YEARS => "seven")
|
86
|
+
#
|
87
|
+
# The file <code>dir/foo.txt</code> will exist in the target_root with the following content.
|
88
|
+
#
|
89
|
+
# Four score and seven years ago, ...
|
90
|
+
#
|
91
|
+
def file(target, source, tokens = {})
|
92
|
+
target_path = File.join(@target_root, target)
|
93
|
+
source_source = File.join(@source_root, source)
|
94
|
+
|
95
|
+
establish_directory(File.dirname(target_path))
|
96
|
+
|
97
|
+
if File.exists?(target_path)
|
98
|
+
@logger.file_already_exists(target_path)
|
99
|
+
else
|
100
|
+
@logger.creating_file(target_path)
|
101
|
+
content = IO.read(source_source)
|
102
|
+
content = replace_tokens(content, tokens)
|
103
|
+
File.open(target_path, 'w') { |file| file.write content }
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def establish_directory(full_path)
|
110
|
+
return if File.exists?(full_path)
|
111
|
+
parent_path = File.dirname(full_path)
|
112
|
+
while (!File.exists?(parent_path))
|
113
|
+
establish_directory(parent_path)
|
114
|
+
end
|
115
|
+
|
116
|
+
@logger.creating_directory(full_path)
|
117
|
+
Dir.mkdir(full_path)
|
118
|
+
end
|
119
|
+
|
120
|
+
def replace_tokens(content, tokens)
|
121
|
+
return content.gsub(/!-(\w+)-!/) do |value|
|
122
|
+
token_name = value[2...-2]
|
123
|
+
token = tokens[token_name] || tokens[token_name.to_sym] || "UNKNOWN TOKEN"
|
124
|
+
token
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
|
+
|
4
|
+
module Limelight
|
5
|
+
module Templates
|
6
|
+
|
7
|
+
# Templaters uses this class to log activity.
|
8
|
+
#
|
9
|
+
class TemplaterLogger
|
10
|
+
|
11
|
+
# An accessor to the output IO. Defaults to STDOUT
|
12
|
+
#
|
13
|
+
attr_accessor :output
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@output = STDOUT
|
17
|
+
end
|
18
|
+
|
19
|
+
def creating_directory(name)
|
20
|
+
@output.puts "\tcreating directory: #{name}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def creating_file(name)
|
24
|
+
@output.puts "\tcreating file: #{name}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def file_already_exists(name)
|
28
|
+
@output.puts "\tfile already exists: #{name}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def log(message, name)
|
32
|
+
spaces = 21 - message.length - 1
|
33
|
+
@output.puts "\t#{message}:#{' '*spaces}#{name}"
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
|
+
|
4
|
+
require 'limelight/limelight_exception'
|
5
|
+
|
6
|
+
module Limelight
|
7
|
+
|
8
|
+
# A Theater represents a group of Stages. Productions require a Theater in which to open.
|
9
|
+
#
|
10
|
+
class Theater
|
11
|
+
|
12
|
+
include UI::Api::Theater
|
13
|
+
|
14
|
+
# Returns the theater's active stage. i.e. the stage most recently used.
|
15
|
+
#
|
16
|
+
attr_reader :active_stage
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
@stages = {}
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns an Array of Stages that belong to this Theater.
|
23
|
+
#
|
24
|
+
def stages
|
25
|
+
return @stages.values
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns true if the theater has at least one stage
|
29
|
+
#
|
30
|
+
def has_stages?
|
31
|
+
return stages.length > 0
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns the Stage with the spcified name, nil if none exist with the specified name.
|
35
|
+
#
|
36
|
+
def [](stage_name)
|
37
|
+
return @stages[stage_name]
|
38
|
+
end
|
39
|
+
|
40
|
+
# Adds a Stage to the Theater. Raises an exception is the name of the Stage is duplicated.
|
41
|
+
#
|
42
|
+
def add_stage(name, options = {})
|
43
|
+
raise LimelightException.new("Duplicate stage name: '#{name}'") if @stages[name]
|
44
|
+
stage = build_stage(name, options)
|
45
|
+
@stages[name] = stage
|
46
|
+
return stage
|
47
|
+
end
|
48
|
+
|
49
|
+
# Lets the Theater know which stage has the limelight (currently active).
|
50
|
+
#
|
51
|
+
def stage_activated(stage)
|
52
|
+
@active_stage = stage
|
53
|
+
end
|
54
|
+
|
55
|
+
# Removes the stage from this theater.
|
56
|
+
#
|
57
|
+
def stage_closed(stage)
|
58
|
+
@stages.delete(stage.name)
|
59
|
+
@active_stage = nil if @active_stage == stage
|
60
|
+
end
|
61
|
+
|
62
|
+
# If no Stages are added, the Theater will provide a default Stage named "Limelight".
|
63
|
+
#
|
64
|
+
def default_stage
|
65
|
+
add_stage("Limelight") if self["Limelight"].nil?
|
66
|
+
return self["Limelight"]
|
67
|
+
end
|
68
|
+
|
69
|
+
protected #############################################
|
70
|
+
|
71
|
+
def build_stage(name, options)
|
72
|
+
return Limelight::Stage.new(self, name, options)
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|