GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
Removed test helper rake_task it was more trouble than it was worth.
markbates (author)
Tue Sep 02 12:49:57 -0700 2008
commit  b5658258917ba8e9b5bd49d795c0cbac696a8f16
tree    ab28064977a2538bb9946849ca94aea5276762d2
parent  f6f79da908c8ebca10a9c08d07788dc2db696796
...
 
1
2
3
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
+puts caller.inspect
0
 namespace :gems do
0
   
0
   desc "lists all the gem required for this application."
...
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
...
19
20
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
23
24
0
@@ -19,43 +19,6 @@ module Mack
0
   module Testing # :nodoc:
0
     module Helpers
0
     
0
- # Runs the given rake task. Takes an optional hash that mimics command line parameters.
0
- def rake_task(name, env = {}, tasks = [])
0
- # set up the Rake application
0
- rake = Rake::Application.new
0
- Rake.application = rake
0
- require 'rake'
0
- require 'rake/testtask'
0
- require 'rake/rdoctask'
0
- [Dir.glob(File.join(File.dirname(__FILE__), "..", "tasks", "*.rake")), tasks].flatten.each do |task|
0
- load(task)
0
- end
0
-
0
- # save the old ENV so we can revert it
0
- old_env = ENV.to_hash
0
- # add in the new ENV stuff
0
- env.each_pair {|k,v| ENV[k.to_s] = v}
0
-
0
- begin
0
- # run the rake task
0
- rake[name].invoke
0
-
0
- # yield for the tests
0
- yield if block_given?
0
-
0
- rescue Exception => e
0
- raise e
0
- ensure
0
- # empty out the ENV
0
- ENV.clear
0
- # revert to the ENV before the test started
0
- old_env.to_hash.each_pair {|k,v| ENV[k] = v}
0
-
0
- # get rid of the Rake application
0
- Rake.application = nil
0
- end
0
- end
0
-
0
       # Temporarily changes the application configuration. Changes are reverted after
0
       # the yield returns.
0
       def temp_app_config(options = {})

Comments

    No one has commented yet.