[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

The Ruby/ERB way to do this?

Peter Booth

7/27/2006 2:51:00 PM

Hello, I was wondering if someone could point me to a smarter way of doing
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 for
each variable:
module X
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
config file

require "Configs/stagingProperties"
include X


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
dots.
----------------------------------------------------------------------------
----------------------------------------

The information contained in and accompanying this communication is strictly
confidential and intended solely for the use of the intended recipient(s).
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 its
content to anyone.
MarketAxess reserves the right to monitor the content of emails sent to or
from its systems.
Any comments or statements made are not necessarily those of MarketAxess.
For more information, please visit www.marketaxess.com. MarketAxess Europe
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, NY
10005. Telephone (1) 212 813 6000.


37 Answers

Professor Bubba

8/12/2010 2:42:00 AM

0

In article
<15152be2-11dc-4a82-8bea-37820a9938ac@i19g2000pro.googlegroups.com>,
Walter Harding <gopartyanimal@gmail.com> wrote:

> On Aug 11, 6:19?pm, denni...@dennism3.invalid (Dennis M) wrote:
> > In article <xn0gyalc3dpesk...@news.x-privat.org>, "Knifefight Afterdance"
> >
> > <switchblade1...@aol.com> wrote:
> > >I'm not sure how long Keith Olbermann has been trying to get a foothold
> > >into primetime cable news. He has failed.
> >
> > >Total viewers - 8/10/10
> > >Bill O'Reilly - 3,104,000
> > >Keith Olbermann - 1,104,000
> >
> > I think it's safe to assume whatever audience he's losing isn't O'Reilly's
> > gain.
>
> I wouldn't be so sure about that. There's a bunch of lefties who are
> seeing the light.


Dream on.

Professor Bubba

8/12/2010 1:30:00 PM

0

In article
<71d0c25d-d4d6-4516-94d7-ae01bd1a5608@l25g2000prn.googlegroups.com>,
Walter Harding <gopartyanimal@gmail.com> wrote:

> On Aug 11, 7:42?pm, Professor Bubba <bu...@nowhere.edu.invalid> wrote:
> > In article
> > <15152be2-11dc-4a82-8bea-37820a993...@i19g2000pro.googlegroups.com>,
> >
> >
> >
> > Walter Harding <gopartyani...@gmail.com> wrote:
> > > On Aug 11, 6:19?pm, denni...@dennism3.invalid (Dennis M) wrote:
> > > > In article <xn0gyalc3dpesk...@news.x-privat.org>, "Knifefight
> > > > Afterdance"
> >
> > > > <switchblade1...@aol.com> wrote:
> > > > >I'm not sure how long Keith Olbermann has been trying to get a foothold
> > > > >into primetime cable news. He has failed.
> >
> > > > >Total viewers - 8/10/10
> > > > >Bill O'Reilly - 3,104,000
> > > > >Keith Olbermann - 1,104,000
> >
> > > > I think it's safe to assume whatever audience he's losing isn't
> > > > O'Reilly's
> > > > gain.
> >
> > > I wouldn't be so sure about that. ?There's a bunch of lefties who are
> > > seeing the light.
> >
> > Dream on.
>
> You really believe that Americans are just accept Obama's coming
> stagflation with a timid smile? You're out of your fucking mind.


I really believe you're delusional, yes. And I'm not the one who's out
of his fucking mind if he thinks a proper concern about the economy
equals "a bunch of lefties who are seeing the light." So, yes, do
dream on.

Obiter

8/13/2010 3:02:00 PM

0

On Thu, 12 Aug 2010 17:01:07 -0700 (PDT), Walter Harding
<gopartyanimal@gmail.com> wrote:

>How are you guys going to campaign when Democart are afraid to talk to
>their constitutes? When they're boycotting Townhall meetings?

Because it's NOT "their" constituents, WalterLoon

It's the madhatter Tea-whackoffs that come to disrupt and prevent any
discussion.

Obiter

8/13/2010 3:05:00 PM

0

On Thu, 12 Aug 2010 22:27:33 -0700 (PDT), Walter Harding
<gopartyanimal@gmail.com> wrote:

>
>
>Obi...@dicta.net wrote:
>> On Thu, 12 Aug 2010 11:57:49 -0700 (PDT), Walter Harding
>> <gopartyanimal@gmail.com> wrote:
>>
>> >On Aug 12, 7:35?am, Obi...@Dicta.net wrote:
>> >> On Thu, 12 Aug 2010 05:04:12 -0700 (PDT), Walter Harding
>> >>
>> >> <gopartyani...@gmail.com> wrote:
>> >> >> > I wouldn't be so sure about that. ?There's a bunch of lefties who are
>> >> >> > seeing the light.
>> >>
>> >> >> Dream on.
>> >>
>> >> >You really believe that Americans are just accept Obama's coming
>> >> >stagflation with a timid smile? ?You're out of your fucking mind.
>> >>
>> >> First of all it ain't Obamas anything---your hero, deserter, liar,
>> >> drunk and coke addict Bush was responsible
>> >
>> >Yes, yes, we understand. You once had so much fun trashing President
>> >Bush, and suddenly nobody cares about your lies and scandals anymore.
>> >It's frustrating.
>>
>> But the core of what I just said----you can't rebut.
>>
>> >> And a big percentage of "negatives" of Obama come from the "left" for
>> >> giving in to republicans----but does not translate into any known vote
>> >> for those who caused this mess in the first place.
>> >
>> >In some cases, that translates into liberals sitting home on election
>> >day,
>>
>> Wow----verbatim from TownHall, FreePubic and every rightwing moron
>> propaganda site in between
>
>Wow -- verbatim attacks used by the mind numbed leftist zombies for
>the past twenty years.
>
>Town Hall, Free Republic, FOX News and Talk Radio accurately predicted
>America under Obama.

They "accurately predicted" that Republicans would be sitting in a
deep shit hole they dug for themselves?

Good.

Walter Harding

8/13/2010 4:54:00 PM

0



Obi...@dicta.net wrote:
> On Thu, 12 Aug 2010 16:33:44 -0700 (PDT), Walter Harding
> <gopartyanimal@gmail.com> wrote:
>
> >> Try taking out the 12-15% of the left who don't "approve" of Obama
> >> based on his pandering to rightwing republicans
> >
> >According to a recent Gallup Poll, "the left" consists of 20% of the
> >country.
>
> Nonsense

http://www.gallup.com/poll/123854/Conservatives-Maintain-Edge-Top-Ideological-G...

Conservatives Maintain Edge as Top Ideological Group
Compared with 2008, more Americans "conservative" in general, and on
issues
by Lydia Saad

PRINCETON, NJ -- Conservatives continue to outnumber moderates and
liberals in the American populace in 2009, confirming a finding that
Gallup first noted in June. Forty percent of Americans describe their
political views as conservative, 36% as moderate, and 20% as liberal.
This marks a shift from 2005 through 2008, when moderates were tied
with conservatives as the most prevalent group.

> Any credible, rational person would know that both the right and left
> are about evenly split at about 40% each

Nope. Why do you think Obama is so desperate to hide the fact that
he's a socialist?

> The "middle" is where elections are won.

Yeah, about that - the Democrats have lost the middle, too.

> True---the more base that stays home---the more you have to pick up in
> the middle. Hence the adage: "primaries run to the base---Elections
> run to the middle"

And the Democrats are losing both.

> The percentage you're citing is the "far" portion of the Political
> party.

The Democrats are now run by the far left extremists. There are no
moderate Democrats left. The era of Bill Clinton's New Democrat is
dead, and they took prosperity with them.

Walter Harding

8/13/2010 5:00:00 PM

0



Obi...@dicta.net wrote:
> On Thu, 12 Aug 2010 17:01:07 -0700 (PDT), Walter Harding
> <gopartyanimal@gmail.com> wrote:
>
> >How are you guys going to campaign when Democart are afraid to talk to
> >their constitutes? When they're boycotting Townhall meetings?
>
> Because it's NOT "their" constituents, WalterLoon

> It's the madhatter Tea-whackoffs that come to disrupt and prevent any
> discussion.

Ah, yes. They "disrupt:" townhall meetings by showing up and, er,
asking questions. Some even talk back and make eye contact. Don't
they know that they're supposed to show up, oooo and ahhhhhh at the
Democrat's genius, and applaud gratefully? No wonder Congressman
start btichslapping people who ask questions.

Walter Harding

8/13/2010 5:06:00 PM

0



Obi...@dicta.net wrote:
> On Thu, 12 Aug 2010 22:27:33 -0700 (PDT), Walter Harding
> <gopartyanimal@gmail.com> wrote:
>
> >
> >
> >Obi...@dicta.net wrote:
> >> On Thu, 12 Aug 2010 11:57:49 -0700 (PDT), Walter Harding
> >> <gopartyanimal@gmail.com> wrote:
> >>
> >> >On Aug 12, 7:35?am, Obi...@Dicta.net wrote:
> >> >> On Thu, 12 Aug 2010 05:04:12 -0700 (PDT), Walter Harding
> >> >>
> >> >> <gopartyani...@gmail.com> wrote:
> >> >> >> > I wouldn't be so sure about that. ?There's a bunch of lefties who are
> >> >> >> > seeing the light.
> >> >>
> >> >> >> Dream on.
> >> >>
> >> >> >You really believe that Americans are just accept Obama's coming
> >> >> >stagflation with a timid smile? ?You're out of your fucking mind.
> >> >>
> >> >> First of all it ain't Obamas anything---your hero, deserter, liar,
> >> >> drunk and coke addict Bush was responsible
> >> >
> >> >Yes, yes, we understand. You once had so much fun trashing President
> >> >Bush, and suddenly nobody cares about your lies and scandals anymore.
> >> >It's frustrating.
> >>
> >> But the core of what I just said----you can't rebut.
> >>
> >> >> And a big percentage of "negatives" of Obama come from the "left" for
> >> >> giving in to republicans----but does not translate into any known vote
> >> >> for those who caused this mess in the first place.
> >> >
> >> >In some cases, that translates into liberals sitting home on election
> >> >day,
> >>
> >> Wow----verbatim from TownHall, FreePubic and every rightwing moron
> >> propaganda site in between
> >
> >Wow -- verbatim attacks used by the mind numbed leftist zombies for
> >the past twenty years.
> >
> >Town Hall, Free Republic, FOX News and Talk Radio accurately predicted
> >America under Obama.
>
> They "accurately predicted" that

The Stimulus Bill would actually destroy jobs, rather than create
them.

That Gitmo would not be closed down.

That we wouldn't pull out of Iraq.

That unemployment would skyrocket.

That the deficit would skyrocket.

That Obama is incomplete.

> Republicans would be sitting in a
> deep shit hole they dug for themselves?

You've got two and a half months to continue to gloat. Nov is right
around the corner. Tick....tick....tick.....

By the way, California Senator Barbara Boxer is now down by five.
Nice.


Walter Harding

8/13/2010 5:34:00 PM

0


Professor Bubba wrote:
> In article
> <64a00c3f-6274-466c-839d-d36982483d91@k17g2000prf.googlegroups.com>,
> Walter Harding <gopartyanimal@gmail.com> wrote:
>
> > Professor Bubba wrote:
> > > In article
> > > <65c9d3e9-6e51-4b69-86cd-32260ad50a11@t5g2000prd.googlegroups.com>,
> > > Walter Harding <gopartyanimal@gmail.com> wrote:
> > >
> > > > You DO know that Obama's approval numbers have hit 41%, don't you?
> > > > That even Gallup has stated that Repulbicans enjoy a 6 point advantage
> > > > over the Democrats in the Congressional poll - and they skew their
> > > > numbers to the left.
> >
> > > I also know it's mid-August and that the campaign hasn't even really
> > > begun yet.
> >
> > How are you guys going to campaign when Democart are afraid to talk to
> > their constitutes? When they're boycotting Townhall meetings?
> >
> > .What are they going to say when asked asked what we got for our
> > Stimulus Dollar? Vague mutterings that it would have been even worse
> > without it? In case you haven't noticed, the economy sucks moose
> > dick while the Democarts are blathering their version of "prosperity
> > is just around the corner.".
> >
> > > I also know that polls that don't focus on the chances of
> > > specific candidates running against each other aren't worth very much.
> >
> > True, we're talking about nearly three hundred separate races - but
> > there's no question that the rising tide of discontent will cost you
> > seats.
>
> It's a by-election. Of course the party in power is going to lose
> seats. That almost always happens.
>
> > > Gallup says the country is discontented. Well, duh.
> >
> > DISCONTENTED???? They're heating up the tar and feather, pig biting
> > mad.
>
> Yes, there's lots of noise. No substance, just noise.

The most interesting noise will be the quiet tumble of levels in the
polling booths in 11 weeks.

> > > However, I don't know what the economic news will be like by October
> > > and you don't, either. It might be better, it might be worse.
> >
> > Oooooooooooooooooooooooooo so you're counting on a magical, utterly
> > unexpected 180 degree turn around in the US economy in the next few
> > weeks.
>
> Sure, because that's exactly what "better" means. Retard.

Do you know what "just ain't gonna happen" means? The economy isn't
going to turn around in the next few weeks. The Democrats have
screwed everything up, but good.

And now you get to run on your record.

> > Uhhhhhhhhhhhhhhhhh - yeah. Sure. It could happen. (snicker) No
> > really. (STAGE WHISPER I can't believe this idiot.) You go count on
> > that.
>
> Go ahead, misstate what I said and then go nuts. That is, after all,
> the Teabagger Way.

What "mistate(ment)"? You implied there's a chance the economy could
suddenly do a massive, and utterly unexpected, recovery - just in time
to rescue the Democrast. I ridiculed your clinging to straws. Sorry,
nothing I wrote was unfair.

> > > I do
> > > know that the economic news was so bad by October 2008 that the country
> > > justifiably sneered at the choice presented by the GOP and put a young
> > > black Democrat in the big chair.
> >
> > And then things got much, much, MUCH worse.
>
> The hell they did.
>
> > > I'll bet a lot of you thought you
> > > were going to win that one, too.
> >
> > ......you DO know that you guys are in the position the Republicans
> > were in in 2006 and 2008 - only worse, don't you?
>
> No, not at all.

Nooooooooooooooooooooo - not at all. Everything's terrific. Why, the
Democrats are BELOVED by all. Look at how the people adore their
beloved leaders....

http://www.youtube.com/watch?v=v...

> You seem to know the way you want things to be, but
> you don't seem aware of the way they actually are.

And everything is delightful in prosperity land, right?

trotsky

8/13/2010 9:52:00 PM

0

On 8/13/10 12:33 PM, Walter Harding wrote:
>
> Professor Bubba wrote:
>> In article
>> <64a00c3f-6274-466c-839d-d36982483d91@k17g2000prf.googlegroups.com>,
>> Walter Harding<gopartyanimal@gmail.com> wrote:
>>
>>> Professor Bubba wrote:
>>>> In article
>>>> <65c9d3e9-6e51-4b69-86cd-32260ad50a11@t5g2000prd.googlegroups.com>,
>>>> Walter Harding<gopartyanimal@gmail.com> wrote:
>>>>
>>>>> You DO know that Obama's approval numbers have hit 41%, don't you?
>>>>> That even Gallup has stated that Repulbicans enjoy a 6 point advantage
>>>>> over the Democrats in the Congressional poll - and they skew their
>>>>> numbers to the left.
>>>
>>>> I also know it's mid-August and that the campaign hasn't even really
>>>> begun yet.
>>>
>>> How are you guys going to campaign when Democart are afraid to talk to
>>> their constitutes? When they're boycotting Townhall meetings?
>>>
>>> .What are they going to say when asked asked what we got for our
>>> Stimulus Dollar? Vague mutterings that it would have been even worse
>>> without it? In case you haven't noticed, the economy sucks moose
>>> dick while the Democarts are blathering their version of "prosperity
>>> is just around the corner.".
>>>
>>>> I also know that polls that don't focus on the chances of
>>>> specific candidates running against each other aren't worth very much.
>>>
>>> True, we're talking about nearly three hundred separate races - but
>>> there's no question that the rising tide of discontent will cost you
>>> seats.
>>
>> It's a by-election. Of course the party in power is going to lose
>> seats. That almost always happens.
>>
>>>> Gallup says the country is discontented. Well, duh.
>>>
>>> DISCONTENTED???? They're heating up the tar and feather, pig biting
>>> mad.
>>
>> Yes, there's lots of noise. No substance, just noise.
>
> The most interesting noise will be the quiet tumble of levels in the
> polling booths in 11 weeks.
>
>>>> However, I don't know what the economic news will be like by October
>>>> and you don't, either. It might be better, it might be worse.
>>>
>>> Oooooooooooooooooooooooooo so you're counting on a magical, utterly
>>> unexpected 180 degree turn around in the US economy in the next few
>>> weeks.
>>
>> Sure, because that's exactly what "better" means. Retard.
>
> Do you know what "just ain't gonna happen" means? The economy isn't
> going to turn around in the next few weeks. The Democrats have
> screwed everything up, but good.


Because they didn't repeal the Bush tax cuts right away, you mean?

Siobhan Medeiros

8/14/2010 1:33:00 AM

0

On Aug 11, 7:19 pm, Walter Harding <gopartyani...@gmail.com> wrote:
> On Aug 11, 6:19 pm, denni...@dennism3.invalid (Dennis M) wrote:
>
> > In article <xn0gyalc3dpesk...@news.x-privat.org>, "Knifefight Afterdance"
>
> > <switchblade1...@aol.com> wrote:
> > >I'm not sure how long Keith Olbermann has been trying to get a foothold
> > >into primetime cable news. He has failed.
>
> > >Total viewers - 8/10/10
> > >Bill O'Reilly - 3,104,000
> > >Keith Olbermann - 1,104,000
>
> > I think it's safe to assume whatever audience he's losing isn't O'Reilly's gain.
>
> I wouldn't be so sure about that.  There's a bunch of lefties who are
> seeing the light.

Yeah, right. That's why educated and intelligent people tend to be
liberals.