public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
moved rspec rake tasks into core.  Added Merb.rakefiles, which is now used by 
Merb::Plugins.rakefiles.  Changed Kernel#use_test to only load dependency 
arguments when Merb.env is nil or test.
benburkert (author)
Mon Mar 03 16:03:11 -0800 2008
commit  6a54e6c391aa01a9223d2b85772c539fa078214b
tree    b09899c164266d93cbc809c7ea882a519ac3ebf1
parent  758a19603ad276a6e95cbaed00bd6b9b4182f0eb
...
216
217
218
219
 
 
 
 
 
220
 
 
 
 
 
 
 
221
222
223
...
216
217
218
 
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
0
@@ -216,8 +216,19 @@ module Merb
0
       Config
0
     end
0
     
0
-  end
0
+    # ==== Returns
0
+    # Array:: All Rakefiles for plugins.
0
+    def rakefiles
0
+      @rakefiles ||= ['merb-core/test/tasks/spectasks']
0
+    end
0
 
0
+    # ==== Parameters
0
+    # *rakefiles:: Rakefiles to add to the list of plugin Rakefiles.
0
+    def add_rakefiles(*rakefiles)
0
+      @rakefiles ||= ['merb-core/test/tasks/spectasks']
0
+      @rakefiles += rakefiles
0
+    end
0
+  end
0
 end
0
 
0
 require 'merb-core/autoload'
...
138
139
140
141
142
 
 
143
144
145
146
147
148
149
150
151
152
153
154
 
155
156
157
...
138
139
140
 
 
141
142
143
144
145
146
147
148
 
 
 
 
 
 
149
150
151
152
0
@@ -138,20 +138,15 @@ module Kernel
0
   #
0
   #   # This will now use the RSpec generator for tests
0
   #   $ ruby script/generate controller MyController
0
-  def use_test(test_framework)
0
-    return unless Merb.env == 'test'
0
+  def use_test(test_framework, *test_dependencies)
0
+    return unless Merb.env == "test" unless Merb.env.nil?
0
     raise "use_test only supports :rspec and :test_unit currently" unless 
0
       [:rspec, :test_unit].include?(test_framework.to_sym)
0
     Merb.generator_scope.delete(:rspec)
0
     Merb.generator_scope.delete(:test_unit)
0
     Merb.generator_scope.push(test_framework.to_sym)
0
     
0
-    begin
0
-      test_plugin = test_framework.to_s.match(/^merb_/) ? test_framework.to_s : "merb_#{test_framework}"
0
-      Kernel.dependency(test_plugin)
0
-    rescue LoadError => e
0
-      Merb.logger.warn("The #{test_plugin} gem was not found.  You may need to install it.")
0
-    end
0
+    dependencies test_dependencies
0
   end
0
   
0
   # ==== Returns
...
10
11
12
13
14
15
16
17
18
 
19
20
21
22
23
24
 
25
26
27
28
...
10
11
12
 
 
13
14
15
 
16
17
18
19
20
21
 
22
23
24
25
26
0
@@ -10,18 +10,16 @@ module Merb
0
       @config ||= File.exists?(Merb.root / "config" / "plugins.yml") ? YAML.load(File.read(Merb.root / "config" / "plugins.yml")) || {} : {}
0
     end
0
     
0
-    @rakefiles = []
0
-
0
     # ==== Returns
0
     # Array:: All Rakefiles for plugins.
0
     def self.rakefiles
0
-      @rakefiles
0
+      Merb.rakefiles
0
     end
0
 
0
     # ==== Parameters
0
     # *rakefiles:: Rakefiles to add to the list of plugin Rakefiles.
0
     def self.add_rakefiles(*rakefiles)
0
-      @rakefiles += rakefiles
0
+      Merb.add_rakefiles *rakefiles
0
     end
0
   end
0
 end
0
\ No newline at end of file

Comments