How to read the first line of content from a Playground?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to read the first line of content from a Playground?

philippeback
In the old workspace it was possible to ask for the first line of contents (to show it in a list).

With a playground it seems harder... Lots of entries in there.

Is there any short way to get that done?

TIA
Phil
Reply | Threaded
Open this post in threaded view
|

Re: How to read the first line of content from a Playground?

EstebanLM

> On 21 Sep 2015, at 21:54, [hidden email] wrote:
>
> In the old workspace it was possible to ask for the first line of contents (to show it in a list).

the first line of contents of what? can you share a snippet so I can understand your problem?

cheers!
Esteban

>
> With a playground it seems harder... Lots of entries in there.
>
> Is there any short way to get that done?
>
> TIA
> Phil


Reply | Threaded
Open this post in threaded view
|

Re: How to read the first line of content from a Playground?

philippeback

Like Workspace allInstances collect: [:w | w contents ].

Nothing like that in GTPlayground.

Phil

On Mon, Sep 21, 2015 at 11:02 PM, Esteban Lorenzano <[hidden email]> wrote:

> On 21 Sep 2015, at 21:54, [hidden email] wrote:
>
> In the old workspace it was possible to ask for the first line of contents (to show it in a list).

the first line of contents of what? can you share a snippet so I can understand your problem?

cheers!
Esteban

>
> With a playground it seems harder... Lots of entries in there.
>
> Is there any short way to get that done?
>
> TIA
> Phil




Reply | Threaded
Open this post in threaded view
|

Re: How to read the first line of content from a Playground?

EstebanLM
Best way: 

'play-cache' asFileReference inspect.

Equivalent to what you want:

'play-cache' asFileReference allFiles 
collect: [ :each | each readStreamDo: #contents  ]


Esteban

On 29 Sep 2015, at 16:30, [hidden email] wrote:


Like Workspace allInstances collect: [:w | w contents ].

Nothing like that in GTPlayground.

Phil

On Mon, Sep 21, 2015 at 11:02 PM, Esteban Lorenzano <[hidden email]> wrote:

> On 21 Sep 2015, at 21:54, [hidden email] wrote:
>
> In the old workspace it was possible to ask for the first line of contents (to show it in a list).

the first line of contents of what? can you share a snippet so I can understand your problem?

cheers!
Esteban

>
> With a playground it seems harder... Lots of entries in there.
>
> Is there any short way to get that done?
>
> TIA
> Phil