[squeak-dev] The Trunk: Monticello-ar.414.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Dec 16 17:45:05 UTC 2010


Andreas Raab uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ar.414.mcz

==================== Summary ====================

Name: Monticello-ar.414
Author: ar
Time: 16 December 2010, 9:44:42.002 am
UUID: f8a10157-7378-9349-8013-02831a3f4707
Ancestors: Monticello-ar.413

Provides an API to create MCRepositories from generic location strings, including:
	- http, and ftp urls (i.e., http://source.squeak.org/trunk)
	- directory paths (i.e., C:\Squeak\packages)
	- directory matches (i.e., C:\Squeak\packages\*)

=============== Diff against Monticello-ar.413 ===============

Item was added:
+ ----- Method: MCRepository class>>location: (in category 'instance creation') -----
+ location: urlOrPath
+ 	"Answer an MCRepository for the given url or path. Accepted locations are:
+ 		- http, and ftp urls (i.e., http://source.squeak.org/trunk)
+ 		- directory paths (i.e., C:\Squeak\packages)
+ 		- directory matches (i.e., C:\Squeak\packages\*)
+ 	"
+ 
+ 	^self location: urlOrPath username: '' password: ''!

Item was added:
+ ----- Method: MCRepository class>>location:username:password: (in category 'instance creation') -----
+ location: urlOrPath username: user password: pass
+ 	"Answer an MCRepository for the given url or path. Accepted locations are:
+ 		- http, and ftp urls (i.e., http://source.squeak.org/trunk)
+ 		- directory paths (i.e., C:\Squeak\packages)
+ 		- directory matches (i.e., C:\Squeak\packages\*)
+ 	If provided, the supplied user name and password will be used."
+ 
+ 	| url |
+ 	(urlOrPath findString: '://') > 0 ifTrue:[
+ 		url := urlOrPath asUrl.
+ 		url scheme caseOf: {
+ 			['ftp'] -> [^MCFtpRepository 
+ 							host: url authority
+ 							 directory: url pathString allButFirst
+ 							user: user 
+ 							password: user].
+ 			['http'] -> [^MCHttpRepository 
+ 							location: urlOrPath 
+ 							user: user 
+ 							password: pass].
+ 		} otherwise:[^self error: 'Unsupported scheme: ', url scheme].
+ 	].
+ 
+ 	(urlOrPath endsWith: '*') ifTrue:[
+ 		^MCSubDirectoryRepository new 
+ 				directory: (FileDirectory on: urlOrPath allButLast)].
+ 
+ 	^MCDirectoryRepository new 
+ 			directory: (FileDirectory on: urlOrPath)!




More information about the Squeak-dev mailing list