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
data/spec/data_spec.rb
CHANGED
@@ -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/data'
|
3
6
|
|
@@ -5,21 +8,7 @@ describe Limelight::Data do
|
|
5
8
|
|
6
9
|
before(:each) do
|
7
10
|
Limelight::Data.reset
|
8
|
-
Limelight::Context.instance.stub!(:
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should have a root on osx" do
|
12
|
-
Limelight::Context.instance.stub!(:os).and_return("osx")
|
13
|
-
expected = File.expand_path(File.join("~/Library/Application Support/Limelight"))
|
14
|
-
|
15
|
-
Limelight::Data.root.should == expected
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should have a root on windows" do
|
19
|
-
Limelight::Context.instance.stub!(:os).and_return("windows")
|
20
|
-
expected = File.expand_path(File.join("~/Application Data/Limelight"))
|
21
|
-
|
22
|
-
Limelight::Data.root.should == expected
|
11
|
+
Limelight::Context.instance.os.stub!(:dataRoot).and_return("~/")
|
23
12
|
end
|
24
13
|
|
25
14
|
it "should have a Downloads dir" do
|
@@ -33,7 +22,7 @@ describe Limelight::Data do
|
|
33
22
|
|
34
23
|
Limelight::Data.productions_dir.should == expected
|
35
24
|
end
|
36
|
-
|
25
|
+
|
37
26
|
it "should establish all the dirs" do
|
38
27
|
Limelight::Data.stub!(:root).and_return(TestDir.path("Limelight"))
|
39
28
|
|
@@ -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")
|
@@ -12,7 +12,7 @@ describe Limelight::DSL::PropBuilder do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should build root" do
|
15
|
-
root = Limelight.
|
15
|
+
root = Limelight.build_props(@scene)
|
16
16
|
root.illuminate
|
17
17
|
|
18
18
|
root.class.should == Limelight::Scene
|
@@ -22,7 +22,7 @@ describe Limelight::DSL::PropBuilder do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should build one child prop" do
|
25
|
-
root = Limelight::
|
25
|
+
root = Limelight::build_props(@scene) do
|
26
26
|
child
|
27
27
|
end
|
28
28
|
root.illuminate
|
@@ -36,7 +36,7 @@ describe Limelight::DSL::PropBuilder do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should allow multiple children" do
|
39
|
-
root = Limelight::
|
39
|
+
root = Limelight::build_props(@scene) do
|
40
40
|
child1
|
41
41
|
child2
|
42
42
|
end
|
@@ -48,7 +48,7 @@ describe Limelight::DSL::PropBuilder do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should allow nested children" do
|
51
|
-
root = Limelight::
|
51
|
+
root = Limelight::build_props(@scene) do
|
52
52
|
child do
|
53
53
|
grandchild
|
54
54
|
end
|
@@ -62,7 +62,7 @@ describe Limelight::DSL::PropBuilder do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should be able to set the id" do
|
65
|
-
root = Limelight::
|
65
|
+
root = Limelight::build_props(@scene) do
|
66
66
|
child :id => "child_1", :players => "x, y, z"
|
67
67
|
end
|
68
68
|
root.illuminate
|
@@ -73,7 +73,7 @@ describe Limelight::DSL::PropBuilder do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
it "should allow setting styles" do
|
76
|
-
root = Limelight::
|
76
|
+
root = Limelight::build_props(@scene) do
|
77
77
|
child :width => "100", :font_size => "10", :top_border_color => "blue"
|
78
78
|
end
|
79
79
|
root.illuminate
|
@@ -85,7 +85,7 @@ describe Limelight::DSL::PropBuilder do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
it "should allow defining events through constructor" do
|
88
|
-
root = Limelight::
|
88
|
+
root = Limelight::build_props(@scene) do
|
89
89
|
child :on_mouse_entered => "return [self, event]"
|
90
90
|
end
|
91
91
|
root.illuminate
|
@@ -95,7 +95,7 @@ describe Limelight::DSL::PropBuilder do
|
|
95
95
|
end
|
96
96
|
|
97
97
|
it "should allow scene configuration" do
|
98
|
-
root = Limelight::
|
98
|
+
root = Limelight::build_props(@scene) do
|
99
99
|
__ :name => "root", :id => "123"
|
100
100
|
end
|
101
101
|
root.illuminate
|
@@ -106,7 +106,7 @@ describe Limelight::DSL::PropBuilder do
|
|
106
106
|
end
|
107
107
|
|
108
108
|
it "should give every prop their scene" do
|
109
|
-
root = Limelight::
|
109
|
+
root = Limelight::build_props(@scene) do
|
110
110
|
child do
|
111
111
|
grandchild
|
112
112
|
end
|
@@ -121,7 +121,7 @@ describe Limelight::DSL::PropBuilder do
|
|
121
121
|
loader = make_mock("loader", :exists? => true)
|
122
122
|
loader.should_receive(:load).with("external.rb").and_return("child :id => 123")
|
123
123
|
|
124
|
-
root = Limelight::
|
124
|
+
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
|
125
125
|
__install "external.rb"
|
126
126
|
end
|
127
127
|
root.illuminate
|
@@ -135,7 +135,7 @@ describe Limelight::DSL::PropBuilder do
|
|
135
135
|
|
136
136
|
it "should fail if no loader is provided" do
|
137
137
|
begin
|
138
|
-
root = Limelight::
|
138
|
+
root = Limelight::build_props(@scene, :id => 321, :build_loader => nil) do
|
139
139
|
__install "external.rb"
|
140
140
|
end
|
141
141
|
root.should == nil # should never get here
|
@@ -149,7 +149,7 @@ describe Limelight::DSL::PropBuilder do
|
|
149
149
|
loader.should_receive(:exists?).with("external.rb").and_return(false)
|
150
150
|
|
151
151
|
begin
|
152
|
-
root = Limelight::
|
152
|
+
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader) do
|
153
153
|
__install "external.rb"
|
154
154
|
end
|
155
155
|
rescue Exception => e
|
@@ -162,11 +162,11 @@ describe Limelight::DSL::PropBuilder do
|
|
162
162
|
loader.should_receive(:load).with("external.rb").and_return("+")
|
163
163
|
|
164
164
|
begin
|
165
|
-
root = Limelight::
|
165
|
+
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader) do
|
166
166
|
__install "external.rb"
|
167
167
|
end
|
168
168
|
rescue Limelight::DSL::BuildException => e
|
169
|
-
e.message.
|
169
|
+
e.message.include?("external.rb:1: (eval):1: , unexpected end-of-file").should == true
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
@@ -187,7 +187,7 @@ describe Limelight::DSL::PropBuilder do
|
|
187
187
|
end
|
188
188
|
|
189
189
|
it "should not crash with prop named display" do
|
190
|
-
root = Limelight::
|
190
|
+
root = Limelight::build_props(@scene) do
|
191
191
|
display :id => "display"
|
192
192
|
end
|
193
193
|
root.illuminate
|
@@ -199,7 +199,7 @@ describe Limelight::DSL::PropBuilder do
|
|
199
199
|
end
|
200
200
|
|
201
201
|
it "should allow instance variables" do
|
202
|
-
root = Limelight::
|
202
|
+
root = Limelight::build_props(@scene, :instance_variables => { :id1 => "abc", :id2 => "xyz" } ) do
|
203
203
|
__ :id => @id1
|
204
204
|
child :id => @id2
|
205
205
|
end
|
@@ -211,7 +211,7 @@ describe Limelight::DSL::PropBuilder do
|
|
211
211
|
end
|
212
212
|
|
213
213
|
it "should propogate instance variables to nested levels" do
|
214
|
-
root = Limelight::
|
214
|
+
root = Limelight::build_props(@scene, :instance_variables => { :name => "blah" } ) do
|
215
215
|
child :id => "child", :name => @name do
|
216
216
|
grand_child :id => "grand_child", :name => @name do
|
217
217
|
great_grand_child :id => "great_grand_child", :name => @name do
|
@@ -232,7 +232,7 @@ describe Limelight::DSL::PropBuilder do
|
|
232
232
|
loader = make_mock("loader", :exists? => true)
|
233
233
|
loader.should_receive(:load).with("external.rb").and_return("child :id => @desired_id")
|
234
234
|
|
235
|
-
root = Limelight::
|
235
|
+
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
|
236
236
|
__install "external.rb", :desired_id => "123"
|
237
237
|
end
|
238
238
|
root.illuminate
|
@@ -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")
|
data/spec/file_chooser_spec.rb
CHANGED
@@ -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")
|
data/spec/file_filter_spec.rb
CHANGED
@@ -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")
|
data/spec/file_loader_spec.rb
CHANGED
@@ -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")
|
data/spec/gems_spec.rb
CHANGED
@@ -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/gems"
|
3
6
|
require 'limelight/production'
|
data/spec/java_util_spec.rb
CHANGED
@@ -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")
|
data/spec/main_spec.rb
CHANGED
@@ -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/main'
|
3
6
|
|
@@ -31,7 +34,7 @@ describe Limelight::Main do
|
|
31
34
|
rescue SystemExit
|
32
35
|
end
|
33
36
|
|
34
|
-
@mock_output.string.
|
37
|
+
@mock_output.string.include?("Usage: limelight").should == true
|
35
38
|
end
|
36
39
|
|
37
40
|
end
|
data/spec/paint_action_spec.rb
CHANGED
@@ -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")
|
data/spec/pen_spec.rb
CHANGED
@@ -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")
|
data/spec/producer_spec.rb
CHANGED
@@ -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")
|
@@ -8,7 +8,7 @@ describe Limelight::Producer do
|
|
8
8
|
|
9
9
|
before(:each) do
|
10
10
|
TestDir.clean
|
11
|
-
Limelight::
|
11
|
+
Limelight::Studio.reset
|
12
12
|
@root_dir = TestDir.path("test_prod")
|
13
13
|
@producer = Limelight::Producer.new(@root_dir)
|
14
14
|
end
|
@@ -59,31 +59,33 @@ describe Limelight::Producer do
|
|
59
59
|
styles["alpha"].width.should == "100"
|
60
60
|
end
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
e.
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
e.
|
85
|
-
|
86
|
-
|
62
|
+
# Broken in JRuby 1.3
|
63
|
+
#
|
64
|
+
# it "should format prop errors well" do
|
65
|
+
# TestDir.create_file("test_prod/props.rb", "one\n+\nthree")
|
66
|
+
#
|
67
|
+
# begin
|
68
|
+
# result = @producer.load_props(:path => TestDir.path("test_prod"), :casting_director => make_mock("casting_director", :fill_cast => nil))
|
69
|
+
# result.should == nil # should never perform
|
70
|
+
# rescue Limelight::DSL::BuildException => e
|
71
|
+
# e.line_number.should == 3
|
72
|
+
# e.filename.should == TestDir.path("test_prod/props.rb")
|
73
|
+
# e.message.include?("/props.rb:3: undefined method `+@' for ").should == true
|
74
|
+
# end
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# it "should format styles errors well" do
|
78
|
+
# TestDir.create_file("test_prod/styles.rb", "one {}\ntwo {}\n-\nthree {}")
|
79
|
+
#
|
80
|
+
# begin
|
81
|
+
# result = @producer.load_styles(Limelight::Scene.new(:path => TestDir.path("test_prod")))
|
82
|
+
# result.should == nil # should never perform
|
83
|
+
# rescue Limelight::DSL::BuildException => e
|
84
|
+
# e.line_number.should == 4
|
85
|
+
# e.filename.should == TestDir.path("test_prod/styles.rb")
|
86
|
+
# e.message.include?("/styles.rb:4: undefined method `-@' for #<Java::LimelightStyles::RichStyle:0x").should == true
|
87
|
+
# end
|
88
|
+
# end
|
87
89
|
|
88
90
|
it "should load a stage when stages.rb exists" do
|
89
91
|
TestDir.create_file("test_prod/stages.rb", "stage 'Default' do\n default_scene 'abc'\n end")
|
@@ -111,6 +113,15 @@ describe Limelight::Producer do
|
|
111
113
|
@producer.theater["Limelight"].should_not == nil
|
112
114
|
end
|
113
115
|
|
116
|
+
it "should not load a scene when stages.rb doesn't exists and production indicates no default_scene" do
|
117
|
+
@producer.should_not_receive(:open_stages)
|
118
|
+
@producer.should_not_receive(:open_scene)
|
119
|
+
@producer.production.should_receive(:default_scene).and_return(nil)
|
120
|
+
Limelight::Gems.should_receive(:install_gems_in_production)
|
121
|
+
|
122
|
+
@producer.open
|
123
|
+
end
|
124
|
+
|
114
125
|
it "should load a stage but not open it if it has no default scene" do
|
115
126
|
TestDir.create_file("test_prod/stages.rb", "stage 'Default' do\n default_scene 'abc'\n end\n\nstage 'Hidden' do\n default_scene nil\n end")
|
116
127
|
@producer.should_receive(:open_scene).with("abc", anything)
|
@@ -137,18 +148,17 @@ describe Limelight::Producer do
|
|
137
148
|
@producer.load_styles(Limelight::Scene.new(:path => TestDir.path("test_prod"))).should == {}
|
138
149
|
end
|
139
150
|
|
140
|
-
it "should
|
141
|
-
TestDir.create_file("test_prod/production.rb", "name 'Fido'")
|
151
|
+
it "should extend the production if production.rb is present" do
|
152
|
+
TestDir.create_file("test_prod/production.rb", "module Production; def name; return 'Fido'; end; def foo; end; end;")
|
142
153
|
@producer.stub!(:open_scene)
|
143
|
-
Limelight::Gems.should_receive(:install_gems_in_production)
|
144
154
|
|
145
|
-
@producer.
|
155
|
+
@producer.establish_production
|
146
156
|
|
147
157
|
@producer.production.name.should == "Fido"
|
158
|
+
@producer.production.respond_to?(:foo).should == true
|
148
159
|
end
|
149
160
|
|
150
161
|
it "should load init.rb if it exists" do
|
151
|
-
TestDir.create_file("test_prod/production.rb", "name 'Fido'")
|
152
162
|
TestDir.create_file("test_prod/init.rb", "")
|
153
163
|
|
154
164
|
@producer.stub!(:open_scene)
|
@@ -168,10 +178,41 @@ describe Limelight::Producer do
|
|
168
178
|
$init_loaded.should == false;
|
169
179
|
end
|
170
180
|
|
181
|
+
it "should call production_opening, production_loaded, production_opened when opening a production" do
|
182
|
+
@producer.stub!(:open_scene)
|
183
|
+
Limelight::Gems.should_receive(:install_gems_in_production)
|
184
|
+
production = @producer.production
|
185
|
+
production.should_receive(:production_opening)
|
186
|
+
production.should_receive(:production_loaded)
|
187
|
+
production.should_receive(:production_opened)
|
188
|
+
|
189
|
+
@producer.open
|
190
|
+
end
|
191
|
+
|
171
192
|
it "should give the same buildin_styles hash twice" do
|
172
193
|
@producer.builtin_styles.should_not be(@producer.builtin_styles)
|
173
194
|
# Try again
|
174
195
|
@producer.builtin_styles.should_not be(@producer.builtin_styles)
|
175
196
|
end
|
176
197
|
|
198
|
+
it "should check limelight version" do
|
199
|
+
@producer.production.should_receive(:minimum_limelight_version).and_return("0.0.0")
|
200
|
+
@producer.version_compatible?.should == true
|
201
|
+
|
202
|
+
@producer.production.should_receive(:minimum_limelight_version).and_return("999.0.0")
|
203
|
+
@producer.version_compatible?.should == false
|
204
|
+
end
|
205
|
+
|
206
|
+
it "should allow options such as instance variables to be passed to open_scene" do
|
207
|
+
stage = make_mock("stage")
|
208
|
+
scene = make_mock("scene")
|
209
|
+
@producer.should_receive(:load_props).with(:instance_variables => { :foo => "bar" }, :production => @producer.production, :casting_director => anything, :path => TestDir.path("test_prod/name"), :name => "name").and_return(scene)
|
210
|
+
@producer.should_receive(:load_styles).and_return("styles")
|
211
|
+
@producer.should_receive(:merge_with_root_styles).with("styles")
|
212
|
+
scene.should_receive(:styles=)
|
213
|
+
stage.should_receive(:open).with(scene)
|
214
|
+
|
215
|
+
@producer.open_scene("name", stage, :instance_variables => { :foo => "bar" })
|
216
|
+
end
|
217
|
+
|
177
218
|
end
|
data/spec/production_spec.rb
CHANGED
@@ -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")
|
@@ -21,16 +21,25 @@ describe Limelight::Production, "Instance methods" do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should be indexed" do
|
24
|
-
Limelight::
|
24
|
+
Limelight::Studio.index(@production)
|
25
|
+
Limelight::Studio[@production.name].should == @production
|
25
26
|
end
|
26
27
|
|
27
28
|
it "should raise an error when setting the name to a duplicate name" do
|
28
29
|
@production.name = "Bill"
|
30
|
+
Limelight::Studio.index(@production)
|
29
31
|
|
30
32
|
production = Limelight::Production.new("/tmp")
|
33
|
+
Limelight::Studio.index(production)
|
31
34
|
lambda { production.name = "Bill" }.should raise_error(Limelight::LimelightException, "Production name 'Bill' is already taken")
|
32
35
|
end
|
33
36
|
|
37
|
+
it "should get it's name from the file" do
|
38
|
+
Limelight::Production.new("/tmp").name.should == "tmp"
|
39
|
+
Limelight::Production.new("/Somewhere/over/the/rainbow").name.should == "rainbow"
|
40
|
+
Limelight::Production.new("my_name/is/kid").name.should == "kid"
|
41
|
+
end
|
42
|
+
|
34
43
|
it "should know it's init file" do
|
35
44
|
@production.init_file.should == "/tmp/init.rb"
|
36
45
|
end
|
@@ -53,48 +62,18 @@ describe Limelight::Production, "Instance methods" do
|
|
53
62
|
@production.scene_directory(:root).should == "/tmp"
|
54
63
|
end
|
55
64
|
|
56
|
-
|
57
|
-
|
58
|
-
describe Limelight::Production, "Class methods" do
|
59
|
-
|
60
|
-
class TestProduction
|
61
|
-
attr_accessor :name
|
62
|
-
end
|
63
|
-
|
64
|
-
before(:each) do
|
65
|
-
Limelight::Production.clear_index
|
66
|
-
@production = TestProduction.new
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should add productions to the index" do
|
70
|
-
@production.name = "Bob"
|
71
|
-
|
72
|
-
Limelight::Production.index(@production)
|
73
|
-
|
74
|
-
Limelight::Production["Bob"].should == @production
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should give a production a name if it doesn't have one" do
|
78
|
-
Limelight::Production.index(@production)
|
79
|
-
|
80
|
-
@production.name.should == "1"
|
81
|
-
Limelight::Production["1"].should == @production
|
82
|
-
|
83
|
-
production2 = TestProduction.new
|
84
|
-
Limelight::Production.index(production2)
|
85
|
-
|
86
|
-
production2.name.should == "2"
|
87
|
-
Limelight::Production["2"].should == production2
|
65
|
+
it "should allow close by default" do
|
66
|
+
@production.allow_close?.should == true
|
88
67
|
end
|
89
|
-
|
90
|
-
it "should
|
91
|
-
|
92
|
-
|
93
|
-
@production.
|
94
|
-
|
95
|
-
|
96
|
-
Limelight::Production.index(@production)
|
97
|
-
lambda { Limelight::Production.index(production2) }.should raise_error(Limelight::LimelightException, "Production name 'Bob' is already taken")
|
68
|
+
|
69
|
+
it "should tell studio it closed and triger it's closing events" do
|
70
|
+
@production.should_receive(:production_closing)
|
71
|
+
Limelight::Studio.should_receive(:production_closed).with(@production)
|
72
|
+
@production.should_receive(:production_closed)
|
73
|
+
|
74
|
+
@production.close
|
98
75
|
end
|
99
|
-
|
76
|
+
|
100
77
|
end
|
78
|
+
|
79
|
+
|