1058
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
MCHttpRepository subclass:#MCSqueaksourceRepository
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'SCM-Monticello-RemoteRepositories'
|
|
10 |
!
|
|
11 |
|
|
12 |
MCSqueaksourceRepository comment:'I am a specialized MCHttpRepository for http://squeaksource.com.
|
|
13 |
I optimize checks for existing files by doing a head request instead of reloading the whole file list first.'
|
|
14 |
!
|
|
15 |
|
|
16 |
|
|
17 |
!MCSqueaksourceRepository class methodsFor:'accessing'!
|
|
18 |
|
|
19 |
description
|
|
20 |
^ 'squeaksource.com'
|
|
21 |
! !
|
|
22 |
|
|
23 |
!MCSqueaksourceRepository class methodsFor:'creation template'!
|
|
24 |
|
|
25 |
baseURL
|
|
26 |
^ 'http://squeaksource.com/'
|
|
27 |
! !
|
|
28 |
|
|
29 |
!MCSqueaksourceRepository class methodsFor:'testing'!
|
|
30 |
|
|
31 |
isResponsibleFor: aUrl
|
|
32 |
^ aUrl includesSubstring: 'squeaksource.com/'
|
|
33 |
! !
|
|
34 |
|
|
35 |
!MCSqueaksourceRepository methodsFor:'*Komitter-Models'!
|
|
36 |
|
|
37 |
koRemote
|
|
38 |
|
|
39 |
^ KomitSqueakSourceRemote new
|
|
40 |
remote: self;
|
|
41 |
yourself
|
|
42 |
! !
|
|
43 |
|
|
44 |
!MCSqueaksourceRepository methodsFor:'interface'!
|
|
45 |
|
|
46 |
includesFileNamed: aString
|
|
47 |
|
|
48 |
"avoid the slower default method and simply do a head request "
|
|
49 |
self httpClient
|
|
50 |
numberOfRetries: 0;
|
|
51 |
ifFail: [ :exception |
|
|
52 |
((exception isKindOf: ZnHttpUnsuccessful) and: [ exception response isNotFound ])
|
|
53 |
ifTrue: [ ^ false ].
|
|
54 |
exception pass];
|
|
55 |
head: (self urlForFileNamed: aString).
|
|
56 |
|
|
57 |
^ true
|
|
58 |
!
|
|
59 |
|
|
60 |
includesVersionNamed: aString
|
|
61 |
"directly do a filename check since squeaksource only stores mcz"
|
|
62 |
^ self includesFileNamed: aString, '.mcz'
|
|
63 |
! !
|
|
64 |
|
|
65 |
!MCSqueaksourceRepository class methodsFor:'documentation'!
|
|
66 |
|
|
67 |
version
|
|
68 |
^ '$Header$'
|
|
69 |
!
|
|
70 |
|
|
71 |
version_CVS
|
|
72 |
^ '$Header$'
|
|
73 |
! !
|
|
74 |
|