[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

portable script deployment

greg

10/4/2006 1:45:00 AM

I am trying to deploy several ruby scripts in a unix environment. My
goal is to avoid as much as possible any hard-coding of dependencies or
any modifications to scripts to work in the environment and maintain
easy portability to another server unix environment.
Each script will need to load some paths and register an exit routine.
This is what I am thinking of doing right now.
A user will execute the script ./foo or ./bar
Paths specific to this project/deployment should be added, and an exit
routine for this project should be registered.

/foo -> launcher.rb
/bar -> launcher.rb
/lib/foo.rb
/lib/bar.rb

launcher.rb:
# add paths for this project
ENV['PATH'] = ...
# register exit routine to log script execution
at_exit{logging_routine... }
# figure out what script called launcher.rb through $0
require "#{File.split(File.expand_path($0)).join('/lib/')}.rb"
# execute script
main()

So the only requirement that I would make of the script is that it have
a main() routine. It even allows the removal of a shebang. Everything
that needs to be hard-coded would be left to the launcher script. This
approach requires a launcher for each language so that only one
interpreter needs to be spawned to execute one script. Initially, all
scripts would be placed in the ./lib directory, and a rake task would
create needed soft links.

Do you think this is a good system? Is there a better way to accomplish
this?

Thanks,
Greg Weber


1 Answer

dechucka

10/10/2012 9:53:00 PM

0


"ALP FauxBook" <gmsmerkoff@carbon.tax.is.ineffective> wrote in message
news:k533p7$h87$2@dont-email.me...
> On 10/10/2012 3:16 PM, Farm1 wrote:
>> "dechucka" <dechucka1@hotmail.com> wrote in message
>> news:B_OdnR3wZfdvBunNnZ2dnUVZ_uednZ2d@westnet.com.au...
>>> Sad to see her going at the next election she was a moderate voice in
>>> the
>>> > increasingly hard right Liberal Party. Her comments were right on
>>> the
>>> mark
>>> http://www.smh.com.au/opinion/political-news/coalition-slipping-to-right-says-senator-20121008-...
>>
>> Sadly she's not the only good one who is leaving or has already left the
>> Coalition. I really wish Costello had stayed.
>>
>
> A good thing - if she quotes that idiot,

You think Costello's an idiot?