8.5: Loading a Metacello Configuration

Deep into Pharo · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-SA 3.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    8.5: Loading a Metacello Configuration

    Of course, the point of specifying project configurations in Metacello is to be able to load exactly that configuration into your image, and thus to be sure that you have a coherent set of package versions. To load versions, you send the message load to a version. Here are some examples for loading versions of the CoolBrowser:

    (ConfigurationOfCoolBrowser project version: '0.1') load.
    (ConfigurationOfCoolBrowser project version: '0.2') load.
    

    Note that in addition, if you print the result of each expression, you get a list of packages in load order: Metacello manages not only which packages are loaded, but also the order. It can be handy to debug configurations.

    Selective Loading. By default, the load message loads all the packages associated with the version (as we will see later, we can change that by defining a particular group called default). If you want to load a subset of the packages in a project, you should list the names of the packages that you are interested in as an argument to the load: method:

    (ConfigurationOfCoolBrowser project version: '0.2') load:
        { 'CoolBrowser-Core' .
        'CoolBrowser-Addons' }.
    

    Debugging Configuration. If you want to simulate the loading of a configuration, without actually loading it, you should use record (or record:) instead of load (or load:). Then, to get the result of the simulation, you should send it the message loadDirective as follows:

    ((ConfigurationOfCoolBrowser project version: '0.2') record:
        { 'CoolBrowser-Core' .
        'CoolBrowser-Addons' }) loadDirective.
    

    Apart from load and record, there is also another useful method which is fetch (and fetch:). As explained, record simply records which Monticello files should be downloaded and in which order. fetch accesses and downloads all the needed Monticello files. Just for the record, in the implementation load first does a fetch and then a doLoad.


    This page titled 8.5: Loading a Metacello Configuration was last modified on Mon, 26 Jul 2021 15:16:53 GMT and is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform.