From: ara.t.howard@... Date: 2006-10-06T23:05:05+09:00 Subject: Re: Using configuration files (replacing shellscripts) On Fri, 6 Oct 2006, Trans wrote: >> Is is possible to reduce the redundancy of >> >> ,---- >> | basedir: /this/directory >> | logdir: /this/directory/log >> `---- >> >> to something like that? >> >> ,---- >> | basedir: /this/directory >> | logdir: $basedir/log >> `---- >> >> I have to use this in the configs quite often. harp:~ > cat a.rb # this would come from file conf = <<'conf' basedir "/this/directory" logdir "#{ basedir }/log" conf require 'traits' class Config < OpenTraits def initialize(conf) instance_eval conf end end config = Config.new conf p config.basedir p config.logdir harp:~ > ruby a.rb "/this/directory" "/this/directory/log" -a -- in order to be effective truth must penetrate like an arrow - and that is likely to hurt. -- wei wu wei