Skip to main content
Engineering LibreTexts

8.5: Loading a Metacello Configuration

  • Page ID
    43838
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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 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; a detailed edit history is available upon request.