limelight 0.4.0-java → 0.5.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/limelight.jar +0 -0
- data/lib/limelight/animation.rb +4 -3
- data/lib/limelight/builtin/players.rb +3 -1
- data/lib/limelight/builtin/players/image.rb +4 -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/utilities_production/alert/players/alert.rb +11 -0
- data/lib/limelight/builtin/utilities_production/alert/props.rb +3 -0
- data/lib/limelight/builtin/utilities_production/alert/styles.rb +7 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/props.rb +3 -0
- data/lib/limelight/builtin/utilities_production/incompatible_version/styles.rb +3 -0
- data/lib/limelight/builtin/utilities_production/production.rb +3 -0
- data/lib/limelight/builtin/utilities_production/stages.rb +3 -0
- data/lib/limelight/builtin/utilities_production/styles.rb +3 -0
- data/lib/limelight/casting_director.rb +1 -1
- data/lib/limelight/commands/create_command.rb +33 -19
- data/lib/limelight/commands/freeze_command.rb +20 -5
- data/lib/limelight/commands/open_command.rb +2 -1
- data/lib/limelight/dsl/styles_builder.rb +40 -18
- data/lib/limelight/file_loader.rb +1 -1
- data/lib/limelight/gems.rb +3 -1
- data/lib/limelight/java_couplings.rb +1 -0
- data/lib/limelight/producer.rb +4 -47
- data/lib/limelight/production.rb +20 -0
- data/lib/limelight/prop.rb +32 -32
- data/lib/limelight/scene.rb +2 -1
- data/lib/limelight/specs/spec_helper.rb +24 -22
- data/lib/limelight/specs/test_scene_opener.rb +60 -0
- data/lib/limelight/string.rb +1 -1
- data/lib/limelight/studio.rb +28 -9
- data/lib/limelight/templates/production_templater.rb +5 -2
- data/lib/limelight/templates/scene_templater.rb +7 -6
- data/lib/limelight/templates/sources/production/production.rb.template +1 -1
- data/lib/limelight/templates/sources/production/spec/spec_helper.rb.template +8 -1
- data/lib/limelight/version.rb +1 -1
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/props.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/default_scene/styles.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/production.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/default_scene/default_scene_spec.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/spec/spec_helper.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/stages.rb +3 -0
- data/productions/examples/sandbox/alerts/incompatible_production/styles.rb +3 -0
- data/productions/examples/sandbox/alerts/players/alerts.rb +3 -0
- data/productions/examples/sandbox/alerts/props.rb +3 -0
- data/productions/examples/sandbox/alerts/styles.rb +3 -0
- data/productions/examples/sandbox/background_images/props.rb +3 -0
- data/productions/examples/sandbox/header.rb +1 -0
- data/productions/examples/sandbox/images_scene/props.rb +8 -0
- data/productions/examples/sandbox/kiosk/players/kiosk.rb +3 -0
- data/productions/examples/sandbox/kiosk/props.rb +3 -0
- data/productions/examples/sandbox/kiosk/styles.rb +3 -0
- data/productions/examples/sandbox/spec/alerts/alerts_spec.rb +3 -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/playbills.lll +1 -0
- data/productions/startup/production.rb +3 -0
- data/productions/startup/spec/default_scene/default_scene_spec.rb +3 -0
- data/productions/startup/spec/spec_helper.rb +3 -0
- data/productions/startup/styles.rb +3 -0
- data/spec/{builtin → limelight/builtin}/players/button_spec.rb +1 -1
- data/spec/{builtin → limelight/builtin}/players/check_box_spec.rb +1 -1
- data/spec/{builtin → limelight/builtin}/players/combo_box_spec.rb +1 -1
- data/spec/{builtin → limelight/builtin}/players/image_spec.rb +1 -2
- data/spec/{builtin → limelight/builtin}/players/password_box_spec.rb +1 -1
- data/spec/{builtin → limelight/builtin}/players/radio_button_spec.rb +1 -1
- data/spec/limelight/builtin/players/stage_mover_spec.rb +36 -0
- data/spec/limelight/builtin/players/stage_sizer_spec.rb +40 -0
- data/spec/{builtin → limelight/builtin}/players/text_area_spec.rb +1 -1
- data/spec/{builtin → limelight/builtin}/players/text_box_spec.rb +1 -1
- data/spec/limelight/builtin/utilities_production/spec_helper.rb +7 -0
- data/spec/{builtin → limelight/builtin}/utilities_production/utilities_production_spec.rb +3 -0
- data/spec/{casting_director_spec.rb → limelight/casting_director_spec.rb} +1 -1
- data/spec/{client → limelight/client}/playbills_spec.rb +1 -1
- data/spec/{commands → limelight/commands}/command_spec.rb +1 -1
- data/spec/{commands → limelight/commands}/create_command_spec.rb +23 -19
- data/spec/limelight/commands/freeze_command_spec.rb +143 -0
- data/spec/{commands → limelight/commands}/help_command_spec.rb +1 -1
- data/spec/{commands → limelight/commands}/open_command_spec.rb +1 -1
- data/spec/{commands → limelight/commands}/pack_command_spec.rb +1 -1
- data/spec/{commands → limelight/commands}/unpack_command_spec.rb +1 -1
- data/spec/{data_spec.rb → limelight/data_spec.rb} +1 -1
- data/spec/{dsl → limelight/dsl}/prop_builder_spec.rb +1 -1
- data/spec/{dsl → limelight/dsl}/stage_builder_spec.rb +1 -1
- data/spec/{dsl → limelight/dsl}/styles_builder_spec.rb +52 -13
- data/spec/{file_chooser_spec.rb → limelight/file_chooser_spec.rb} +1 -1
- data/spec/{file_filter_spec.rb → limelight/file_filter_spec.rb} +1 -1
- data/spec/{file_loader_spec.rb → limelight/file_loader_spec.rb} +1 -1
- data/spec/{gems_spec.rb → limelight/gems_spec.rb} +10 -4
- data/spec/{java_util_spec.rb → limelight/java_util_spec.rb} +1 -1
- data/spec/{main_spec.rb → limelight/main_spec.rb} +1 -1
- data/spec/{paint_action_spec.rb → limelight/paint_action_spec.rb} +1 -1
- data/spec/{pen_spec.rb → limelight/pen_spec.rb} +1 -1
- data/spec/{producer_spec.rb → limelight/producer_spec.rb} +4 -12
- data/spec/{production_spec.rb → limelight/production_spec.rb} +32 -11
- data/spec/{prop_spec.rb → limelight/prop_spec.rb} +30 -2
- data/spec/{scene_spec.rb → limelight/scene_spec.rb} +28 -2
- data/spec/{stage_spec.rb → limelight/stage_spec.rb} +1 -1
- data/spec/{string_spec.rb → limelight/string_spec.rb} +1 -1
- data/spec/{studio_spec.rb → limelight/studio_spec.rb} +16 -1
- data/spec/{styles_spec.rb → limelight/styles_spec.rb} +1 -1
- data/spec/{templates → limelight/templates}/production_templater_spec.rb +17 -6
- data/spec/{templates → limelight/templates}/scene_templater_spec.rb +15 -4
- data/spec/{templates → limelight/templates}/templater_logger_spec.rb +1 -1
- data/spec/{templates → limelight/templates}/templater_spec.rb +1 -1
- data/spec/{theater_spec.rb → limelight/theater_spec.rb} +1 -1
- data/spec/{util → limelight/util}/downloader_spec.rb +1 -1
- data/spec/spec_helper.rb +11 -0
- metadata +62 -70
- data/lib/limelight/dsl/production_builder.rb +0 -71
- data/spec/builtin/utilities_production/spec_helper.rb +0 -4
- data/spec/commands/freeze_command_spec.rb +0 -62
- data/spec/dsl/production_builder_spec.rb +0 -46
@@ -0,0 +1,36 @@
|
|
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/scene'
|
6
|
+
require 'limelight/prop'
|
7
|
+
require 'limelight/builtin/players/stage_mover'
|
8
|
+
require 'limelight/stage'
|
9
|
+
|
10
|
+
describe Limelight::Builtin::Players::StageMover do
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
@stage = Limelight::Stage.new(nil, "stage name")
|
14
|
+
@scene = Limelight::Scene.new
|
15
|
+
@scene.stage = @stage
|
16
|
+
@prop = Limelight::Prop.new()
|
17
|
+
@scene.add(@prop)
|
18
|
+
@prop.include_player(Limelight::Builtin::Players::StageMover)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should respond to the right mouse events" do
|
22
|
+
methods = Limelight::Builtin::Players::StageMover.instance_methods
|
23
|
+
methods.include?("mouse_pressed").should == true
|
24
|
+
methods.include?("mouse_dragged").should == true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should change the stage location when dragged" do
|
28
|
+
@stage.frame.setLocation(0, 0)
|
29
|
+
@prop.mouse_pressed(MouseEvent.new(100, 100))
|
30
|
+
@prop.mouse_dragged(MouseEvent.new(125, 150))
|
31
|
+
|
32
|
+
@stage.frame.location.x.should == 25
|
33
|
+
@stage.frame.location.y.should == 50
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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/scene'
|
6
|
+
require 'limelight/prop'
|
7
|
+
require 'limelight/builtin/players/stage_sizer'
|
8
|
+
require 'limelight/stage'
|
9
|
+
|
10
|
+
describe Limelight::Builtin::Players::StageSizer do
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
@stage = Limelight::Stage.new(nil, "stage name")
|
14
|
+
@scene = Limelight::Scene.new
|
15
|
+
@scene.stage = @stage
|
16
|
+
@prop = Limelight::Prop.new()
|
17
|
+
@scene.add(@prop)
|
18
|
+
@prop.include_player(Limelight::Builtin::Players::StageSizer)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should respond to the right mouse events" do
|
22
|
+
methods = Limelight::Builtin::Players::StageSizer.instance_methods
|
23
|
+
methods.include?("mouse_pressed").should == true
|
24
|
+
methods.include?("mouse_dragged").should == true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should change the stage dimension when dragged" do
|
28
|
+
@stage.frame.setSize(500, 500)
|
29
|
+
@prop.mouse_pressed(MouseEvent.new(100, 100))
|
30
|
+
@prop.mouse_dragged(MouseEvent.new(125, 150))
|
31
|
+
|
32
|
+
@stage.frame.size.width.should == 525
|
33
|
+
@stage.frame.size.height.should == 550
|
34
|
+
|
35
|
+
@prop.mouse_dragged(MouseEvent.new(150, 175))
|
36
|
+
@stage.frame.size.width.should == 550
|
37
|
+
@stage.frame.size.height.should == 575
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
|
5
5
|
require 'limelight/prop'
|
6
6
|
require 'limelight/builtin/players/text_area'
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
|
5
5
|
require 'limelight/prop'
|
6
6
|
require 'limelight/builtin/players/text_box'
|
7
7
|
|
@@ -0,0 +1,7 @@
|
|
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/specs/spec_helper'
|
6
|
+
|
7
|
+
$PRODUCTION_PATH = File.join($LIMELIGHT_LIB, 'limelight', 'builtin', 'utilities_production')
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
5
5
|
require 'limelight/casting_director'
|
6
6
|
require 'limelight/dsl/prop_builder'
|
7
7
|
require 'limelight/production'
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/client/playbills'
|
6
6
|
|
7
7
|
describe Limelight::Client::Playbills do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/command'
|
6
6
|
|
7
7
|
describe Limelight::Commands::Command do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/create_command'
|
6
6
|
require 'limelight/templates/production_templater'
|
7
7
|
require 'limelight/templates/scene_templater'
|
@@ -24,9 +24,9 @@ describe Limelight::Commands::CreateCommand do
|
|
24
24
|
|
25
25
|
it "should create a production" do
|
26
26
|
production_templater = make_mock("production_templater")
|
27
|
-
Limelight::Templates::ProductionTemplater.should_receive(:new).
|
27
|
+
Limelight::Templates::ProductionTemplater.should_receive(:new).and_return(production_templater)
|
28
28
|
scene_templater = make_mock("scene_templater")
|
29
|
-
Limelight::Templates::SceneTemplater.should_receive(:new).
|
29
|
+
Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
|
30
30
|
production_templater.should_receive(:generate)
|
31
31
|
scene_templater.should_receive(:generate)
|
32
32
|
|
@@ -36,21 +36,12 @@ describe Limelight::Commands::CreateCommand do
|
|
36
36
|
it "should create a scene" do
|
37
37
|
Limelight::Templates::ProductionTemplater.should_not_receive(:new)
|
38
38
|
scene_templater = make_mock("scene_templater")
|
39
|
-
Limelight::Templates::SceneTemplater.should_receive(:new).
|
39
|
+
Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
|
40
40
|
scene_templater.should_receive(:generate)
|
41
41
|
|
42
42
|
@command.run(["scene", "prod/some_scene"])
|
43
43
|
end
|
44
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
|
-
|
54
45
|
it "should print useage on invalid template type" do
|
55
46
|
@command.should_receive(:parse_error).at_least(:once)
|
56
47
|
|
@@ -63,12 +54,13 @@ describe Limelight::Commands::CreateCommand do
|
|
63
54
|
@command.run(["production"])
|
64
55
|
end
|
65
56
|
|
66
|
-
it "should have a default
|
57
|
+
it "should have a default options name" do
|
67
58
|
@command.parse ["production", "blah"]
|
68
59
|
|
69
60
|
@command.scene_name.should == "default_scene"
|
70
61
|
@command.template_type.should == "production"
|
71
|
-
@command.
|
62
|
+
@command.production_path.should == "blah"
|
63
|
+
@command.spec_path.should == "blah/spec"
|
72
64
|
end
|
73
65
|
|
74
66
|
it "should have a default production path" do
|
@@ -81,24 +73,36 @@ describe Limelight::Commands::CreateCommand do
|
|
81
73
|
@command.parse ["-s", "scene_name", "production", "blah"]
|
82
74
|
@command.scene_name.should == "scene_name"
|
83
75
|
@command.template_type.should == "production"
|
84
|
-
@command.
|
76
|
+
@command.production_path.should == "blah"
|
85
77
|
|
86
78
|
@command.parse ["--scene=another_scene", "production", "blah"]
|
87
79
|
@command.scene_name.should == "another_scene"
|
88
80
|
@command.template_type.should == "production"
|
89
|
-
@command.
|
81
|
+
@command.production_path.should == "blah"
|
90
82
|
end
|
91
83
|
|
92
84
|
it "should parse a production path option" do
|
93
85
|
@command.parse ["-p", "prod_path", "scene", "blah"]
|
94
86
|
@command.production_path.should == "prod_path"
|
95
87
|
@command.template_type.should == "scene"
|
96
|
-
@command.
|
88
|
+
@command.scene_name.should == "blah"
|
97
89
|
|
98
90
|
@command.parse ["--production_path=prody_path", "scene", "blah"]
|
99
91
|
@command.production_path.should == "prody_path"
|
100
92
|
@command.template_type.should == "scene"
|
101
|
-
@command.
|
93
|
+
@command.scene_name.should == "blah"
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should parse spec root option" do
|
97
|
+
@command.parse ["-S", "spec_path", "production", "blah"]
|
98
|
+
@command.template_type.should == "production"
|
99
|
+
@command.production_path.should == "blah"
|
100
|
+
@command.spec_path.should == "spec_path"
|
101
|
+
|
102
|
+
@command.parse ["--spec_path=another_spec_path", "production", "blah"]
|
103
|
+
@command.template_type.should == "production"
|
104
|
+
@command.production_path.should == "blah"
|
105
|
+
@command.spec_path.should == "another_spec_path"
|
102
106
|
end
|
103
107
|
|
104
108
|
end
|
@@ -0,0 +1,143 @@
|
|
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/commands/freeze_command'
|
6
|
+
|
7
|
+
describe Limelight::Commands::FreezeCommand do
|
8
|
+
|
9
|
+
before(:all) do
|
10
|
+
@command_class = Limelight::Commands::FreezeCommand
|
11
|
+
@command = @command_class.new
|
12
|
+
end
|
13
|
+
|
14
|
+
before(:each) do
|
15
|
+
@command = @command_class.new
|
16
|
+
@command.instance_eval("def usage(e=nil); raise 'Usage called! ' + e; end;")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should be listed" do
|
20
|
+
Limelight::Commands::LISTING["freeze"].should == @command_class
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should parse no options" do
|
24
|
+
@command.parse ["some_gem"]
|
25
|
+
|
26
|
+
@command.gem_name.should == "some_gem"
|
27
|
+
@command.production_path.should == "."
|
28
|
+
@command.gem_version.should == nil
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should parse production path option" do
|
32
|
+
@command.parse ["-p", "prod/path", "some_gem"]
|
33
|
+
@command.gem_name.should == "some_gem"
|
34
|
+
@command.production_path.should == "prod/path"
|
35
|
+
|
36
|
+
@command.parse ["--production=prod/path2", "some_gem"]
|
37
|
+
@command.gem_name.should == "some_gem"
|
38
|
+
@command.production_path.should == "prod/path2"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should parse version option" do
|
42
|
+
@command.parse ["-v", "1.2.3", "some_gem"]
|
43
|
+
@command.gem_name.should == "some_gem"
|
44
|
+
@command.gem_version.should == "1.2.3"
|
45
|
+
|
46
|
+
@command.parse ["--version=3.2.1", "some_gem"]
|
47
|
+
@command.gem_name.should == "some_gem"
|
48
|
+
@command.gem_version.should == "3.2.1"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should check if it's a gem file" do
|
52
|
+
@command.is_gem_file?("some.gem").should == true
|
53
|
+
@command.is_gem_file?("some-java_0.2.1.gem").should == true
|
54
|
+
@command.is_gem_file?("/some.gem").should == true
|
55
|
+
@command.is_gem_file?("/dir/dir2/some.gem").should == true
|
56
|
+
@command.is_gem_file?("../dir/dir2/some.gem").should == true
|
57
|
+
|
58
|
+
@command.is_gem_file?("some_gem").should == false
|
59
|
+
@command.is_gem_file?("some_gem-java.0.3.1").should == false
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "Actual Freezing" do
|
63
|
+
|
64
|
+
before(:each) do
|
65
|
+
@gem_name = 'MicahGem'
|
66
|
+
@gem_name_and_version = "#{@gem_name}-1.0"
|
67
|
+
@project_dir = 'prod/path'
|
68
|
+
stub_limelight_production
|
69
|
+
stub_gem_cache
|
70
|
+
stub_unpacking_gem
|
71
|
+
stub_establishing_gem_dir
|
72
|
+
stub_templater
|
73
|
+
stub_gem_installer
|
74
|
+
FileUtils.stub!(:copy)
|
75
|
+
Gem.stub!(:dir).and_return("PATH")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should create the specifications directory" do
|
79
|
+
File.stub!(:exists?).with(path_to_gemspec).and_return(false)
|
80
|
+
|
81
|
+
@templater.should_receive(:directory).with(File.join("__resources", "gems", "specifications"))
|
82
|
+
|
83
|
+
@command.run ["-p", @project_dir, @gem_name]
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should copy the spec file from the Gem path" do
|
87
|
+
File.stub!(:exists?).with(path_to_gemspec).and_return(true)
|
88
|
+
|
89
|
+
FileUtils.should_receive(:copy).with(path_to_gemspec,
|
90
|
+
File.join(@project_dir, "__resources", "gems", "specifications"))
|
91
|
+
|
92
|
+
@command.run ["-p", @project_dir, @gem_name]
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should not copy the spec file if there isn't one" do
|
96
|
+
File.stub!(:exists?).with(path_to_gemspec).and_return(false)
|
97
|
+
|
98
|
+
FileUtils.should_not_receive(:copy)
|
99
|
+
|
100
|
+
@command.run ["-p", @project_dir, @gem_name]
|
101
|
+
end
|
102
|
+
|
103
|
+
def path_to_gemspec
|
104
|
+
return File.join(Gem.dir, "specifications", "#{@gem_name_and_version}.gemspec")
|
105
|
+
end
|
106
|
+
|
107
|
+
def stub_limelight_production
|
108
|
+
require 'limelight/util'
|
109
|
+
|
110
|
+
Limelight::Util.stub!(:is_limelight_production?).and_return(true)
|
111
|
+
Limelight::Util.stub!(:is_limelight_scene?).and_return(true)
|
112
|
+
end
|
113
|
+
|
114
|
+
def stub_unpacking_gem
|
115
|
+
require 'rubygems/commands/unpack_command'
|
116
|
+
|
117
|
+
unpack_command = mock(Gem::Commands::UnpackCommand, :get_path => "#{@gem_name_and_version}.gem")
|
118
|
+
Gem::Commands::UnpackCommand.stub!(:new).and_return(unpack_command)
|
119
|
+
File.stub!(:exists?).with("#{@gem_name_and_version}.gem").and_return(true)
|
120
|
+
end
|
121
|
+
|
122
|
+
def stub_gem_cache
|
123
|
+
mock_gem = mock(Gem, :version => mock("Version", :version => "1.0", :to_s => "1.0"), :name => @gem_name, :require_paths => nil)
|
124
|
+
Gem.stub!(:cache).and_return(mock("Cache", :find_name => [mock_gem]))
|
125
|
+
end
|
126
|
+
|
127
|
+
def stub_establishing_gem_dir
|
128
|
+
File.stub!(:exists?).with(File.join(@project_dir, "__resources", "gems", "gems", @gem_name_and_version)).and_return(false)
|
129
|
+
end
|
130
|
+
|
131
|
+
def stub_templater
|
132
|
+
require 'limelight/templates/templater'
|
133
|
+
|
134
|
+
logger = mock("Logger", :log => nil)
|
135
|
+
@templater = mock("Templater", :file => nil, :directory => nil, :logger => logger)
|
136
|
+
Limelight::Templates::Templater.stub!(:new).and_return(@templater)
|
137
|
+
end
|
138
|
+
|
139
|
+
def stub_gem_installer
|
140
|
+
Gem::Installer.stub!(:new).and_return(mock(Gem::Installer, :unpack => nil))
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/help_command'
|
6
6
|
|
7
7
|
describe Limelight::Commands::HelpCommand do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/open_command'
|
6
6
|
require 'limelight/producer'
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/pack_command'
|
6
6
|
|
7
7
|
describe Limelight::Commands::PackCommand do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/commands/unpack_command'
|
6
6
|
|
7
7
|
describe Limelight::Commands::UnpackCommand do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
5
5
|
require 'limelight/data'
|
6
6
|
|
7
7
|
describe Limelight::Data do
|
@@ -1,7 +1,7 @@
|
|
1
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
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
5
5
|
require 'limelight/dsl/prop_builder'
|
6
6
|
|
7
7
|
describe Limelight::DSL::PropBuilder do
|