public
Description: Fork of DataMapper 0.3 with patches to fix major show-stopping bugs
Clone URL: git://github.com/cardmagic/dm-works.git
STDOUT logging support for environment.rb.

git-svn-id: http://datamapper.rubyforge.org/svn/trunk@723 
b9f95e1d-c398-435d-95f5-378b83d2b11d
ssmoot (author)
Fri Feb 08 09:26:33 -0800 2008
commit  c0e89b97b8322813515a6dcdc7d0afa1323826ad
tree    b6ea5bc2097c0f94a60c97a0aed3accc01af1da7
parent  618189de71bab93c1582b555b8087f8f3c0e6323
...
14
15
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
21
22
23
...
14
15
16
 
 
 
 
17
18
19
20
21
22
23
24
25
26
27
28
29
0
@@ -14,10 +14,16 @@ unless defined?(INITIAL_CLASSES)
0
   require 'fileutils'
0
 
0
   if ENV['LOG_NAME']
0
- FileUtils::mkdir_p(File.dirname(__FILE__) + '/log')
0
- log_path = File.dirname(__FILE__) + "/log/#{ENV['LOG_NAME']}.log"
0
- FileUtils::rm log_path if File.exists?(log_path)
0
-
0
+ log_path = nil
0
+
0
+ if ENV['LOG_NAME'] != 'STDOUT'
0
+ FileUtils::mkdir_p(File.dirname(__FILE__) + '/log')
0
+ log_path = File.dirname(__FILE__) + "/log/#{ENV['LOG_NAME']}.log"
0
+ FileUtils::rm log_path if File.exists?(log_path)
0
+ else
0
+ log_path = 'STDOUT'
0
+ end
0
+
0
     configuration_options.merge!(:log_stream => log_path, :log_level => Logger::DEBUG)
0
   end
0
 
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 #!/usr/bin/env ruby
0
 
0
-ENV['LOG_NAME'] = 'example'
0
+ENV['LOG_NAME'] ||= 'example'
0
 require 'environment'
0
 
0
 # Define a fixtures helper method to load up our test data.

Comments

    No one has commented yet.