diff --git a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st index af4975f..718d54e 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st @@ -11,8 +11,8 @@ Class { { #category : #'graphical interface' } GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into: location [ | fileName | - fileName := (downloadUrl splitOn: $/) last. - (location / fileName) exists ifTrue: [ (location / fileName) ensureDelete ]. + fileName := downloadUrl segments last. + (location / fileName) ensureDelete. [: bar | bar title: aString. [ZnClient new @@ -27,3 +27,26 @@ GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into progress resume ]. ] asJob run. ] + +{ #category : #private } +GrafoscopioUtils class >> sanitize: url [ + "I remove white spaces in url's and prepend 'http://' to urls when it is ommited, so + operations that rely on sane and well formed urls don't throw error messages." + | sanitized modUrl | + modUrl := url. + [modUrl endsWith: ' '] + whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ]. + (url beginsWith: 'http://') + ifFalse: [ sanitized := ('http://', modUrl) asUrl ] + ifTrue: [ sanitized := modUrl asUrl ]. + ^ sanitized +] + +{ #category : #updating } +GrafoscopioUtils class >> update [ + "Updates GrafoscopioUtils with new versions of itself take from the source code repository." + Gofer new + smalltalkhubUser: 'Offray' project: 'Grafoscopio'; + package: 'GrafoscopioUtils'; + load. +]