Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby application session parameters

Reply
Thread Tools

Ruby application session parameters

 
 
Thomas D'andrea jr.
Guest
Posts: n/a
 
      02-17-2009
I am trying to create multiple applications that perform different
processes on our servers. The important aspect is that I want to
somehow put into a session or configuration file data from all of these
applications so we can manage the sessions from one place.

Example if XML:

<session>
<app id="test1">
<user>user1</user>
<pass>pass1</pass>
<err>false</err>
<email address="">true</email>
</app>
<app id="test2">
<user>user2</user>
<pass>pass2</pass>
<err>false</err>
<email address="">true</email>
</app>
</session>

I have also tried this:
<conf.rb>
if $CURRPROC == 'test1'
@conf = {
'id' => 'test1',
'user' => 'user1',
'pass' => 'pass1',
'err' => 'false'
}
end

if $CURRPROC == 'test2'
@conf = {
'id' => 'test2',
'user' => 'user2',
'pass' => 'pass2',
'err' => 'false'
}
end

<app.rb>
$CURRPROC = 'test1'
require 'config.rb'

puts @conf['id']
puts @conf['log']

This seems to work to read, but I am not sure if this is what I should
be doing because it seems hard to change a single value and write it
back out to the file. In this case, if an error occurred during
processing, I want to change the 'err' value to 'true' so that future
processing could take that into account when that process was run. I've
just had a heck of at time getting to parse XML and read/write
correctly, or getting the ruby code to save easily with small changes.
Other examples I looked up are good for a single configuration file for
a single application, but I am trying to have a central configuration
file for multiple applications. Any suggestions are appreciated of
course.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session state has created a session id, but cannot save it because the response was already flushed by the application ganeshd@gmail.com ASP .Net 3 08-17-2007 04:33 AM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Servlet parameters different from the command line parameters? Jonck van der Kogel Java 2 05-26-2004 11:34 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57