Home > Script > [SOLVED] log4r 1.1.4 & ruby 1.9.1 => GDC.rb and NDC.rb syntax error, unexpected ‘:’, expecting keyword_then or ‘;’ or ‘\n’

[SOLVED] log4r 1.1.4 & ruby 1.9.1 => GDC.rb and NDC.rb syntax error, unexpected ‘:’, expecting keyword_then or ‘;’ or ‘\n’

January 31st, 2010

EDIT: SOLVED , vedere commento :D

log4r 1.1.4 & ruby 1.9.1 => GDC.rb and NDC.rb syntax error, unexpected ‘:’, expecting keyword_then or ‘;’ or ‘\n’

GDC.rb

1
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
--- GDC.rb	Thu Jan 28 17:03:12 2010
 
+++ GDC.rb.new	Thu Jan 28 16:50:37 2010
 
@@ -13,10 +13,10 @@
 
     private_class_method :new
 
 
 
     def self.check_thread_instance()
 
-      if ( Thread.main != Thread.current ):
 
+      if ( Thread.main != Thread.current )
 
 	raise "Can only initialize Global Diagnostic Context from Thread.main" 
 
       else
 
-	if ( Thread.main[GDCNAME] == nil ):
 
+	if ( Thread.main[GDCNAME] == nil )
 
 	  Thread.main[GDCNAME] = $0
 
 	end
 
       end

line 19
repalce
if ( Thread.main[GDCNAME] == nil ):
with
if ( Thread.main[GDCNAME] == nil )

NDC.rb

1
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
--- NDC.rb	Thu Jan 28 17:03:09 2010
 
+++ NDC.rb.new	Thu Jan 28 16:51:35 2010
 
@@ -15,7 +15,7 @@
 
     private_class_method :new
 
 
 
     def self.check_thread_instance()
 
-      if ( Thread.current[NDCNAME] == nil ):
 
+      if ( Thread.current[NDCNAME] == nil )
 
 	Thread.current[NDCNAME] = Array.new
 
 	Thread.current[NDCNAMEMAXDEPTH] = NDCDEFAULTMAXDEPTH
 
       end
 
@@ -65,7 +65,7 @@
 
 
 
     def self.push( value )
 
       self.check_thread_instance()
 
-      if ( Thread.current[NDCNAME].length < Thread.current[NDCNAMEMAXDEPTH] ):		
 
+      if ( Thread.current[NDCNAME].length < Thread.current[NDCNAMEMAXDEPTH] )
 
 	Thread.current[NDCNAME].push( value )
 
       end
 
     end

WaYdotNET Script , , , ,

blog comments powered by Disqus