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 the last, I hope, of the distributed code from Mack. [#8]
markbates (author)
Wed Aug 06 12:31:24 -0700 2008
commit  1ebc213b46acb34085bab506b13b623eed08443a
tree    d14a9a574c97381453d1e205e9b035423ac47be8
parent  b019c553d4a6275449e2bdb31c639fa81a65ecf4
...
134
135
136
 
137
138
139
...
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
...
134
135
136
137
138
139
140
...
247
248
249
 
 
 
 
 
 
 
 
 
250
251
252
0
@@ -134,6 +134,7 @@ module Mack
0
     # If A HollyCrapError is thrown it will be caught and rendered using the OopsController and the 500 action.
0
     # You can catch all exceptions using Exception.
0
     class RouteMap
0
+      include Extlib::Hook
0
       include Singleton
0
       
0
       def initialize # :nodoc:
0
@@ -246,15 +247,6 @@ module Mack
0
         }
0
         
0
         Mack::Routes::Urls.class_eval(url)
0
-        
0
-        if app_config.mack.use_distributed_routes
0
-          
0
-          Mack::Routes::Urls.class_eval %{
0
-            def #{n_route}_distributed_url(options = {})
0
-              (@dsd || app_config.mack.distributed_site_domain) + #{n_route}_url(options)
0
-            end
0
-          }
0
-        end
0
       end
0
       
0
       def regex_from_pattern(pattern)
...
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
58
59
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
62
63
64
0
@@ -58,46 +58,6 @@ module Mack
0
         }
0
       end
0
       
0
-      # Retrieves a distributed route from a DRb server.
0
-      # 
0
-      # Example:
0
-      #   droute_url(:app_1, :home_page_url)
0
-      #   droute_url(:registration_app, :signup_url, {:from => :google})
0
-      def droute_url(app_name, route_name, options = {})
0
-        if app_config.mack.use_distributed_routes
0
-          d_urls = Mack::Distributed::Routes::Urls.get(app_name)
0
-          # return d_urls.send(route_name, options)
0
-          # ivar_cache("droute_url_hash") do
0
-          #   {}
0
-          # end
0
-          # d_urls = @droute_url_hash[app_name.to_sym]
0
-          # if d_urls.nil?
0
-          #   d_urls = Mack::Distributed::Routes::UrlCache.get(app_name.to_sym)
0
-          #   @droute_url_hash[app_name.to_sym] = d_urls
0
-          #   if d_urls.nil?
0
-          #     raise Mack::Distributed::Errors::UnknownApplication.new(app_name)
0
-          #   end
0
-          # end
0
-          route_name = route_name.to_s
0
-          if route_name.match(/_url$/)
0
-            unless route_name.match(/_distributed_url$/)
0
-              route_name.gsub!("_url", "_distributed_url")
0
-            end
0
-          else
0
-            route_name << "_distributed_url"
0
-          end
0
-          raise Mack::Distributed::Errors::UnknownRouteName.new(app_name, route_name) unless d_urls.respond_to?(route_name)
0
-          return d_urls.run(route_name, options)
0
-          # if d_urls.run.respond_to?(route_name)
0
-          #   return d_urls.run.send(route_name, options)
0
-          # else
0
-          #   raise Mack::Distributed::Errors::UnknownRouteName.new(app_name, route_name)
0
-          # end
0
-        else
0
-          return nil
0
-        end
0
-      end # droute_url
0
-    
0
     end # Urls
0
   end # Routes
0
 end # Mack 
0
\ No newline at end of file

Comments