On Sun, Jan 24, 2010 at 3:27 PM, Rhett Sutphin <[email protected]>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

Reply via email to