Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the #includes: directive in Metacello?

I don't understand the following excerpt. More precisely, it's not clear what the #includes: directive is since it looks exactly like the opposite of #requires:.

spec for: #'pharo3.x' do: [
    spec 
        package: 'Grease-Core' with: [
            spec includes: #('Grease-Pharo30-Core' ). ];
        package: 'Grease-Tests-Core' with: [
            spec includes: #('Grease-Tests-Pharo20-Core' ). ];
        package: 'Grease-Pharo30-Core' with: [
            spec requires: #('Grease-Core' ). ];
        package: 'Grease-Tests-Pharo20-Core' with: [
            spec requires: #('Grease-Tests-Core' ) ] ].
like image 418
Damien Cassou Avatar asked Mar 23 '23 07:03

Damien Cassou


1 Answers

It is an opposite to the requires but it does more. If A requires: B and B includes: A, then loading B effects, that A is also loaded (because of #includes:) after B is loaded (because of #requires).

I had a discussion with Dale about this behavior. In the end, it is a naming issue. In the debian World, you would use something like #provides: (which is not existing), and you could write

A provides: B

However, the fact that still A requires: B would not be reflected there.

TL;DR

When A includes: B, then loading A also loads B.

like image 53
Tobias Avatar answered Mar 31 '23 22:03

Tobias