groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hartzman <lhartz...@gmail.com>
Subject Re: New to Groovy - question on code in documentation
Date Thu, 09 Jul 2015 17:03:19 GMT
Glad I could help! :-)

So that syntax on the assignment to ‘file’ is not legal?

> On Jul 9, 2015, at 10:00 AM, Cédric Champeau <cedric.champeau@gmail.com> wrote:
> 
> Oh, that's a good catch. this shouldn't appear in the docs. It's a side effect of an
unclosed tag in our test files:
> 
> https://github.com/melix/groovy-core/blob/bf8c4b54863ddf045760fb55db60c098a8df3616/src/spec/test/gdk/WorkingWithIOSpecTest.groovy#L313-323
<https://github.com/melix/groovy-core/blob/bf8c4b54863ddf045760fb55db60c098a8df3616/src/spec/test/gdk/WorkingWithIOSpecTest.groovy#L313-323>
> 
> The end:: tag doesn't correspond to the opening tag::, so asciidoctor scrambled the output.
Will fix it!
> 
> 
> 
> 2015-07-09 18:53 GMT+02:00 Les Hartzman <lhartzman@gmail.com <mailto:lhartzman@gmail.com>>:
> Hi,
> 
> As the subject says, I’ve just gotten started with learning Groovy and have been going
through the documentation.
> 
> There is some code in the section on files that is not explained. If someone could clarify
that, it would be great:
> 
>  doInTmpDir { b ->
>                 File file = null
>                 def tmpDir = b.tmp {
>                     file = 'foo.tmp'('foo')
>             }
> What does ‘foo.tmp’(‘foo’) do?
> I tried to put this into groovysh but it complained:  No signature of method: groovysh_evaluate.foo.tmp()
is applicable for argument types: (java.lang.String) values: [foo]
> 
> Thanks in advance.
> Les
> 
> 
> 


Mime
View raw message