On 9/01/2006, at 5:33 AM, thila thila wrote:
- Is there anything in Ruby that handles the .properites files
to the J2EE application servers. Or do I need to define all of the
properties as constants?
You can use YAML to load a config file, but constants in
environment.rb are fine for basic configuration. If you have a
complex configuration file you’re probably doing something wrong.
- Is there anyway I can load some of my classes (such as singletons)
during the startup? I am looking for the startup classes that J2EE
You’re thinking in J2EE application server terms. Rails does not
provide an application server, it just processes requests as they
come past. Some state may be maintained in sessions, but there is no
other preserved state.
As for singletons, Ruby classes are objects, use them. You can also
check out the singleton mixin at http://www.ruby-doc.org/stdlib/