Permalink
Browse files

getting ready for a GitHub pull request...

  • Loading branch information...
1 parent 535a23d commit 73deec7bbb08525ab0307b06ae7edd6825cc6c50 Peter Vandenberk committed Jul 16, 2008
Showing with 4 additions and 2 deletions.
  1. +2 −1 defaults/memcached_ctl.default
  2. +2 −1 tasks/memcached.rake
View
3 defaults/memcached_ctl.default
@@ -5,6 +5,7 @@
# it keeps you from having to mess w/ stale memcached daemons for whatever reason.
require 'yaml'
require 'timeout'
+require 'erb'
class MemcachedCtl
attr_accessor :memcached, :memory, :pids, :servers, :ip_address, :ethernet_device
@@ -18,7 +19,7 @@ class MemcachedCtl
self.ip_address = get_ip_address || '0.0.0.0'
self.memory = '128'
- config = YAML.load_file(File.expand_path(File.dirname(__FILE__) + "/../config/memcached.yml"))
+ config = YAML.load(ERB.new(IO.read((File.expand_path(File.dirname(__FILE__) + "/../config/memcached.yml")))).result)
self.servers = [ config['defaults']['servers'] ].flatten rescue ['127.0.0.1:11211']
self.servers = [ config[env]['servers'] ].flatten if config[env]['servers']
self.servers.reject! { |server| host,port = server.split(/:/); self.ip_address == host }
View
3 tasks/memcached.rake
@@ -1,4 +1,5 @@
require 'yaml'
+require 'erb'
namespace :memcached do
desc "Start memcached locally"
@@ -22,7 +23,7 @@ end
def config
return @config if @config
- config = YAML.load_file(File.dirname(__FILE__) + '/../../../../config/memcached.yml')
+ config = YAML.load(ERB.new(IO.read(File.dirname(__FILE__) + '/../../../../config/memcached.yml')).result)
@config = config['defaults'].merge(config['development'])
end

0 comments on commit 73deec7

Please sign in to comment.