public
Description: All the extra stuff you could want for the Mack Framework.
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack-more.git
Finished renaming use_distributed_routes to share_routes [#79 state:resolved]
markbates (author)
Wed Aug 06 12:56:49 -0700 2008
commit  96e33b3960ec4ecbda89345afff128e33e7c05aa
tree    5486c53d4014adfc5ee4d10dda78e72847be5dd5
parent  c8e93fc4ae67fa03c5a444fb0395ac3ff6d2569e
...
8
9
10
11
12
13
14
...
8
9
10
 
11
12
13
0
@@ -8,7 +8,6 @@ config = {
0
   "mack::drb_timeout" => 0
0
 }
0
 app_config.load_hash(config.merge(app_config.final_configuration_settings), "mack-distributed")
0
-# app_config.reload
0
 
0
 # load *.rb files
0
 Dir.glob(File.join(base, "**", "*.rb")).each do |f|
...
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
33
34
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
37
38
0
@@ -33,51 +33,6 @@ module Mack
0
     end # Routes
0
   end # Distributed
0
   
0
-  module Routes # :nodoc:
0
-    module Urls
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.share_routes
0
-          d_urls = Mack::Distributed::Routes::Urls.get(app_name)
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
-        else
0
-          return nil
0
-        end
0
-      end # droute_url
0
-    end # Urls
0
-    
0
-    class RouteMap
0
-      alias_method :normal_connect_with_named_route, :connect_with_named_route
0
-      
0
-      def connect_with_named_route(n_route, pattern, options = {})
0
-        n_route = n_route.methodize
0
-        normal_connect_with_named_route(n_route, pattern, options)
0
-        if app_config.mack.share_routes
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 # connect_with_named_route
0
-      
0
-    end # RouteMap
0
-    
0
-  end # Routes
0
-  
0
 end # Mack
0
 
0
 Mack::Routes.after_class_method(:build) do

Comments