limelight 0.3.1-java → 0.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/init.rb +5 -2
- data/lib/limelight/animation.rb +2 -2
- data/lib/limelight/builtin/players/button.rb +1 -1
- data/lib/limelight/builtin/players/check_box.rb +1 -1
- data/lib/limelight/builtin/players/combo_box.rb +2 -4
- data/lib/limelight/builtin/players/combo_box_popup_list.rb +1 -1
- data/lib/limelight/builtin/players/combo_box_popup_list_item.rb +1 -1
- data/lib/limelight/builtin/players/curtains.rb +1 -1
- data/lib/limelight/builtin/players/image.rb +3 -0
- data/lib/limelight/builtin/players/password_box.rb +1 -1
- data/lib/limelight/builtin/players/radio_button.rb +1 -1
- data/lib/limelight/builtin/players/text_area.rb +1 -1
- data/lib/limelight/builtin/players/text_box.rb +1 -1
- data/lib/limelight/builtin/players.rb +1 -1
- data/lib/limelight/builtin/styles.rb +1 -1
- data/lib/limelight/builtin/utilities_production/alert/props.rb +5 -0
- data/lib/limelight/builtin/utilities_production/alert/styles.rb +7 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/props.rb +17 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/styles.rb +9 -0
- data/lib/limelight/builtin/utilities_production/production.rb +59 -0
- data/lib/limelight/builtin/utilities_production/stages.rb +9 -0
- data/lib/limelight/builtin/utilities_production/styles.rb +50 -0
- data/lib/limelight/button_group_cache.rb +1 -1
- data/lib/limelight/casting_director.rb +1 -1
- data/lib/limelight/client/playbills.rb +3 -0
- data/lib/limelight/commands/command.rb +13 -7
- data/lib/limelight/commands/create_command.rb +13 -8
- data/lib/limelight/commands/freeze_command.rb +3 -0
- data/lib/limelight/commands/help_command.rb +12 -1
- data/lib/limelight/commands/open_command.rb +11 -1
- data/lib/limelight/commands/pack_command.rb +1 -1
- data/lib/limelight/commands/unpack_command.rb +1 -1
- data/lib/limelight/commands/version_command.rb +1 -1
- data/lib/limelight/data.rb +4 -14
- data/lib/limelight/dsl/build_exception.rb +12 -8
- data/lib/limelight/dsl/menu_bar.rb +1 -1
- data/lib/limelight/dsl/production_builder.rb +1 -1
- data/lib/limelight/dsl/prop_builder.rb +2 -2
- data/lib/limelight/dsl/stage_builder.rb +3 -3
- data/lib/limelight/dsl/styles_builder.rb +2 -1
- data/lib/limelight/file_chooser.rb +1 -1
- data/lib/limelight/file_filter.rb +1 -1
- data/lib/limelight/file_loader.rb +1 -1
- data/lib/limelight/gems.rb +4 -0
- data/lib/limelight/java_couplings.rb +3 -2
- data/lib/limelight/java_util.rb +1 -1
- data/lib/limelight/limelight_exception.rb +1 -1
- data/lib/limelight/main.rb +1 -1
- data/lib/limelight/paint_action.rb +1 -1
- data/lib/limelight/pen.rb +1 -1
- data/lib/limelight/producer.rb +52 -37
- data/lib/limelight/production.rb +81 -43
- data/lib/limelight/prop.rb +32 -13
- data/lib/limelight/scene.rb +19 -14
- data/lib/limelight/specs/spec_helper.rb +55 -28
- data/lib/limelight/stage.rb +163 -23
- data/lib/limelight/string.rb +3 -0
- data/lib/limelight/studio.rb +143 -6
- data/lib/limelight/styles.rb +14 -1
- data/lib/limelight/templates/production_templater.rb +6 -2
- data/lib/limelight/templates/scene_templater.rb +12 -7
- data/lib/limelight/templates/sources/production/production.rb.template +46 -6
- data/lib/limelight/templates/sources/production/spec/spec_helper.rb.template +5 -0
- data/lib/limelight/templates/sources/scene_spec/scene_spec.rb.template +13 -0
- data/lib/limelight/templates/templater.rb +4 -1
- data/lib/limelight/templates/templater_logger.rb +3 -0
- data/lib/limelight/theater.rb +15 -6
- data/lib/limelight/util/downloader.rb +3 -1
- data/lib/limelight/util.rb +8 -7
- data/lib/limelight/version.rb +3 -3
- data/lib/limelight.jar +0 -0
- data/productions/examples/8thlight.com/about/props.rb +1 -1
- data/productions/examples/8thlight.com/about/styles.rb +1 -1
- data/productions/examples/8thlight.com/footer.rb +1 -1
- data/productions/examples/8thlight.com/home/props.rb +1 -1
- data/productions/examples/8thlight.com/home/styles.rb +1 -1
- data/productions/examples/8thlight.com/menu.rb +1 -1
- data/productions/examples/8thlight.com/services/props.rb +1 -1
- data/productions/examples/8thlight.com/services/styles.rb +1 -1
- data/productions/examples/8thlight.com/stages.rb +1 -1
- data/productions/examples/8thlight.com/styles.rb +1 -1
- data/productions/examples/calculator/players/button.rb +1 -1
- data/productions/examples/calculator/players/calculator.rb +1 -1
- data/productions/examples/calculator/players/calculator_model.rb +1 -1
- data/productions/examples/calculator/props.rb +1 -1
- data/productions/examples/calculator/styles.rb +1 -1
- data/productions/examples/langstons_ant/init.rb +3 -0
- data/productions/examples/langstons_ant/players/ant.rb +1 -1
- data/productions/examples/langstons_ant/players/log.rb +1 -1
- data/productions/examples/langstons_ant/players/start_stop_button.rb +1 -1
- data/productions/examples/langstons_ant/players/world.rb +1 -1
- data/productions/examples/langstons_ant/props.rb +1 -1
- data/productions/examples/langstons_ant/styles.rb +1 -1
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/props.rb +7 -0
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/styles.rb +29 -0
- data/productions/examples/sandbox/alerts/incompatible_production/production.rb +49 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/default_scene/default_scene_spec.rb +13 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/spec_helper.rb +5 -0
- data/productions/examples/sandbox/alerts/incompatible_production/stages.rb +17 -0
- data/productions/examples/sandbox/alerts/incompatible_production/styles.rb +12 -0
- data/productions/examples/sandbox/alerts/players/alerts.rb +14 -0
- data/productions/examples/sandbox/alerts/props.rb +7 -0
- data/productions/examples/sandbox/alerts/styles.rb +43 -0
- data/productions/examples/sandbox/background_images/props.rb +19 -0
- data/productions/examples/sandbox/background_images/styles.rb +40 -0
- data/productions/examples/sandbox/click_me/players/chromaton.rb +1 -1
- data/productions/examples/sandbox/click_me/props.rb +1 -1
- data/productions/examples/sandbox/click_me/styles.rb +1 -1
- data/productions/examples/sandbox/floaters/players/floater.rb +9 -5
- data/productions/examples/sandbox/floaters/players/surface.rb +1 -1
- data/productions/examples/sandbox/floaters/props.rb +1 -1
- data/productions/examples/sandbox/floaters/styles.rb +13 -13
- data/productions/examples/sandbox/frameing/players/sandbox.rb +3 -0
- data/productions/examples/sandbox/frameing/props.rb +3 -0
- data/productions/examples/sandbox/frameing/styles.rb +3 -0
- data/productions/examples/sandbox/gradients/players/spinner.rb +1 -1
- data/productions/examples/sandbox/gradients/players/teaser.rb +1 -1
- data/productions/examples/sandbox/gradients/players/wave.rb +1 -1
- data/productions/examples/sandbox/gradients/players/waves.rb +1 -1
- data/productions/examples/sandbox/gradients/props.rb +1 -1
- data/productions/examples/sandbox/gradients/styles.rb +1 -1
- data/productions/examples/sandbox/header.rb +4 -1
- data/productions/examples/sandbox/homer/players/homer.rb +1 -1
- data/productions/examples/sandbox/homer/props.rb +1 -1
- data/productions/examples/sandbox/homer/styles.rb +2 -2
- data/productions/examples/sandbox/images/space.png +0 -0
- data/productions/examples/sandbox/images_scene/props.rb +3 -0
- data/productions/examples/sandbox/images_scene/styles.rb +3 -0
- data/productions/examples/sandbox/inputs/players/button_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/check_box_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/combo_box_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/radio_button_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/text_area_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/text_box_input.rb +1 -1
- data/productions/examples/sandbox/inputs/props.rb +1 -1
- data/productions/examples/sandbox/inputs/styles.rb +1 -1
- data/productions/examples/sandbox/kiosk/players/kiosk.rb +36 -0
- data/productions/examples/sandbox/kiosk/props.rb +6 -0
- data/productions/examples/sandbox/kiosk/styles.rb +34 -0
- data/productions/examples/sandbox/players/sandbox.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/players/box.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/props.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/styles.rb +1 -1
- data/productions/examples/sandbox/scrolling/players/add_button.rb +1 -1
- data/productions/examples/sandbox/scrolling/players/cell.rb +1 -1
- data/productions/examples/sandbox/scrolling/props.rb +1 -1
- data/productions/examples/sandbox/scrolling/styles.rb +1 -1
- data/productions/examples/sandbox/sketching/players/sketchpad.rb +1 -1
- data/productions/examples/sandbox/sketching/props.rb +1 -1
- data/productions/examples/sandbox/sketching/styles.rb +1 -1
- data/productions/examples/sandbox/sounds/players/clip.rb +1 -1
- data/productions/examples/sandbox/sounds/props.rb +1 -1
- data/productions/examples/sandbox/sounds/styles.rb +1 -1
- data/productions/examples/sandbox/spec/alerts/alerts_spec.rb +13 -0
- data/productions/examples/sandbox/stages.rb +2 -1
- data/productions/examples/sandbox/styles.rb +1 -1
- data/productions/examples/sandbox/teaser/players/fader.rb +1 -1
- data/productions/examples/sandbox/teaser/props.rb +1 -1
- data/productions/examples/sandbox/teaser/styles.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/players/sample.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/props.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/styles.rb +1 -1
- data/productions/stage_composer/init.rb +1 -1
- data/productions/stage_composer/inspector/players/inspector.rb +1 -1
- data/productions/stage_composer/inspector/players/prop_row.rb +1 -1
- data/productions/stage_composer/inspector/players/prop_tree.rb +1 -1
- data/productions/stage_composer/inspector/players/style_table.rb +1 -1
- data/productions/stage_composer/inspector/players/style_value.rb +1 -1
- data/productions/stage_composer/inspector/props.rb +1 -1
- data/productions/stage_composer/inspector/styles.rb +1 -1
- data/productions/stage_composer/lib/init.rb +1 -1
- data/productions/stage_composer/lib/limelight/composer/controller.rb +1 -1
- data/productions/stage_composer/lib/limelight/composer/lethargy.rb +1 -1
- data/productions/stage_composer/production.rb +1 -1
- data/productions/stage_composer/stages.rb +1 -1
- data/productions/startup/production.rb +49 -0
- data/productions/startup/spec/default_scene/default_scene_spec.rb +13 -0
- data/productions/startup/spec/spec_helper.rb +5 -0
- data/productions/startup/stages.rb +5 -2
- data/productions/startup/styles.rb +12 -0
- data/productions/startup/welcome/players/browse_button.rb +1 -1
- data/productions/startup/welcome/players/download_button.rb +1 -1
- data/productions/startup/welcome/players/sandbox_button.rb +1 -1
- data/productions/startup/welcome/props.rb +2 -2
- data/productions/startup/welcome/styles.rb +1 -1
- data/spec/builtin/players/button_spec.rb +1 -1
- data/spec/builtin/players/check_box_spec.rb +1 -1
- data/spec/builtin/players/combo_box_spec.rb +1 -1
- data/spec/builtin/players/image_spec.rb +3 -0
- data/spec/builtin/players/password_box_spec.rb +1 -1
- data/spec/builtin/players/radio_button_spec.rb +7 -7
- data/spec/builtin/players/text_area_spec.rb +1 -1
- data/spec/builtin/players/text_box_spec.rb +1 -1
- data/spec/builtin/utilities_production/spec_helper.rb +4 -0
- data/spec/builtin/utilities_production/utilities_production_spec.rb +143 -0
- data/spec/casting_director_spec.rb +7 -7
- data/spec/client/playbills_spec.rb +3 -0
- data/spec/commands/command_spec.rb +9 -1
- data/spec/commands/create_command_spec.rb +35 -5
- data/spec/commands/freeze_command_spec.rb +3 -0
- data/spec/commands/help_command_spec.rb +6 -3
- data/spec/commands/open_command_spec.rb +24 -2
- data/spec/commands/pack_command_spec.rb +3 -0
- data/spec/commands/unpack_command_spec.rb +4 -1
- data/spec/data_spec.rb +5 -16
- data/spec/dsl/production_builder_spec.rb +1 -1
- data/spec/dsl/prop_builder_spec.rb +19 -19
- data/spec/dsl/stage_builder_spec.rb +1 -1
- data/spec/dsl/styles_builder_spec.rb +1 -1
- data/spec/file_chooser_spec.rb +1 -1
- data/spec/file_filter_spec.rb +1 -1
- data/spec/file_loader_spec.rb +1 -1
- data/spec/gems_spec.rb +3 -0
- data/spec/java_util_spec.rb +1 -1
- data/spec/main_spec.rb +4 -1
- data/spec/paint_action_spec.rb +1 -1
- data/spec/pen_spec.rb +1 -1
- data/spec/producer_spec.rb +73 -32
- data/spec/production_spec.rb +23 -44
- data/spec/prop_spec.rb +102 -64
- data/spec/scene_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -2
- data/spec/stage_spec.rb +172 -36
- data/spec/string_spec.rb +3 -0
- data/spec/studio_spec.rb +131 -3
- data/spec/styles_spec.rb +3 -0
- data/spec/templates/production_templater_spec.rb +12 -1
- data/spec/templates/scene_templater_spec.rb +17 -2
- data/spec/templates/templater_logger_spec.rb +3 -0
- data/spec/templates/templater_spec.rb +3 -0
- data/spec/theater_spec.rb +16 -1
- data/spec/util/downloader_spec.rb +3 -0
- metadata +56 -6
- data/lib/i4jruntime.jar +0 -0
- data/lib/junit-4.4.jar +0 -0
@@ -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 Startup
|
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 "0.4.0"
|
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 busines 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,13 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
|
+
|
3
|
+
describe "Default Scene" do
|
4
|
+
|
5
|
+
uses_scene "default_scene", :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 Default Scene scene."
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -1,6 +1,9 @@
|
|
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
|
+
|
1
4
|
stage "default" do
|
2
5
|
default_scene "welcome"
|
3
6
|
title "Limelight"
|
4
|
-
location
|
5
|
-
size [
|
7
|
+
location :center, :center
|
8
|
+
size [900, 800]
|
6
9
|
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
|
+
#}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
__ :name => "root"
|
@@ -20,4 +20,4 @@ section do
|
|
20
20
|
sandbox_button :text => "Open the Sandbox"
|
21
21
|
end
|
22
22
|
spacer :width => "100", :height => "110"
|
23
|
-
copyright :text => "Copyright 2008 8th Light, Inc."
|
23
|
+
copyright :text => "Copyright 2008-2009 8th Light, Inc."
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
5
|
require 'limelight/builtin/players/image'
|
3
6
|
require 'limelight/prop'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -47,14 +47,14 @@ describe Limelight::Builtin::Players::RadioButton do
|
|
47
47
|
prop3.group = "group 2"
|
48
48
|
|
49
49
|
group1 = @scene.button_groups["group 1"]
|
50
|
-
group1.elements.
|
51
|
-
group1.elements.
|
52
|
-
group1.elements.
|
50
|
+
group1.elements.include?(@prop.radio_button).should == true
|
51
|
+
group1.elements.include?(prop2.radio_button).should == true
|
52
|
+
group1.elements.include?(prop3.radio_button).should == false
|
53
53
|
|
54
54
|
group2 = @scene.button_groups["group 2"]
|
55
|
-
group2.elements.
|
56
|
-
group2.elements.
|
57
|
-
group2.elements.
|
55
|
+
group2.elements.include?(@prop.radio_button).should == false
|
56
|
+
group2.elements.include?(prop2.radio_button).should == false
|
57
|
+
group2.elements.include?(prop3.radio_button).should == true
|
58
58
|
|
59
59
|
@prop.button_group.should == group1
|
60
60
|
prop2.button_group.should == group1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
@@ -0,0 +1,143 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
2
|
+
|
3
|
+
describe "Utilitites Production" do
|
4
|
+
|
5
|
+
uses_scene "none"
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
production.production_opening
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
@thread.kill if @thread
|
13
|
+
production.theater.stages.each { |stage| stage.close }
|
14
|
+
end
|
15
|
+
|
16
|
+
after(:all) do
|
17
|
+
# Java::java.awt.Frame.getFrames.each { |frame| frame.close; frame.dispose; puts frame }
|
18
|
+
# Java::limelight.util.Threads.showAll
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should construct stage on load_with_incomptible_version_scene" do
|
22
|
+
production.load_incompatible_version_scene("Some Production", "1.2.3")
|
23
|
+
stage = production.theater["Incompatible Version"]
|
24
|
+
stage.should_not == nil
|
25
|
+
stage.location.should == ["center", "center"]
|
26
|
+
stage.size.should == ["400", "auto"]
|
27
|
+
stage.background_color.should == "#FFFFFF"
|
28
|
+
stage.framed?.should == false
|
29
|
+
stage.always_on_top?.should == true
|
30
|
+
stage.vital?.should == false
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should not construct the incomptible_version stage twice" do
|
34
|
+
production.load_incompatible_version_scene("Some Production", "1.2.3")
|
35
|
+
stage = production.theater["Incompatible Version"]
|
36
|
+
|
37
|
+
lambda { production.load_incompatible_version_scene("Some Production", "1.2.3") }.should_not raise_error
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should load the incomptible_version scene" do
|
41
|
+
production.load_incompatible_version_scene("Some Production", "1.2.3")
|
42
|
+
stage = production.theater["Incompatible Version"]
|
43
|
+
|
44
|
+
stage.current_scene.should_not == nil
|
45
|
+
scene = stage.current_scene
|
46
|
+
scene.find("production_name_label").text.should == "Some Production"
|
47
|
+
scene.find("required_version_label").text.should == "1.2.3"
|
48
|
+
scene.find("current_version_label").text.should == Limelight::VERSION::STRING
|
49
|
+
end
|
50
|
+
|
51
|
+
def start_proceed_with_incompatible_version()
|
52
|
+
@thread = Thread.new do
|
53
|
+
begin
|
54
|
+
@result = production.proceed_with_incompatible_version?("Some Production", "1.2.3")
|
55
|
+
rescue Exception => e
|
56
|
+
puts e
|
57
|
+
puts e.backtrace
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def wait_for
|
63
|
+
10.times do
|
64
|
+
return if yield
|
65
|
+
sleep(0.1)
|
66
|
+
end
|
67
|
+
raise "the desired condition was not met on time"
|
68
|
+
end
|
69
|
+
|
70
|
+
def scene_open?(stage_name)
|
71
|
+
stage = production.theater[stage_name]
|
72
|
+
return stage != nil && stage.current_scene != nil
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should return true when clicking proceed" do
|
76
|
+
@result = nil
|
77
|
+
start_proceed_with_incompatible_version()
|
78
|
+
wait_for { scene_open?("Incompatible Version") }
|
79
|
+
|
80
|
+
scene = production.theater["Incompatible Version"].current_scene
|
81
|
+
scene.find("proceed_button").button_pressed(nil)
|
82
|
+
wait_for { !@thread.alive? }
|
83
|
+
|
84
|
+
@result.should == true
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should return false when clicking cancel" do
|
88
|
+
@result = nil
|
89
|
+
start_proceed_with_incompatible_version()
|
90
|
+
wait_for { scene_open?("Incompatible Version") }
|
91
|
+
|
92
|
+
scene = production.theater["Incompatible Version"].current_scene
|
93
|
+
scene.find("cancel_button").button_pressed(nil)
|
94
|
+
wait_for { !@thread.alive? }
|
95
|
+
|
96
|
+
@result.should == false
|
97
|
+
end
|
98
|
+
|
99
|
+
def start_alert()
|
100
|
+
@thread = Thread.new do
|
101
|
+
begin
|
102
|
+
@result = production.alert("Some Message")
|
103
|
+
rescue Exception => e
|
104
|
+
puts e
|
105
|
+
puts e.backtrace
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should construct alert stage" do
|
111
|
+
production.load_alert_scene("Some Message")
|
112
|
+
stage = production.theater["Alert"]
|
113
|
+
stage.should_not == nil
|
114
|
+
stage.location.should == ["center", "center"]
|
115
|
+
stage.size.should == ["400", "auto"]
|
116
|
+
stage.background_color.should == "#FFFFFF"
|
117
|
+
stage.framed?.should == false
|
118
|
+
stage.always_on_top?.should == true
|
119
|
+
stage.vital?.should == false
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should load the incomptible_version scene" do
|
123
|
+
production.load_alert_scene("Some Message")
|
124
|
+
stage = production.theater["Alert"]
|
125
|
+
|
126
|
+
stage.current_scene.should_not == nil
|
127
|
+
scene = stage.current_scene
|
128
|
+
scene.find("title").text.should == "Limelight Alert"
|
129
|
+
scene.find("message").text.should == "Some Message"
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should close the alert when clicking OK" do
|
133
|
+
start_alert
|
134
|
+
wait_for { scene_open?("Alert") }
|
135
|
+
|
136
|
+
scene = production.theater["Alert"].current_scene
|
137
|
+
scene.find("ok_button").button_pressed(nil)
|
138
|
+
|
139
|
+
wait_for { !@thread.alive? }
|
140
|
+
@result.should == true
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
@@ -39,7 +39,7 @@ describe Limelight::CastingDirector do
|
|
39
39
|
|
40
40
|
$casted_props.length.should == 1
|
41
41
|
$casted_props[0].should == @root
|
42
|
-
$casted_players[0].name.
|
42
|
+
$casted_players[0].name.include?("Root").should == true
|
43
43
|
@root.is_a?($casted_players[0]).should == true
|
44
44
|
end
|
45
45
|
|
@@ -89,7 +89,7 @@ describe Limelight::CastingDirector do
|
|
89
89
|
@casting_director.fill_cast(@root)
|
90
90
|
|
91
91
|
$casted_props[0].should == @root
|
92
|
-
$casted_players[0].name.
|
92
|
+
$casted_players[0].name.include?("CustomPlayer").should == true
|
93
93
|
@root.is_a?($casted_players[0]).should == true
|
94
94
|
end
|
95
95
|
|
@@ -102,10 +102,10 @@ describe Limelight::CastingDirector do
|
|
102
102
|
@casting_director.fill_cast(@root)
|
103
103
|
|
104
104
|
$casted_props[0].should == @root
|
105
|
-
$casted_players[0].name.
|
105
|
+
$casted_players[0].name.include?("Root").should == true
|
106
106
|
@root.is_a?($casted_players[0]).should == true
|
107
107
|
@root.is_a?(Limelight::Builtin::Players::Button).should == true
|
108
|
-
$casted_players[1].name.
|
108
|
+
$casted_players[1].name.include?("CustomPlayer").should == true
|
109
109
|
@root.is_a?($casted_players[1]).should == true
|
110
110
|
end
|
111
111
|
|
@@ -120,8 +120,8 @@ describe Limelight::CastingDirector do
|
|
120
120
|
@casting_director.fill_cast(@root)
|
121
121
|
|
122
122
|
$casted_props[0].should == @root
|
123
|
-
$casted_players[0].name.
|
124
|
-
$casted_players[1].name.
|
123
|
+
$casted_players[0].name.include?("Root").should == true
|
124
|
+
$casted_players[1].name.include?("SharedPlayer").should == true
|
125
125
|
@root.is_a?($casted_players[0]).should == true
|
126
126
|
@root.is_a?($casted_players[1]).should == true
|
127
127
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
1
|
+
#- Copyright � 2008-2009 8th Light, Inc. All Rights Reserved.
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
3
3
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
@@ -15,4 +15,12 @@ describe Limelight::Commands::Command do
|
|
15
15
|
Limelight::Commands::LISTING["mine"].should == myclass
|
16
16
|
end
|
17
17
|
|
18
|
+
it "should load the open command" do
|
19
|
+
Limelight::Commands["open"].name.should == "Limelight::Commands::OpenCommand"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "shouldn't crash on unknown commands" do
|
23
|
+
lambda { Limelight::Commands["blah"] }.should_not raise_error
|
24
|
+
end
|
25
|
+
|
18
26
|
end
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/create_command'
|
3
6
|
require 'limelight/templates/production_templater'
|
@@ -23,7 +26,7 @@ describe Limelight::Commands::CreateCommand do
|
|
23
26
|
production_templater = make_mock("production_templater")
|
24
27
|
Limelight::Templates::ProductionTemplater.should_receive(:new).with("blah", "default_scene").and_return(production_templater)
|
25
28
|
scene_templater = make_mock("scene_templater")
|
26
|
-
Limelight::Templates::SceneTemplater.should_receive(:new).with("blah
|
29
|
+
Limelight::Templates::SceneTemplater.should_receive(:new).with("blah", "default_scene").and_return(scene_templater)
|
27
30
|
production_templater.should_receive(:generate)
|
28
31
|
scene_templater.should_receive(:generate)
|
29
32
|
|
@@ -33,12 +36,21 @@ describe Limelight::Commands::CreateCommand do
|
|
33
36
|
it "should create a scene" do
|
34
37
|
Limelight::Templates::ProductionTemplater.should_not_receive(:new)
|
35
38
|
scene_templater = make_mock("scene_templater")
|
36
|
-
Limelight::Templates::SceneTemplater.should_receive(:new).with("prod/some_scene").and_return(scene_templater)
|
39
|
+
Limelight::Templates::SceneTemplater.should_receive(:new).with(".", "prod/some_scene").and_return(scene_templater)
|
37
40
|
scene_templater.should_receive(:generate)
|
38
41
|
|
39
42
|
@command.run(["scene", "prod/some_scene"])
|
40
43
|
end
|
41
44
|
|
45
|
+
it "should create a scene with specified production_path" do
|
46
|
+
Limelight::Templates::ProductionTemplater.should_not_receive(:new)
|
47
|
+
scene_templater = make_mock("scene_templater")
|
48
|
+
Limelight::Templates::SceneTemplater.should_receive(:new).with("prod", "some_scene").and_return(scene_templater)
|
49
|
+
scene_templater.should_receive(:generate)
|
50
|
+
|
51
|
+
@command.run(["-p", "prod", "scene", "some_scene"])
|
52
|
+
end
|
53
|
+
|
42
54
|
it "should print useage on invalid template type" do
|
43
55
|
@command.should_receive(:parse_error).at_least(:once)
|
44
56
|
|
@@ -54,21 +66,39 @@ describe Limelight::Commands::CreateCommand do
|
|
54
66
|
it "should have a default scene name" do
|
55
67
|
@command.parse ["production", "blah"]
|
56
68
|
|
57
|
-
@command.
|
69
|
+
@command.scene_name.should == "default_scene"
|
58
70
|
@command.template_type.should == "production"
|
59
71
|
@command.path.should == "blah"
|
60
72
|
end
|
61
73
|
|
74
|
+
it "should have a default production path" do
|
75
|
+
@command.parse ["scene", "blah"]
|
76
|
+
|
77
|
+
@command.production_path.should == "."
|
78
|
+
end
|
79
|
+
|
62
80
|
it "should parse a scene option" do
|
63
81
|
@command.parse ["-s", "scene_name", "production", "blah"]
|
64
|
-
@command.
|
82
|
+
@command.scene_name.should == "scene_name"
|
65
83
|
@command.template_type.should == "production"
|
66
84
|
@command.path.should == "blah"
|
67
85
|
|
68
86
|
@command.parse ["--scene=another_scene", "production", "blah"]
|
69
|
-
@command.
|
87
|
+
@command.scene_name.should == "another_scene"
|
70
88
|
@command.template_type.should == "production"
|
71
89
|
@command.path.should == "blah"
|
72
90
|
end
|
73
91
|
|
92
|
+
it "should parse a production path option" do
|
93
|
+
@command.parse ["-p", "prod_path", "scene", "blah"]
|
94
|
+
@command.production_path.should == "prod_path"
|
95
|
+
@command.template_type.should == "scene"
|
96
|
+
@command.path.should == "blah"
|
97
|
+
|
98
|
+
@command.parse ["--production_path=prody_path", "scene", "blah"]
|
99
|
+
@command.production_path.should == "prody_path"
|
100
|
+
@command.template_type.should == "scene"
|
101
|
+
@command.path.should == "blah"
|
102
|
+
end
|
103
|
+
|
74
104
|
end
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/freeze_command'
|
3
6
|
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/help_command'
|
3
6
|
|
@@ -23,9 +26,9 @@ describe Limelight::Commands::HelpCommand do
|
|
23
26
|
|
24
27
|
Limelight::Commands::LISTING.keys.each do |key|
|
25
28
|
if key[0...1] == "-"
|
26
|
-
@mock_output.string.
|
29
|
+
@mock_output.string.include?("\t#{key}").should == false
|
27
30
|
else
|
28
|
-
@mock_output.string.
|
31
|
+
@mock_output.string.include?("\t#{key}").should == true
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
@@ -33,7 +36,7 @@ describe Limelight::Commands::HelpCommand do
|
|
33
36
|
it "should include options in the header" do
|
34
37
|
@command.run([])
|
35
38
|
|
36
|
-
@mock_output.string.
|
39
|
+
@mock_output.string.include?("[--version]").should == true
|
37
40
|
end
|
38
41
|
|
39
42
|
end
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/open_command'
|
3
6
|
require 'limelight/producer'
|
@@ -15,16 +18,35 @@ describe Limelight::Commands::OpenCommand do
|
|
15
18
|
|
16
19
|
it "should open a production" do
|
17
20
|
Limelight::Main.should_receive(:initialize_context)
|
18
|
-
Limelight::
|
21
|
+
Limelight::Studio.should_receive(:open).with("production_name")
|
19
22
|
|
20
23
|
@command.run(["production_name"])
|
21
24
|
end
|
22
25
|
|
23
26
|
it "should open the default production" do
|
24
27
|
Limelight::Main.should_receive(:initialize_context)
|
25
|
-
Limelight::
|
28
|
+
Limelight::Studio.should_receive(:open).with(@command_class::DEFAULT_PRODUCTION)
|
26
29
|
|
27
30
|
@command.run([])
|
28
31
|
end
|
29
32
|
|
33
|
+
it "should parse drp_port option" do
|
34
|
+
@command.parse ["production_path"]
|
35
|
+
@command.drb_port.should == nil
|
36
|
+
|
37
|
+
@command.parse ["-d", "1234", "some_prod"]
|
38
|
+
@command.drb_port.should == "1234"
|
39
|
+
|
40
|
+
@command.parse ["--drb_port=4321", "some_prod"]
|
41
|
+
@command.drb_port.should == "4321"
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should start the studio on drb" do
|
45
|
+
Limelight::Main.should_receive(:initialize_context)
|
46
|
+
Limelight::Studio.should_receive(:publish_on_drb).with(1234)
|
47
|
+
Limelight::Studio.should_receive(:open).with("some_prod")
|
48
|
+
|
49
|
+
@command.run ["-d", "1234", "some_prod"]
|
50
|
+
end
|
51
|
+
|
30
52
|
end
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/pack_command'
|
3
6
|
|
@@ -1,3 +1,6 @@
|
|
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
|
+
|
1
4
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
5
|
require 'limelight/commands/unpack_command'
|
3
6
|
|
@@ -38,7 +41,7 @@ describe Limelight::Commands::UnpackCommand do
|
|
38
41
|
it "print the unpacked location" do
|
39
42
|
@command.run(["production_to_pack"])
|
40
43
|
|
41
|
-
@mock_output.string.
|
44
|
+
@mock_output.string.include?("Production was unpacked to: unpacked location").should == true
|
42
45
|
end
|
43
46
|
|
44
47
|
end
|