TulipeMoutarde.be

About

Metacello configurations readability

Written on August 24 2011.

This blog post was written a long time ago and may not reflect my current opinion or might be technically out of date. Read with a grain of salt.

I’m polishing a very small package to interact with ogone, a payment platform, from a Seaside application. So it’s time to write a Metacello configuration to share it easily.

I always have hard time to read Metacello configurations and wonder if a vertical alignment wouldn’t help. Basically, I find this:

baseline10: spec
  spec for: #common do: [
    spec blessing: #baseline.
    spec
      repository: 'http://www.squeaksource.com/ogone';
      package: 'Ogone-Core';
      package: 'Ogone-Seaside-Example' with: [spec requires: 'Ogone-Core'];
      package: 'Ogone-Tests'           with: [spec requires: 'Ogone-Core'].

    spec
      group: 'default'         with: #('Core' 'Seaside-Example' 'Test');
      group: 'Core'            with: #('Ogone-Core');
      group: 'Seaside-Example' with: #('Ogone-Core' 'Ogone-Seaside-Example');
      group: 'Tests'           with: #('Ogone-Core' 'Ogone-Test')
  ].

More readable than this:

baseline10: spec
  spec for: #common do: [
    spec blessing: #baseline.
    spec
      repository: 'http://www.squeaksource.com/ogone';
      package: 'Ogone-Core';
      package: 'Ogone-Seaside-Example' with: [spec requires: 'Ogone-Core'];
      package: 'Ogone-Tests' with: [spec requires: 'Ogone-Core'].

    spec
      group: 'default' with: #('Core' 'Seaside-Example' 'Test');
      group: 'Core' with: #('Ogone-Core');
      group: 'Seaside-Example' with: #('Ogone-Core' 'Ogone-Seaside-Example');
      group: 'Tests' with: #('Ogone-Core' 'Ogone-Test')
  ].

Am I the only one ?