You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Les Hartzman <lh...@gmail.com> on 2015/07/09 18:53:31 UTC

New to Groovy - question on code in documentation

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



Re: New to Groovy - question on code in documentation

Posted by Les Hartzman <lh...@gmail.com>.
Thanks! I’ll go read that part of the docs.

> On Jul 9, 2015, at 10:06 AM, Cédric Champeau <ce...@gmail.com> wrote:
> 
> Not in that context :) But in the context of the FileTreeBuilder, it is!
> 
> See http://docs.groovy-lang.org/2.4.4-SNAPSHOT/html/documentation/#_filetreebuilder <http://docs.groovy-lang.org/2.4.4-SNAPSHOT/html/documentation/#_filetreebuilder>
> 
> 
> 2015-07-09 19:03 GMT+02:00 Les Hartzman <lhartzman@gmail.com <ma...@gmail.com>>:
> 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 <ma...@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 <ma...@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
>> 
>> 
>> 
> 
> 


Re: New to Groovy - question on code in documentation

Posted by Cédric Champeau <ce...@gmail.com>.
Not in that context :) But in the context of the FileTreeBuilder, it is!

See
http://docs.groovy-lang.org/2.4.4-SNAPSHOT/html/documentation/#_filetreebuilder


2015-07-09 19:03 GMT+02:00 Les Hartzman <lh...@gmail.com>:

> 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 <ce...@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
>
> 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 <lh...@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
>>
>>
>>
>>
>
>

Re: New to Groovy - question on code in documentation

Posted by Les Hartzman <lh...@gmail.com>.
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 <ce...@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 <ma...@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
> 
> 
> 


Re: New to Groovy - question on code in documentation

Posted by Cédric Champeau <ce...@gmail.com>.
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

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 <lh...@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
>
>
>
>

Re: New to Groovy - question on code in documentation

Posted by Les Hartzman <lh...@gmail.com>.
Still too new to the group. But you might want to do it yourself just to capture the fix in the system.

I read the link you sent. I thought that might have been what was intended, but since groovysh was throwing an error, I wasn’t sure.

Thanks again!

Les

> On Jul 9, 2015, at 10:35 AM, Cédric Champeau <ce...@gmail.com> wrote:
> 
> In case you were tempted at making a PR, I already fixed it ;)
> 
> 2015-07-09 19:15 GMT+02:00 Les Hartzman <lhartzman@gmail.com <ma...@gmail.com>>:
> The error code is in the GDK documentation under “Working with I/O” in section 1.5 “Executing External Processes”.
> 
>> On Jul 9, 2015, at 10:11 AM, Owen Rubel <orubel@gmail.com <ma...@gmail.com>> wrote:
>> 
>> can you point me to where this code exists in documentation?
>> 
>> Owen Rubel
>> 415-971-0976
>> orubel@gmail.com <ma...@gmail.com>
>> On Thu, Jul 9, 2015 at 9:53 AM, Les Hartzman <lhartzman@gmail.com <ma...@gmail.com>> wrote:
>> 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
>> 
>> 
>> 
> 
> 


Re: New to Groovy - question on code in documentation

Posted by Cédric Champeau <ce...@gmail.com>.
In case you were tempted at making a PR, I already fixed it ;)

2015-07-09 19:15 GMT+02:00 Les Hartzman <lh...@gmail.com>:

> The error code is in the GDK documentation under “Working with I/O” in
> section 1.5 “Executing External Processes”.
>
> On Jul 9, 2015, at 10:11 AM, Owen Rubel <or...@gmail.com> wrote:
>
> can you point me to where this code exists in documentation?
>
> Owen Rubel
> 415-971-0976
> orubel@gmail.com
>
> On Thu, Jul 9, 2015 at 9:53 AM, Les Hartzman <lh...@gmail.com> wrote:
>
>> 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
>>
>>
>>
>>
>
>

Re: New to Groovy - question on code in documentation

Posted by Les Hartzman <lh...@gmail.com>.
The error code is in the GDK documentation under “Working with I/O” in section 1.5 “Executing External Processes”.

> On Jul 9, 2015, at 10:11 AM, Owen Rubel <or...@gmail.com> wrote:
> 
> can you point me to where this code exists in documentation?
> 
> Owen Rubel
> 415-971-0976
> orubel@gmail.com <ma...@gmail.com>
> On Thu, Jul 9, 2015 at 9:53 AM, Les Hartzman <lhartzman@gmail.com <ma...@gmail.com>> wrote:
> 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
> 
> 
> 


Re: New to Groovy - question on code in documentation

Posted by Owen Rubel <or...@gmail.com>.
can you point me to where this code exists in documentation?

Owen Rubel
415-971-0976
orubel@gmail.com

On Thu, Jul 9, 2015 at 9:53 AM, Les Hartzman <lh...@gmail.com> wrote:

> 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
>
>
>
>