Metacello: getting more info on a project

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

Metacello: getting more info on a project

GLASS mailing list
Hello,

I often have questions, such as 'which groups does project X define'. I
wonder what are nice ways for me to find out programmatically.

I can, for example do:

(Metacello new
   configuration:  'Seaside3' ;
   repository: 'http://www.squeaksource.com/MetacelloRepository';
   get)

.. and then ask that project stuff, such as its map of versions etc.

What I'd also like to do is to know which groups a project defines, and
what packages are in those groups. How do I do this in code starting
from (potentially) nothing in my image?


Regards
- Iwan


--

Reahl, the Python only web framework / www.reahl.org
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Metacello: getting more info on a project

GLASS mailing list
Iwan,

Right now there is no API for asking these questions programmatically
... Personally I simply read the baseline spec to find the answers to
these questions ... In practice that once you know what groups there are
you will want to know what packages are in the group and of course the
answer to all of these questions is that it depends up upon a lot of
different information (what platform and platform version or you
interested in ... and so on)...

It may be that a combination of reading the baseline and using the
`record` command you can extract the information you are looking for.
The following command works on a baseline (in this case Metacello) that
is already present in the image:

   Metacello image
     baseline: 'Metacello';
     ignoreImage;                "ignore the state of the current image"
     onWarningLog;             "log Warnings -- as opposed to prompting
the user"
     record: 'Core'                "use different group names to see
what happens"

and if you print the result you will something that looks like the
following:

    linear load :
     linear load : baseline [BaselineOfMetacello]
         load : BaselineOfFileTree
     linear load : baseline [BaselineOfMetacello]
         load : Metacello-Base
         explicit load : Gofer
             load : ConfigurationOfGofer-dkh.45
         atomic load : 1.0.5.4 [ConfigurationOfGofer]
             load : Gofer-Core.gemstone-dkh.138
         load : Metacello-Core
         load : Metacello-MC
         load : Metacello-Platform.gemstone
         load : Metacello-ToolBox
         load : Metacello-Cypress
         explicit load : FileTree
             load : BaselineOfFileTree-dkh.4
         linear load : baseline [BaselineOfFileTree]
             load : MonticelloFileTree-Core
             load : MonticelloFileTree-FileDirectory-Utilities
         load : Metacello-GS3x-Platform
         load : Metacello-FileTree
         load : Metacello-GitBasedRepository
         load : Metacello-GitHub
         load : Metacello-Bitbucket

Dale

On 12/5/17 5:44 AM, Iwan Vosloo via Glass wrote:

> Hello,
>
> I often have questions, such as 'which groups does project X define'.
> I wonder what are nice ways for me to find out programmatically.
>
> I can, for example do:
>
> (Metacello new
>   configuration:  'Seaside3' ;
>   repository: 'http://www.squeaksource.com/MetacelloRepository';
>   get)
>
> .. and then ask that project stuff, such as its map of versions etc.
>
> What I'd also like to do is to know which groups a project defines,
> and what packages are in those groups. How do I do this in code
> starting from (potentially) nothing in my image?
>
>
> Regards
> - Iwan
>
>

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Metacello: getting more info on a project

GLASS mailing list
Hi Dale,


On 08/12/2017 00:44, Dale Henrichs via Glass wrote:
> Right now there is no API for asking these questions programmatically
> ... Personally I simply read the baseline spec to find the answers to
> these questions ... In practice that once you know what groups there are
> you will want to know what packages are in the group and of course the
> answer to all of these questions is that it depends up upon a lot of
> different information (what platform and platform version or you
> interested in ... and so on)...

Thanks. Being able to interrogate what Metacello found via tha API would
be great... ;-) Then I dont have to rely on my interpretation of the
code in someone else's BaselineOf/ConfigurationOf. That code can be
structured in multiple ways and cater for all kinds of advanced corner
cases. It would be nice not to have to read it...and thus to have had to
master a bigger chunk of the learning curve of Metacello just to be able
to pull in (possibly complex) projects of others.

Regards
Iwan



--

Reahl, the Python only web framework / www.reahl.org
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Metacello: getting more info on a project

GLASS mailing list


On 12/9/17 12:07 AM, Iwan Vosloo via Glass wrote:

> Hi Dale,
>
>
> On 08/12/2017 00:44, Dale Henrichs via Glass wrote:
>> Right now there is no API for asking these questions programmatically
>> ... Personally I simply read the baseline spec to find the answers to
>> these questions ... In practice that once you know what groups there
>> are you will want to know what packages are in the group and of
>> course the answer to all of these questions is that it depends up
>> upon a lot of different information (what platform and platform
>> version or you interested in ... and so on)...
>
> Thanks. Being able to interrogate what Metacello found via tha API
> would be great... ;-) Then I dont have to rely on my interpretation of
> the code in someone else's BaselineOf/ConfigurationOf. That code can
> be structured in multiple ways and cater for all kinds of advanced
> corner cases. It would be nice not to have to read it...and thus to
> have had to master a bigger chunk of the learning curve of Metacello
> just to be able to pull in (possibly complex) projects of others.
I understand and reflecting on this I realize that I was probably
thinking about the general case where you might want to ask the
question: "what groups are there for the Seaside project for Pharo6.1"
... while in GemStone ... if you narrow the scope of the question to:
"what groups are available for the platform I'm running on" ... then I
think it is not that difficult to supply a workspace to produce the list
of groups available for the current platform given a BaselineOf:

   | project groupNames |
   project := BaselineOfMetacello new project.
   groupNames := Set new.
   (project map at: 'baseline') spec
     specListProjectDo: [ :projectSpec |  ]
     packageDo: [ :packageSpec |  ]
     groupDo: [ :groupSpec | groupNames add: groupSpec name ].
   groupNames

you can see that it is possible to garner information about the names of
dependent projects and packages as well ...

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Metacello: getting more info on a project

GLASS mailing list
On 11/12/2017 22:00, Dale Henrichs via Glass wrote:

> I understand and reflecting on this I realize that I was probably
> thinking about the general case where you might want to ask the
> question: "what groups are there for the Seaside project for Pharo6.1"
> ... while in GemStone ... if you narrow the scope of the question to:
> "what groups are available for the platform I'm running on" ... then I
> think it is not that difficult to supply a workspace to produce the list
> of groups available for the current platform given a BaselineOf:
>
>    | project groupNames |
>    project := BaselineOfMetacello new project.
>    groupNames := Set new.
>    (project map at: 'baseline') spec
>      specListProjectDo: [ :projectSpec |  ]
>      packageDo: [ :packageSpec |  ]
>      groupDo: [ :groupSpec | groupNames add: groupSpec name ].
>    groupNames
>
> you can see that it is possible to garner information about the names of
> dependent projects and packages as well ...

Ok, thanks Dale, that is useful.  Funny, I would have thought that the
concept of which groups a project "exposes" (if that is the right
terminology) should be the same regardless of platform?

Regards
Iwan


--

Reahl, the Python only web framework / www.reahl.org
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Metacello: getting more info on a project

GLASS mailing list


On 12/21/17 10:40 PM, Iwan Vosloo via Glass wrote:

> On 11/12/2017 22:00, Dale Henrichs via Glass wrote:
>> I understand and reflecting on this I realize that I was probably
>> thinking about the general case where you might want to ask the
>> question: "what groups are there for the Seaside project for
>> Pharo6.1" ... while in GemStone ... if you narrow the scope of the
>> question to: "what groups are available for the platform I'm running
>> on" ... then I think it is not that difficult to supply a workspace
>> to produce the list of groups available for the current platform
>> given a BaselineOf:
>>
>>    | project groupNames |
>>    project := BaselineOfMetacello new project.
>>    groupNames := Set new.
>>    (project map at: 'baseline') spec
>>      specListProjectDo: [ :projectSpec |  ]
>>      packageDo: [ :packageSpec |  ]
>>      groupDo: [ :groupSpec | groupNames add: groupSpec name ].
>>    groupNames
>>
>> you can see that it is possible to garner information about the names
>> of dependent projects and packages as well ...
>
> Ok, thanks Dale, that is useful.  Funny, I would have thought that the
> concept of which groups a project "exposes" (if that is the right
> terminology) should be the same regardless of platform?
Haha, there aren't any notion of pre-conceived structure in Metacello.
It is up to the maintainers of projects to define and enforce structure.

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass