Starting Brea Themes and their installation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2020-08-07 14:04:45 -05:00
parent c2fafbbad4
commit c7fb5d8900
2 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,112 @@
"
I model a web theme.
For the Collaborators Part: State my main collaborators and one line about how I interact with them.
Public API and Key Messages
- message one
- message two
- (for bonus points) how to create instances.
One simple example is simply gorgeous.
Internal Representation and Key Implementation Points.
Instance Variables
name: <Object>
preview: <Object>
provider: <Object>
url: <Object>
Implementation Points
"
Class {
#name : #BreaTheme,
#superclass : #Object,
#instVars : [
'name',
'provider',
'url',
'preview',
'license'
],
#category : #Brea
}
{ #category : #utilities }
BreaTheme >> dashedName [
^ self name asDashedLowercase
]
{ #category : #operation }
BreaTheme >> downloadInto: aFolder [
| tempName zippedFile |
self url ifNil: [ ^ self ].
tempName := self name.
zippedFile := aFolder / self dashedName , 'zip'.
aFolder ensureCreateDirectory.
GrafoscopioUtils
downloadingFrom: self url withMessage: 'Downloading ', tempName, '...' into: zippedFile.
^ zippedFile
]
{ #category : #installation }
BreaTheme >> installInto: aFolder [
| zippedFile |
self url ifNil: [ ^ self ].
zippedFile := self downloadInto: aFolder.
(ZipArchive new readFrom: zippedFile) extractAllTo: aFolder.
^ aFolder
]
{ #category : #accessing }
BreaTheme >> license [
^ license
]
{ #category : #accessing }
BreaTheme >> license: anObject [
license := anObject
]
{ #category : #accessing }
BreaTheme >> name [
^ name ifNil: [ name = 'unamed' ]
]
{ #category : #accessing }
BreaTheme >> name: anObject [
name := anObject
]
{ #category : #accessing }
BreaTheme >> preview [
^ preview
]
{ #category : #accessing }
BreaTheme >> preview: anObject [
preview := anObject
]
{ #category : #accessing }
BreaTheme >> provider [
^ provider
]
{ #category : #accessing }
BreaTheme >> provider: anObject [
provider := anObject
]
{ #category : #accessing }
BreaTheme >> url [
^ url
]
{ #category : #accessing }
BreaTheme >> url: anObject [
url := anObject
]

View File

@ -1,5 +1,9 @@
" "
I model a wiki page of a Brea site. I model a wiki page of a Brea site.
I am modelled after common wiki pages, where a document in a light markup laguage
is converted in HTML and is expected to access document history (I am helped by
FossilRepo for that).
I can be used for other types of publications, like blog post though.
" "
Class { Class {
#name : #BreaWikiPage, #name : #BreaWikiPage,