public
Description: Desert is a component framework for Rails that allows your plugins have a Rails app like directory structure, routes, migrations, and dependencies.
Homepage: http://desert.rubyforge.org
Clone URL: git://github.com/pivotal/desert.git
ActionView::TemplateFinder#initialize processes its view paths for Rails 2.1.0.
Damon McCormick & Brian Takita (author)
Thu Jul 17 15:18:00 -0700 2008
commit  093f7dd1f71efd74a75c0f4e4554f03043ea224a
tree    ce7cdade48f17631bddfb7de530c2d841f3f95c2
parent  477ff6677f99ba55bd998fd7b5ba810c243b40f5
...
1
2
3
 
4
5
6
...
1
2
3
4
5
6
7
0
@@ -1,6 +1,7 @@
0
 module ActionView #:nodoc:
0
   class TemplateFinder #:nodoc:
0
     def initialize_with_desert_plugins(*args)
0
+      self.class.process_view_paths(*args)
0
       initialize_without_desert_plugins *args
0
 
0
       Desert::Manager.plugins.reverse.each do |plugin|
...
2
3
4
5
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
 
 
 
 
 
 
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
57
58
59
60
61
...
2
3
4
 
5
6
7
8
 
9
10
11
12
 
 
 
 
13
 
 
 
 
 
14
15
16
17
18
19
20
21
 
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
 
54
0
@@ -2,60 +2,53 @@ require File.expand_path("#{File.dirname(__FILE__)}/../../../spec_helper")
0
 
0
 unless Desert::VersionChecker.rails_version_is_below_1990?
0
   module Rails
0
-    describe Plugin, :shared => true do
0
+    describe Plugin do
0
       it_should_behave_like "Desert::Manager fixture"
0
 
0
       before do
0
-        @configuration = Configuration.new
0
         @plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/aa_depends_on_acts_as_spiffy")
0
         @configuration = Configuration.new
0
         @initializer = Rails::Initializer.new(@configuration)
0
       end
0
-    end
0
-
0
-    describe Plugin, "#require_plugin" do
0
-      it_should_behave_like "Rails::Plugin"
0
 
0
-      it "raises error when passed a plugin that doesn't exist" do
0
-        @plugin.load(@initializer)
0
-        lambda do
0
-          @plugin.require_plugin "i_dont_exist"
0
-        end.should raise_error(RuntimeError, "Plugin 'i_dont_exist' does not exist")
0
+      describe "#require_plugin" do
0
+        it "raises error when passed a plugin that doesn't exist" do
0
+          @plugin.load(@initializer)
0
+          lambda do
0
+            @plugin.require_plugin "i_dont_exist"
0
+          end.should raise_error(RuntimeError, "Plugin 'i_dont_exist' does not exist")
0
+        end
0
       end
0
-    end
0
 
0
-    describe Plugin, "#load, when representing aa_depends_on_acts_as_spiffy" do
0
-      it_should_behave_like "Rails::Plugin"
0
-
0
-      it "evals init.rb which requires plugin dependencies and registers the plugin itself" do
0
-        mock.proxy(@plugin).require_plugin('acts_as_spiffy')
0
-        @plugin.load(@initializer)
0
-        Desert::Manager.plugins.should == [
0
-          Desert::Manager.find_plugin('the_grand_poobah'),
0
-            Desert::Manager.find_plugin('acts_as_spiffy'),
0
-            Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
-        ]
0
-      end
0
-
0
-      it "does not load an already-loaded plugin twice" do
0
-        already_loaded_plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/acts_as_spiffy")
0
-        already_loaded_plugin.load(@initializer)
0
-
0
-        Desert::Manager.plugins.should == [
0
-          Desert::Manager.find_plugin('the_grand_poobah'),
0
-            Desert::Manager.find_plugin('acts_as_spiffy')
0
-        ]
0
-
0
-        @plugin.load(@initializer)
0
-
0
-        Desert::Manager.plugins.should == [
0
-          Desert::Manager.find_plugin('the_grand_poobah'),
0
-            Desert::Manager.find_plugin('acts_as_spiffy'),
0
-            Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
-        ]
0
+      describe "#load, when representing aa_depends_on_acts_as_spiffy" do
0
+        it "evals init.rb which requires plugin dependencies and registers the plugin itself" do
0
+          mock.proxy(@plugin).require_plugin('acts_as_spiffy')
0
+          @plugin.load(@initializer)
0
+          Desert::Manager.plugins.should == [
0
+            Desert::Manager.find_plugin('the_grand_poobah'),
0
+              Desert::Manager.find_plugin('acts_as_spiffy'),
0
+              Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
+          ]
0
+        end
0
+
0
+        it "does not load an already-loaded plugin twice" do
0
+          already_loaded_plugin = Rails::Plugin.new("#{RAILS_ROOT}/vendor/plugins/acts_as_spiffy")
0
+          already_loaded_plugin.load(@initializer)
0
+
0
+          Desert::Manager.plugins.should == [
0
+            Desert::Manager.find_plugin('the_grand_poobah'),
0
+              Desert::Manager.find_plugin('acts_as_spiffy')
0
+          ]
0
+
0
+          @plugin.load(@initializer)
0
+
0
+          Desert::Manager.plugins.should == [
0
+            Desert::Manager.find_plugin('the_grand_poobah'),
0
+              Desert::Manager.find_plugin('acts_as_spiffy'),
0
+              Desert::Manager.find_plugin('aa_depends_on_acts_as_spiffy'),
0
+          ]
0
+        end
0
       end
0
     end
0
   end
0
-
0
-
0
 end

Comments