buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <alex.boisv...@gmail.com>
Subject Re: Variables in YAML
Date Mon, 25 Jan 2010 00:10:13 GMT
On Sun, Jan 24, 2010 at 3:27 PM, Rhett Sutphin <rhett@detailedbalance.net>wrote:

> Hi Alex,
>
> On Jan 24, 2010, at 1:33 PM, Alex Boisvert wrote:
>
> > On many occasions I've been wanting to write a build.yml such as,
> >
> > scala.version: 2.8.0.Beta1-RC8-SNAPSHOT
> >
> > scala.test: 1.0.1-for-scala-#{scala.version}
> > scala.check: 1.7-for-scala-#{scala.version}
> >
> > but YAML's support for variable/references is pretty basic and doesn't
> allow
> > to compose/templatize values like this.  As far as I understand, you can
> > only declare a reference (&ref) and reuse its value as-is later on
> (*ref).
> >
> > Any suggestions on how we could/should do this?  I would really prefer to
> > keep these contants out of my buildfile.
> >
>
> One option would be to have build.yml evaluated with ERB before it is
> parsed as YAML.  Then you could do something like
>
> <%
>  scala_version = '2.8.0.Beta1-RC8-SNAPSHOT'
> %>
>
> scala.test: 1.0.1-for-scala-<%= scala_version %>
> scala.check: 1.7-for-scala-<%= scala_version %>
>

I like that idea...

alex

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