3

我正在寻找一种方法,在给定包名称的情况下,加载该包的版本,该版本在给定日期是最新版本。

例如:

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

将加载早于 12.03.2015 的“Athens-Core”的第一次提交。

4

1 回答 1

2

下面的脚本呢。它应该在给定日期之前检测到第一个版本。

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 ]
于 2016-04-13T09:42:29.273 回答