[英]Load version of package for a given date in Pharo
我正在尋找一種方法,給定一個包名稱,加載該包的版本,該版本是給定日期的最新版本。
例如:
HypotheticalClassLoader loadPackage: 'Athens-Core' onDate: ('12.03.2015' asDate).
將加載早於2015年3月12日的'Athens-Core'的第一次提交。
以下腳本怎么樣? 它應該在給定日期之前檢測第一個版本。
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 ]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.