3

I am looking for a way to, given a package name, load a version of that package that was the newest version at a given date.

For example:

HypotheticalClassLoader loadPackage: 'Athens-Core' onDate: ('12.03.2015' asDate).

Would load the first commit of 'Athens-Core' that is older than 12.03.2015.

Uko
  • 13,134
  • 6
  • 58
  • 106
BoriS
  • 907
  • 5
  • 13

1 Answers1

2

What about the following script. It should detect the first version before a given date.

goferReferences := Gofer new
   url: 'http://smalltalkhub.com/mc/Pharo/Athens/main';
   package: 'Athens-Core'
   constraint: [ :goferReference |
      goferReference version info date < '12 June 2015' asDate];
   resolved.

goferReferences ifNotNil: [
   Gofer new
      url: 'http://smalltalkhub.com/mc/Pharo/Athens/main';
      version: goferReferences first name;
      load ]
Andrei Chis
  • 723
  • 4
  • 6