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
Working on renaming use_distributed_routes to share_routes [#79]
markbates (author)
Wed Aug 06 11:16:30 -0700 2008
commit  d1f8d3cc46fe4d472431b6d44ff0779149985cc2
tree    84cc470f884f9105f645d51ba43f6a7e258b78b0
parent  d14c5b90bb817a15b89928251b5ce993fe60eb7b
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 
0
 # cachetastic_default_options:
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
0
@@ -1,5 +1,17 @@
0
 base = File.join(File.dirname(__FILE__), "mack-distributed")
0
 
0
+config = {
0
+  "mack::share_routes" => false,
0
+  "mack::share_objects" => false,
0
+  "mack::distributed_app_name" => nil,
0
+  "mack::distributed_site_domain" => "http://localhost:3000",
0
+  "mack::drb_timeout" => 0
0
+}
0
+
0
+app_config.load_hash(config, "mack-distributed")
0
+app_config.load_hash(app_config.final_configuration_settings, "original settings")
0
+# app_config.reload
0
+
0
 # load *.rb files
0
 Dir.glob(File.join(base, "**", "*.rb")).each do |f|
0
   load(f)
...
35
36
37
38
 
39
40
41
...
35
36
37
 
38
39
40
41
0
@@ -35,7 +35,7 @@ module Mack
0
 end # Mack
0
 
0
 Mack::Routes.after_class_method(:build) do
0
-  if app_config.mack.use_distributed_routes
0
+  if app_config.mack.share_routes
0
     raise Mack::Distributed::Errors::ApplicationNameUndefined.new if app_config.mack.distributed_app_name.nil?
0
     
0
     d_urls = Mack::Distributed::Routes::Urls.new(app_config.mack.distributed_site_domain)
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 mack::share_objects: true
0
 mack::drb_timeout: 0
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file
...
10
11
12
13
 
14
15
16
...
47
48
49
50
 
51
52
53
...
10
11
12
 
13
14
15
16
...
47
48
49
 
50
51
52
53
0
@@ -10,7 +10,7 @@ describe "droute_url" do
0
       # it's fine to ignore this, it's expected that it's already running.
0
       # all other exceptions should be thrown
0
     end
0
-    app_config.load_hash({"mack::use_distributed_routes" => true, "mack::distributed_app_name" => :known_app}, :distributed_route_test)
0
+    app_config.load_hash({"mack::share_routes" => true, "mack::distributed_app_name" => :known_app}, :distributed_route_test)
0
     Mack::Routes.build do |r| # force the routes to go the DRb server
0
       r.known "/my_known_app/my_known_url", :controller => :foo, :action => :bar
0
       r.known_w_opts "/my_known_app/my_known_url_w_opts/:id", :controller => :foo, :action => :bar
0
@@ -47,7 +47,7 @@ describe "droute_url" do
0
   end
0
   
0
   it "should raise error when d-route is used when not configured as distributed route" do
0
-    temp_app_config("mack::use_distributed_routes" => false) do
0
+    temp_app_config("mack::share_routes" => false) do
0
       droute_url(:known_app, :known_url).should be_nil
0
     end
0
   end
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 
0
 # cachetastic_default_options:
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 
0
 mack::js_framework: prototype
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 
0
 # cachetastic_default_options:
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ foo: bar
0
 
0
 mack::page_cache: true
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
 
0
 # cachetastic_default_options:
...
1
2
3
 
4
5
...
1
2
 
3
4
5
0
@@ -1,4 +1,4 @@
0
 mack::session_id: _my_fake_app_session_id
0
 
0
-mack::use_distributed_routes: false
0
+mack::share_routes: false
0
 mack::distributed_app_name: fake_app
0
\ No newline at end of file

Comments