From f0bda6071aafc51f191cfcfc59d79ab1e52b2b6d Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 5 Sep 2017 12:18:08 +0000 Subject: [PATCH] Making the config available. --- .../ConfigurationOfBrea.class.st | 169 ++++++++++++++++++ repository/ConfigurationOfBrea/package.st | 1 + 2 files changed, 170 insertions(+) create mode 100644 repository/ConfigurationOfBrea/ConfigurationOfBrea.class.st create mode 100644 repository/ConfigurationOfBrea/package.st diff --git a/repository/ConfigurationOfBrea/ConfigurationOfBrea.class.st b/repository/ConfigurationOfBrea/ConfigurationOfBrea.class.st new file mode 100644 index 0000000..863b33f --- /dev/null +++ b/repository/ConfigurationOfBrea/ConfigurationOfBrea.class.st @@ -0,0 +1,169 @@ +" +I am ConfigurationOfBrea a Metacello configuration of Brea. + +Brea is a simple dynamic distributed web site generator for public + & open data +For more information about this please visit: + +http://smalltalkhub.com/#!/~Offray/Brea +" +Class { + #name : #ConfigurationOfBrea, + #superclass : #Object, + #instVars : [ + 'project' + ], + #classVars : [ + 'LastVersionLoad' + ], + #category : #ConfigurationOfBrea +} + +{ #category : #'development support' } +ConfigurationOfBrea class >> DevelopmentSupport [ + +"See the methods in the 'development support' category on the class-side of MetacelloBaseConfiguration. Decide what development support methods you would like to use and copy them the the class-side of your configuration." + +] + +{ #category : #private } +ConfigurationOfBrea class >> baseConfigurationClassIfAbsent: aBlock [ + + ^Smalltalk + at: #'ConfigurationOf' + ifAbsent: [ + self ensureMetacelloBaseConfiguration. + Smalltalk at: #'ConfigurationOf' ifAbsent: aBlock ]. +] + +{ #category : #private } +ConfigurationOfBrea class >> ensureMetacello [ + + (self baseConfigurationClassIfAbsent: []) ensureMetacello +] + +{ #category : #private } +ConfigurationOfBrea class >> ensureMetacelloBaseConfiguration [ + Smalltalk + at: #'ConfigurationOf' + ifAbsent: [ + | repository version | + repository := MCHttpRepository + location: 'http://smalltalkhub.com/mc/dkh/metacello/main' + user: '' + password: ''. + repository + versionReaderForFileNamed: 'Metacello-Base-dkh.107' + do: [ :reader | + version := reader version. + version load. + version workingCopy repositoryGroup addRepository: repository ] ] +] + +{ #category : #'metacello tool support' } +ConfigurationOfBrea class >> isMetacelloConfig [ + "Answer true and the Metacello tools will operate on you" + + ^true +] + +{ #category : #loading } +ConfigurationOfBrea class >> load [ + "Load the #stable version defined for this platform. The #stable version is the version that is recommended to be used on this platform." + + "self load" + + + ^(self project version: #stable) load +] + +{ #category : #loading } +ConfigurationOfBrea class >> loadBleedingEdge [ + "Load the latest versions of the mcz files defined for this project. It is not likely that the #bleedingEdge has been tested." + + "self loadBleedingEdge" + + + ^(self project version: #bleedingEdge) load +] + +{ #category : #loading } +ConfigurationOfBrea class >> loadDevelopment [ + "Load the #development version defined for this platform. The #development version will change over time and is not expected to be stable." + + "self loadDevelopment" + + + ^(self project version: #development) load +] + +{ #category : #accessing } +ConfigurationOfBrea class >> project [ + + ^self new project +] + +{ #category : #'development support' } +ConfigurationOfBrea class >> validate [ + "Check the configuration for Errors, Critical Warnings, and Warnings (see class comment for MetacelloMCVersionValidator for more information). + Errors identify specification issues that will result in unexpected behaviour when you load the configuration. + Critical Warnings identify specification issues that may result in unexpected behavior when you load the configuration. + Warnings identify specification issues that are technically correct, but are worth take a look at." + + "self validate" + + + self ensureMetacello. + ^ ((Smalltalk at: #MetacelloToolBox) validateConfiguration: self debug: #() recurse: false) explore +] + +{ #category : #baselines } +ConfigurationOfBrea >> baseline1: spec [ + + spec for: #common do: [ + spec + blessing: #baseline; + repository: 'http://smalltalkhub.com/mc/Offray/Brea/main'; + package: 'Brea'. + spec + package: 'Fossil' with: [ + spec + className: #ConfigurationOfFossil; + versionString: #'stable'; + repository: 'http://smalltalkhub.com/mc/Offray/Fossil/main']] +] + +{ #category : #accessing } +ConfigurationOfBrea >> customProjectAttributes [ + "Edit to return a collection of any custom attributes e.g. for conditional loading: Array with: #'Condition1' with: #'Condition2. + For more information see: http://code.google.com/p/metacello/wiki/CustomProjectAttrributes " + + ^ #() +] + +{ #category : #accessing } +ConfigurationOfBrea >> project [ + ^ project + ifNil: [ + "Bootstrap Metacello if it is not already loaded" + self class ensureMetacello. + project := MetacelloMCProject new projectAttributes: self customProjectAttributes. "Create the Metacello project" + (Smalltalk at: #'MetacelloVersionConstructor') on: self project: project. "Construct the project" + project loadType: #'linear'. "change to #atomic if desired" + project ] +] + +{ #category : #'symbolic versions' } +ConfigurationOfBrea >> stable: spec [ + + spec for: #common version: '1' +] + +{ #category : #'symbolic versions' } +ConfigurationOfBrea >> version1: spec [ + + spec for: #common do: [ + spec + blessing: #release; + package: 'Fossil' with: #'stable'] +] diff --git a/repository/ConfigurationOfBrea/package.st b/repository/ConfigurationOfBrea/package.st new file mode 100644 index 0000000..3d83d1d --- /dev/null +++ b/repository/ConfigurationOfBrea/package.st @@ -0,0 +1 @@ +Package { #name : #ConfigurationOfBrea }