diff --git a/repository/Grafoscopio-Utils/GrafoscopioDocumentation.class.st b/repository/Grafoscopio-Utils/GrafoscopioDocumentation.class.st index 35d7998..1b1a88c 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioDocumentation.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioDocumentation.class.st @@ -15,11 +15,29 @@ Class { #category : #'Grafoscopio-Utils' } +{ #category : #updating } +GrafoscopioDocumentation class >> listOutdatedDocs [ + "I return the list of all documentent where the local copy and the remote copy doesn't match" + | docsRepo | + docsRepo := self newDefault. + ^ docsRepo documents reject: [ :doc | (docsRepo isFileUpdatedFor: doc) ] +] + { #category : #'as yet unclassified' } GrafoscopioDocumentation class >> newDefault [ ^ self new ] +{ #category : #updating } +GrafoscopioDocumentation class >> update [ + self newDefault update +] + +{ #category : #updating } +GrafoscopioDocumentation class >> updateAll [ + self allInstancesDo: [ :docs | docs update ] +] + { #category : #updating } GrafoscopioDocumentation class >> updateAllUI [ "Updates documentation (manual, tutorials) from the official repository for a given documentation." @@ -50,7 +68,7 @@ GrafoscopioDocumentation >> download: fileNameWithRelativePath [ relativePathFolders do: [ :folder | newPath := newPath / folder ]. parentFolder := newPath asFileReference. parentFolder exists ifFalse: [ parentFolder ensureCreateDirectory ]. - GrafoscopioGenUtils + GrafoscopioUtils downloadingFrom: self repository remote asString, '/doc/tip/', fileNameWithRelativePath withMessage: 'Downloading ', fileName into: parentFolder @@ -70,12 +88,6 @@ GrafoscopioDocumentation >> isFileUpdatedFor: relativeFilePath [ with: (self repository lastHashNumberFor: relativeFilePath) ] ] -{ #category : #updating } -GrafoscopioDocumentation >> listOutdatedDocs [ - "I return the list of all documentent where the local copy and the remote copy doesn't match" - ^ self documents reject: [ :doc | (self isFileUpdatedFor: doc) ] -] - { #category : #accessing } GrafoscopioDocumentation >> localPlace [ ^ localPlace ifNil: [ @@ -124,7 +136,7 @@ GrafoscopioDocumentation >> repository: anObject [ { #category : #updating } GrafoscopioDocumentation >> update [ - (self listOutdatedDocs) + (self class listOutdatedDocs) ifEmpty: [ self inform: 'All documents in the ', self name,' collection are already updated'. ^ self ] diff --git a/repository/Grafoscopio-Utils/GrafoscopioGenUtils.class.st b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st similarity index 83% rename from repository/Grafoscopio-Utils/GrafoscopioGenUtils.class.st rename to repository/Grafoscopio-Utils/GrafoscopioUtils.class.st index dcd8d88..af4975f 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioGenUtils.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st @@ -3,13 +3,13 @@ I contain simple general functionality used by Grafoscopio, Dataviz or other related projects. " Class { - #name : #GrafoscopioGenUtils, + #name : #GrafoscopioUtils, #superclass : #Object, #category : #'Grafoscopio-Utils' } { #category : #'graphical interface' } -GrafoscopioGenUtils class >> downloadingFrom: downloadUrl withMessage: aString into: location [ +GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into: location [ | fileName | fileName := (downloadUrl splitOn: $/) last. (location / fileName) exists ifTrue: [ (location / fileName) ensureDelete ].