epall-limelight 0.5.1-java → 0.5.2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/init.rb +2 -6
- data/lib/limelight.jar +0 -0
- data/lib/limelight/builtin/utilities_production/alert/players/alert.rb +4 -1
- data/lib/limelight/builtin/utilities_production/production.rb +6 -2
- data/lib/limelight/commands/create_command.rb +1 -1
- data/lib/limelight/commands/open_command.rb +4 -4
- data/lib/limelight/dsl/styles_builder.rb +5 -0
- data/lib/limelight/java_couplings.rb +3 -2
- data/lib/limelight/limelight_init.rb +12 -0
- data/lib/limelight/main.rb +43 -46
- data/lib/limelight/producer.rb +54 -13
- data/lib/limelight/production.rb +34 -7
- data/lib/limelight/scene.rb +1 -1
- data/lib/limelight/specs/spec_helper.rb +1 -1
- data/lib/limelight/specs/test_scene_opener.rb +3 -0
- data/lib/limelight/stage.rb +65 -5
- data/lib/limelight/studio.rb +28 -159
- data/lib/limelight/styles/style.rb +288 -0
- data/lib/limelight/theater.rb +27 -2
- data/lib/limelight/version.rb +2 -2
- data/productions/examples/sandbox/alerts/players/alerts.rb +1 -1
- data/productions/examples/sandbox/stage_handles/players/sizer.rb +3 -0
- data/spec/limelight/builtin/players/combo_box_spec.rb +1 -1
- data/spec/limelight/builtin/players/radio_button_spec.rb +1 -1
- data/spec/limelight/builtin/utilities_production/utilities_production_spec.rb +39 -38
- data/spec/limelight/casting_director_spec.rb +1 -1
- data/spec/limelight/commands/create_command_spec.rb +4 -4
- data/spec/limelight/commands/open_command_spec.rb +5 -4
- data/spec/limelight/commands/pack_command_spec.rb +1 -1
- data/spec/limelight/commands/unpack_command_spec.rb +1 -1
- data/spec/limelight/dsl/prop_builder_spec.rb +6 -6
- data/spec/limelight/dsl/stage_builder_spec.rb +1 -1
- data/spec/limelight/file_chooser_spec.rb +1 -1
- data/spec/limelight/file_filter_spec.rb +2 -2
- data/spec/limelight/main_spec.rb +2 -2
- data/spec/limelight/paint_action_spec.rb +1 -1
- data/spec/limelight/pen_spec.rb +1 -1
- data/spec/limelight/producer_spec.rb +30 -11
- data/spec/limelight/production_spec.rb +12 -20
- data/spec/limelight/prop_spec.rb +2 -2
- data/spec/limelight/scene_spec.rb +1 -1
- data/spec/limelight/stage_spec.rb +51 -6
- data/spec/limelight/templates/templater_spec.rb +1 -1
- data/spec/limelight/theater_spec.rb +49 -1
- data/spec/spec_helper.rb +0 -6
- metadata +5 -7
- data/lib/limelight/client/playbills.rb +0 -86
- data/lib/limelight/styles.rb +0 -347
- data/spec/limelight/client/playbills_spec.rb +0 -79
- data/spec/limelight/studio_spec.rb +0 -157
@@ -1,79 +0,0 @@
|
|
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 File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
|
-
require 'limelight/client/playbills'
|
6
|
-
|
7
|
-
describe Limelight::Client::Playbills do
|
8
|
-
|
9
|
-
before(:each) do
|
10
|
-
@xml = <<END
|
11
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
12
|
-
<playbills type="array">
|
13
|
-
<playbill>
|
14
|
-
<author>Jim Weirich and Micah Martin</author>
|
15
|
-
<created-at type="datetime">2009-01-02T17:07:26Z</created-at>
|
16
|
-
<description>The classic game of memory.</description>
|
17
|
-
<id type="integer">1</id>
|
18
|
-
<name>simon</name>
|
19
|
-
<size>270418</size>
|
20
|
-
<title>Limelight Simon</title>
|
21
|
-
<updated-at type="datetime">2009-01-02T17:07:26Z</updated-at>
|
22
|
-
<version>1.0</version>
|
23
|
-
<llp-path>/playbills/1.llp</llp-path>
|
24
|
-
<thumbnail-path>/playbills/1.thumbnail</thumbnail-path>
|
25
|
-
</playbill>
|
26
|
-
</playbills>
|
27
|
-
END
|
28
|
-
|
29
|
-
@response = mock("response")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should translate xml with 1 playbill" do
|
33
|
-
playbills = Limelight::Client::Playbills.from_xml(@xml)
|
34
|
-
playbills.length.should == 1
|
35
|
-
|
36
|
-
simon = playbills[0]
|
37
|
-
simon.name.should == "simon"
|
38
|
-
simon.title.should == "Limelight Simon"
|
39
|
-
simon.size.should == "270418"
|
40
|
-
simon.updated_at.year.should == 2009
|
41
|
-
simon.created_at.year.should == 2009
|
42
|
-
simon.thumbnail_path.should == "/playbills/1.thumbnail"
|
43
|
-
simon.llp_path.should == "/playbills/1.llp"
|
44
|
-
simon.author.should == "Jim Weirich and Micah Martin"
|
45
|
-
simon.description.should == "The classic game of memory."
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should get all the playbills from a URL" do
|
49
|
-
Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills.xml")).and_return(@response)
|
50
|
-
@response.should_receive(:body).and_return(@xml)
|
51
|
-
|
52
|
-
playbills = Limelight::Client::Playbills.from_url("http://localhost:3000/playbills.xml")
|
53
|
-
|
54
|
-
playbills.length.should == 1
|
55
|
-
playbills[0].uri.host.should == "localhost"
|
56
|
-
playbills[0].uri.port.should == 3000
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should get the thumbnail for a playbill" do
|
60
|
-
playbill = Limelight::Client::Playbill.new(URI.parse("http://localhost:3000/playbills.xml"))
|
61
|
-
playbill.thumbnail_path = "/playbills/1.thumbnail"
|
62
|
-
|
63
|
-
Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills/1.thumbnail")).and_return(@response)
|
64
|
-
@response.should_receive(:body).and_return("blah")
|
65
|
-
|
66
|
-
playbill.thumbnail.should == "blah"
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should get the thumbnail for a playbill" do
|
70
|
-
playbill = Limelight::Client::Playbill.new(URI.parse("http://localhost:3000/playbills.xml"))
|
71
|
-
playbill.llp_path = "/playbills/1.llp"
|
72
|
-
|
73
|
-
Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills/1.llp")).and_return(@response)
|
74
|
-
@response.should_receive(:body).and_return("blah")
|
75
|
-
|
76
|
-
playbill.llp.should == "blah"
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
@@ -1,157 +0,0 @@
|
|
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 File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
5
|
-
require 'limelight/studio'
|
6
|
-
|
7
|
-
Studio = Limelight::Studio
|
8
|
-
|
9
|
-
describe Limelight::Studio do
|
10
|
-
|
11
|
-
class TestProduction
|
12
|
-
attr_accessor :name
|
13
|
-
end
|
14
|
-
|
15
|
-
before do
|
16
|
-
Studio.reset
|
17
|
-
@production = TestProduction.new
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should install itsself" do
|
21
|
-
Studio.install
|
22
|
-
|
23
|
-
Limelight::Context.instance.studio.should == Studio.instance
|
24
|
-
end
|
25
|
-
|
26
|
-
def prepare_for_open()
|
27
|
-
@producer = mock("producer", :production => @production, :open => nil)
|
28
|
-
Limelight::Producer.stub!(:new).and_return(@producer)
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should keep track of productions opened" do
|
32
|
-
prepare_for_open
|
33
|
-
@production.name = "Sven"
|
34
|
-
Studio.productions.length.should == 0
|
35
|
-
|
36
|
-
Studio.open(@production)
|
37
|
-
|
38
|
-
Studio.productions.length.should == 1
|
39
|
-
Studio["Sven"].should be(@production)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should ask all the production if it's okay to close and not shutdown" do
|
43
|
-
Studio.index(@production)
|
44
|
-
|
45
|
-
@production.should_receive(:allow_close?).and_return(false)
|
46
|
-
Studio.should_allow_shutdown.should == false
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should ask all the production if it's okay to close and shutdown" do
|
50
|
-
Studio.index(@production)
|
51
|
-
|
52
|
-
@production.should_receive(:allow_close?).and_return(true)
|
53
|
-
Studio.should_allow_shutdown.should == true
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should removed productions that are closed" do
|
57
|
-
production1 = TestProduction.new
|
58
|
-
production2 = TestProduction.new
|
59
|
-
Studio.index(production1)
|
60
|
-
Studio.index(production2)
|
61
|
-
|
62
|
-
Studio.production_closed(production1)
|
63
|
-
|
64
|
-
Studio.productions.length.should == 1
|
65
|
-
Studio.productions[0].should be(production2)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should shutdown if all the productions are closed" do
|
69
|
-
prepare_for_open
|
70
|
-
Studio.open("blah")
|
71
|
-
Limelight::Context.instance().should_receive(:shutdown)
|
72
|
-
|
73
|
-
Studio.production_closed(@production)
|
74
|
-
|
75
|
-
sleep(0.1)
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should add productions to the index" do
|
79
|
-
@production.name = "Bob"
|
80
|
-
|
81
|
-
Limelight::Studio.index(@production)
|
82
|
-
|
83
|
-
Limelight::Studio["Bob"].should == @production
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should give a production a name if it doesn't have one" do
|
87
|
-
Limelight::Studio.index(@production)
|
88
|
-
|
89
|
-
@production.name.should == "1"
|
90
|
-
Limelight::Studio["1"].should == @production
|
91
|
-
|
92
|
-
production2 = TestProduction.new
|
93
|
-
Limelight::Studio.index(production2)
|
94
|
-
|
95
|
-
production2.name.should == "2"
|
96
|
-
Limelight::Studio["2"].should == production2
|
97
|
-
end
|
98
|
-
|
99
|
-
it "should modify the name of a production until it's unique" do
|
100
|
-
prod1 = TestProduction.new
|
101
|
-
prod2 = TestProduction.new
|
102
|
-
prod3 = TestProduction.new
|
103
|
-
prod1.name = prod2.name = prod3.name = "Fido"
|
104
|
-
|
105
|
-
Studio.index(prod1)
|
106
|
-
Studio.index(prod2)
|
107
|
-
Studio.index(prod3)
|
108
|
-
|
109
|
-
Studio["Fido"].should be(prod1)
|
110
|
-
Studio["Fido_2"].should be(prod2)
|
111
|
-
Studio["Fido_3"].should be(prod3)
|
112
|
-
prod1.name.should == "Fido"
|
113
|
-
prod2.name.should == "Fido_2"
|
114
|
-
prod3.name.should == "Fido_3"
|
115
|
-
end
|
116
|
-
|
117
|
-
it "should shutdown" do
|
118
|
-
Studio.index(@production)
|
119
|
-
@production.should_receive(:allow_close?).and_return(true)
|
120
|
-
@production.should_receive(:close).and_return(true)
|
121
|
-
Limelight::Context.instance().should_receive(:shutdown)
|
122
|
-
|
123
|
-
Studio.shutdown
|
124
|
-
sleep(0.1)
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should publish on drb" do
|
128
|
-
Studio.publish_on_drb("9876")
|
129
|
-
|
130
|
-
DRb.start_service
|
131
|
-
proxy = DRbObject.new(nil, "druby://127.0.0.1:9876")
|
132
|
-
proxy.instance.should_not == nil
|
133
|
-
end
|
134
|
-
|
135
|
-
it "should provide the utilities production" do
|
136
|
-
Studio.utilities_production.should_not == nil
|
137
|
-
Studio.utilities_production.name.should == "utilities_production"
|
138
|
-
Studio.utilities_production.should be(Studio.utilities_production)
|
139
|
-
# Studio.utilities_production.close
|
140
|
-
end
|
141
|
-
|
142
|
-
it "should give the same buildin_styles hash twice" do
|
143
|
-
Studio.builtin_styles.should be(Studio.builtin_styles)
|
144
|
-
Studio.builtin_styles["limelight_builtin_players_curtains"].should_not == nil
|
145
|
-
end
|
146
|
-
|
147
|
-
it "should show alert and shutdown if first production fails to open" do
|
148
|
-
utilities = mock("utilities")
|
149
|
-
utilities.should_receive(:alert)
|
150
|
-
Studio.should_receive(:utilities_production).and_return(utilities)
|
151
|
-
Limelight::Context.instance().should_receive(:shutdown)
|
152
|
-
|
153
|
-
Studio.open("http://blah.blah:1234/blah.llp") # will fail
|
154
|
-
sleep(0.1)
|
155
|
-
end
|
156
|
-
|
157
|
-
end
|