buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derrick Schneider <derrick.schnei...@gmail.com>
Subject buildr and boolean properties in profiles.yaml
Date Tue, 23 Mar 2010 00:45:39 GMT
Hey all,

I noticed a non-obvious issue with buildr that may be worth mentioning in
the docs.

I had a profiles.yaml set up as follows:

development:
     enableDailyValueSetter: false

alpha:
    enableDailyValueSetter: true

The idea being that I want a cron job to run on our development server but
not on individual development boxes. (Otherwise the values get set twice if
a developer leaves his/her machine running overnight, and it's not
idempotent.)

Then I used buildr as documented:
   resources.filter.using :enableDailyValueSetter=>
Buildr.settings.profile['enableDailyValueSetter']

That did not cause any change. It took a while to figure out the issue, but
I solved it by using
   resources.filter.using :enableDailyValueSetter=>
Buildr.settings.profile['enableDailyValueSetter'].to_s

My guess is that somewhere in the system, a piece of code says "if
(profileValue) do filter" and of course the "false" was getting evaluated as
boolean false.

I don't think that's incorrect behavior, but it might be worth mentioning in
the docs.

Derrick

-- 
Writer. Programmer. Puzzle Designer.
http://www.obsessionwithfood.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message