public
Rubygem
Description: A Capistrano extension for managing and running your app on Amazon EC2.
Clone URL: git://github.com/jnewland/capsize.git
caching loads of config files
jnewland (author)
Sat Apr 12 05:52:12 -0700 2008
commit  77a720c0507fc7c7294877732d8a180c5e9cbebe
tree    35c2e2d0c87f31f8b3ef1f0e0f2e82024ef63dca
parent  3ba897febff202ff0adc7af8cd95f420f19c7b75
...
10
11
12
13
14
15
16
17
18
19
 
 
20
21
22
...
10
11
12
 
 
 
 
13
 
 
14
15
16
17
18
0
@@ -10,13 +10,9 @@ module Capsize
0
 
0
     raise Exception if symbol.nil? || symbol.class != Symbol # TODO : Jesse: fixup exceptions in capsize
0
 
0
- # TODO : Jesse : Jesse, you talked about adding a simple caching layer so
0
- # that calls to get() don't have to be avoided since they hit the filesystem
0
- # multiple times per call... Thoughts?
0
-
0
     # populate the OpenStructs with contents of config files so we can query them.
0
- @capsize_config = load_config(:config_file => "#{fetch(:capsize_config_dir)}/#{fetch(:capsize_config_file_name)}")
0
- @secure_config = load_config(:config_file => "#{fetch(:capsize_secure_config_dir)}/#{fetch(:capsize_secure_config_file_name)}")
0
+ @capsize_config ||= load_config(:config_file => "#{fetch(:capsize_config_dir)}/#{fetch(:capsize_config_file_name)}")
0
+ @secure_config ||= load_config(:config_file => "#{fetch(:capsize_secure_config_dir)}/#{fetch(:capsize_secure_config_file_name)}")
0
 
0
     # fetch var from default capsize or default capistrano config vars,
0
     # and if it doesn't exist set it to nil

Comments

    No one has commented yet.