Hello, I was wondering if someone could point me to a smarter way of
the following? It’s probably a Ruby basics question.
I am using ERB to generate sets of configuration files for different
environments. I imagined that I would use a different config file per
environment, that sets variables, and apply this against a list of
configuration file templates.
Currently each environment file defines a module “X” that has constants
MgrPort = ‘3000’
MsgPort2s = ‘4000’
The template files reference the variables like so
domain = <%= X::Domain %>
The script that calls erb.result() uses require/include to reference the
There must be a better way to do this. Is there a “Right Way” here? I’ve
perused the erb docs and the Pickaxe book but neither explicitly join
The information contained in and accompanying this communication is
confidential and intended solely for the use of the intended
If you have received it by mistake please let us know by reply and then
delete it from your system; you should not copy the message or disclose
content to anyone.
MarketAxess reserves the right to monitor the content of emails sent to
from its systems.
Any comments or statements made are not necessarily those of
For more information, please visit www.marketaxess.com. MarketAxess
Limited is regulated in the UK by the FSA, registered in England no.
4017610, registered office at 71 Fenchurch Street, London, EC3M 4BS.
Telephone (020) 7709 3100.
MarketAxess Corporation is regulated in the USA by the SEC and the NASD,
incorporated in Delaware, executive offices at 140 Broadway, New York,
10005. Telephone (1) 212 813 6000.