[ap4r-devel] [386] trunk/ap4r/lib/ap4r/queue_manager_ext.rb: Fixed: const_missing error for ERB.

kato-k at rubyforge.org kato-k at rubyforge.org
Wed Feb 6 04:22:48 EST 2008


Revision: 386
Author:   kato-k
Date:     2008-02-06 04:22:47 -0500 (Wed, 06 Feb 2008)

Log Message:
-----------
Fixed: const_missing error for ERB.

Modified Paths:
--------------
    trunk/ap4r/lib/ap4r/queue_manager_ext.rb

Modified: trunk/ap4r/lib/ap4r/queue_manager_ext.rb
===================================================================
--- trunk/ap4r/lib/ap4r/queue_manager_ext.rb	2008-02-06 09:20:00 UTC (rev 385)
+++ trunk/ap4r/lib/ap4r/queue_manager_ext.rb	2008-02-06 09:22:47 UTC (rev 386)
@@ -6,7 +6,7 @@
 require 'yaml'
 require 'thread'
 require 'pp'
-
+require 'erb'
 require 'uuid'
 require 'reliable-msg'
 
@@ -19,21 +19,21 @@
 module ReliableMsg #:nodoc:
 
   # = Dynamic configuration with ERb
-  # 
-  # Some times you would like to inject dynamic values into your configuration file. 
+  #
+  # Some times you would like to inject dynamic values into your configuration file.
   # In these cases, you can mix ERb in with your YAML to code some logic, like:
-  # 
+  #
   # <% acl = [] %>
   # <% for i in 1..100 %>
   # <% acl << "192.168.0.#{i}" %>
-  # <% end %> 
+  # <% end %>
   # acl: <%= acl.map{|ip| "allow #{ip}"}.join(' ')
   #
   class Config
-    
+
     alias :load_no_create_original :load_no_create
     alias :load_or_create_original :load_or_create
-   
+
     #--
     # TODO: should enhance YAML.load_documents instead of this method?, 2007/5/7 kato-k
     def load_no_create
@@ -47,7 +47,7 @@
         true
       end
     end
-    
+
     #--
     # TODO: should enhance YAML.load_documents instead of this method?, 2007/5/7 kato-k
     def load_or_create
@@ -68,13 +68,13 @@
         @logger.info format(INFO_CREATED_CONFIG, @file)
       end
     end
-  
+
     private
     def erb_render(configuration_content)
-      ERB.new(configuration_content).result
+      ::ERB.new(configuration_content).result
     end
   end
-  
+
   class QueueManager
 
     # Gets a queue name which has the most stale message.




More information about the ap4r-devel mailing list