buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <>
Subject Re: Passing parameters to buildr
Date Thu, 29 May 2008 18:10:02 GMT
On Thu, May 29, 2008 at 6:41 AM, Steve Wall
<> wrote:
> Could it be inferior Operating Systems don't understand case? Read -
> Windoze... Sorry, couldn't resist.

This one feature is actually not part of our hidden agenda to promote
better operating systems all around :-)

Environment variables are unfortunately case sensitive, unfortunate
because if you set Path, all the code that looks up PATH would stop
working.  And this feature doesn't break that, Buildr is still case
sensitive, it understands JAVA_HOME but not Java_Home.

The problem was centered around:

buildr package test=no
buildr package TEST=no

I like the first one better, I don't like the mixed-case command line
arguments, when almost everything is lower case it's easier if
everything is lower case.

But if you want to turn testing off once and for all:

export test=no
export TEST=no

The second one is more appeasing if like me you keep all environment
variables upper case, again just a matter of convention.  So now we
have two cases to worry about.

So for Rake 0.7.x this required some code to make sure we always check
both values, and equal code to test that the code checks both values.
This was mostly a shortcut to get variable names upcased, and only for
those passed on the command line.  Actual environment variables are
not affected.

I think Rake 0.8.x has a better solution, you could do this:

task 'foobar' do |task, args|
  unless args.test == /no/i
    . . .

It will pick the environment variable test, and if not defined, the
environment variable TEST.

Still would require testing both cases, but if you prefer to not touch
the casing of command line arguments passed as environment variables,
we can fix that for 1.3.2.


> On Wed, May 28, 2008 at 7:10 PM, Daniel Spiewak <> wrote:
>> Any particular reason for this?  Seems to me it would be "less surprising"
>> if the ENV['...'] kept the capitalization of the specified parameter.
>> Daniel
>> Assaf Arkin wrote:
>>> On Wed, May 28, 2008 at 7:10 AM, Sergey Konakov<>
>>>  wrote:
>>>> I'm trying to use buildr 1.3 and am having trouble passing parameters to
>>>> the
>>>> buildr script.
>>>> in 1.2.10 i use be able to do:
>>>> buildr build foo=bar
>>>> And then ENV["foo"] would be "bar" when i read it in my script. This
>>>> doesn't
>>>> seem to be the case anymore.
>>>> Is there a new way to pass parameters or am i just missing something?
>>> Look for ENV['FOO'].
>>> The environment name gets capitalized.
>>> Assaf
>>>> Sergey

View raw message