-Hi everyone. In this video, we are going to look
at how we can use the tool Metacello
to load external packages inside your Pharo environment.
The package we are going to look at is called "Containers-Stack".
It basically consists of stack implementations
with push, size, top, and pop variations.
A really simple stack implementation. You can see in the paragraph Loading
that you will have a piece of code that is calling Metacello
along with a baseline and repository arguments.
We are going to look into the baseline a bit later on.
But if we look at the repository, it is basically this URL slightly modified.
Let's just try to copy this into our Pharo environment.
Navigate to our Pharo environment, System Browser open.
We are going to look for containers.
We have the definitions of containers, rings.
If we go to Pharo, Tools then Playground,
you can paste the code I just copied and then, if we execute it with Cmd+D,
you can see that it is loading everything,
and we can now see those 3 new packages. Basically, we have the Containers-Stack
where there is the actual implementation of the stack.
Then a test package which we can check if it is green. It is, great.
And we have got BaselineOfContainersStack.
This was what I was talking about. Basically,
baselines are classes which only have one method called baseline.
It will specify which packages every package in your actual project will need
in order to work correctly.
Here, we can see that we have got a spec package for the Containers-Stack-Tests
that requires the actual Containers-Stack in order to work.
It is a real simple baseline, but this will help you
specify how your project will work altogether.
We can see, if we go back to the GitHub page,
that "If you want to depend on it". So, basically,
if you want to use Containers-Stack in a bigger project,
you can use the spec baseline Containers-Stack
with spec repositories.
So, this is something you have to include in your baseline
in order to depend on this project here.
We learned how to use Metacello
in order to load GitHub repositories with a baseline.
A baseline is something that specifies what a project needs
in terms of dependencies in order to load correctly.