[Pkg] The Trunk: SMBase-nice.96.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 18 14:23:26 UTC 2010


Nicolas Cellier uploaded a new version of SMBase to project The Trunk:
http://source.squeak.org/trunk/SMBase-nice.96.mcz

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

Name: SMBase-nice.96
Author: nice
Time: 18 January 2010, 3:23:18.962 pm
UUID: b8c01ced-6c28-a247-b704-8be86b951568
Ancestors: SMBase-ul.95

Simplify some ( on: Error do:  ) patterns:
no non local return, nor outer temp required

=============== Diff against SMBase-ul.95 ===============

Item was changed:
  ----- Method: SMSqueakMap classSide>>pingServer: (in category 'server detection') -----
  pingServer: aServerName
  	"Check if the SqueakMap server is responding.
  	For an old image we first make sure the name resolves -
  	the #httpGet: had such a long timeout (and hanging?)
  	for resolving the name."
  
- 	| answer |
  	"Only test name lookup first if image is before the network rewrite,
  	after the rewrite it works."
+ 	^[ | answer url |
- 	[ | url |
  	(SystemVersion current highestUpdate < 5252)
  		ifTrue: [NetNameResolver addressForName: (aServerName upTo: $:) timeout: 5].
  	url := 'http://', aServerName, '/ping'.
+ 	answer := HTTPSocket httpGet: url.
+ 	answer isString not and: [answer contents = 'pong']]
+ 		on: Error do: [ false ].
+ 	!
- 	answer := HTTPSocket httpGet: url]
- 				on: Error do: [:ex | ^false].
- 	^answer isString not and: [answer contents = 'pong']!

Item was changed:
  ----- Method: SMAccount>>streamForFile: (in category 'files') -----
  streamForFile: fileName
  	"Return a readonly stream for file <fileName>.
  	If the file does not exist return nil."
  
+ 	^[StandardFileStream oldFileNamed: (self uploadsDirectory fullNameFor: fileName)]
+ 		on: FileDoesNotExistException do: [nil]!
- 	| stream |
- 	[stream := StandardFileStream oldFileNamed: (self uploadsDirectory fullNameFor: fileName)]
- 		on: FileDoesNotExistException do: [^nil].
- 	^stream!



More information about the Packages mailing list