-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version upgrade works now with internal version numbers
- Loading branch information
Showing
22 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
An ALGInstallation is a singleton storing the current version of Algernon allowing to upgrade to new versions. | ||
|
||
Instance Variables | ||
versionNumber: aNumber |
3 changes: 3 additions & 0 deletions
3
packages/Algernon.package/ALGInstallation.class/class/instance.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
instance | ||
^ Instance ifNil: [ Instance := ALGInstallation new ] |
10 changes: 10 additions & 0 deletions
10
packages/Algernon.package/ALGInstallation.class/instance/cleanup.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
accessing | ||
cleanup | ||
| isActive | | ||
isActive := Algernon activateAlgernon. | ||
ALGCache allInstancesDo: [ :cache | cache clear]. | ||
ALGItemProvider initializeItems. | ||
Algernon allInstancesDo: [ :algernon | algernon delete]. | ||
ALGCore allInstancesDo: [ :algernon | algernon delete]. | ||
Smalltalk garbageCollect. | ||
Algernon activateAlgernon: isActive |
9 changes: 9 additions & 0 deletions
9
packages/Algernon.package/ALGInstallation.class/instance/exportAsSarArchive.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
accessing | ||
exportAsSarArchive | ||
|
||
| package | | ||
package := 'Algernon'. | ||
(UserDialogBoxMorph | ||
confirm: 'Do you have incremented the versionNumber of ', package, | ||
' before you release a new version?') | ||
ifTrue: [ self sarFromPackage: package ] |
3 changes: 3 additions & 0 deletions
3
packages/Algernon.package/ALGInstallation.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
initialize | ||
self versionNumber: 0 |
3 changes: 3 additions & 0 deletions
3
packages/Algernon.package/ALGInstallation.class/instance/latestVersion.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
latestVersion | ||
^ 1 |
14 changes: 14 additions & 0 deletions
14
packages/Algernon.package/ALGInstallation.class/instance/sarFromPackage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
accessing | ||
sarFromPackage: package | ||
| mczStream version workingCopy zip | | ||
|
||
zip := ZipArchive new. | ||
mczStream := RWBinaryOrTextStream on: (String new: 10000). | ||
workingCopy := MCWorkingCopy forPackage: (MCPackage new name: package). | ||
version := workingCopy newVersion. | ||
version fileOutOn: mczStream. | ||
(zip addString: mczStream contents as: package , '.mcz') desiredCompressionLevel: 0. | ||
zip addString: 'self fileInMonticelloZipVersionNamed: | ||
''' , package , '.mcz''.' as: 'install/preamble'. | ||
zip addString: 'ALGInstallation instance upgrade.' as: 'install/postscript'. | ||
zip writeToFileNamed: package , '.sar' |
5 changes: 5 additions & 0 deletions
5
packages/Algernon.package/ALGInstallation.class/instance/upgrade.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
upgrade | ||
self latestVersion > self versionNumber | ||
ifTrue: [ self cleanup. | ||
self versionNumber: self latestVersion ] |
3 changes: 3 additions & 0 deletions
3
packages/Algernon.package/ALGInstallation.class/instance/versionNumber..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
versionNumber: aNumber | ||
versionNumber := aNumber |
3 changes: 3 additions & 0 deletions
3
packages/Algernon.package/ALGInstallation.class/instance/versionNumber.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
versionNumber | ||
^ versionNumber |
12 changes: 12 additions & 0 deletions
12
packages/Algernon.package/ALGInstallation.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"class" : { | ||
"instance" : "JS 6/16/2016 18:53" }, | ||
"instance" : { | ||
"cleanup" : "JS 6/16/2016 18:57", | ||
"exportAsSarArchive" : "JS 6/16/2016 20:00", | ||
"initialize" : "JS 6/16/2016 18:45", | ||
"latestVersion" : "JS 6/16/2016 19:28", | ||
"sarFromPackage:" : "JS 6/16/2016 19:58", | ||
"upgrade" : "JS 6/16/2016 19:16", | ||
"versionNumber" : "JS 6/16/2016 18:17", | ||
"versionNumber:" : "JS 6/16/2016 18:17" } } |
14 changes: 14 additions & 0 deletions
14
packages/Algernon.package/ALGInstallation.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Algernon", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
"Instance" ], | ||
"commentStamp" : "JS 6/16/2016 18:19", | ||
"instvars" : [ | ||
"versionNumber" ], | ||
"name" : "ALGInstallation", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
8 changes: 8 additions & 0 deletions
8
packages/AlgernonTests.package/ALGTestInstallation.class/instance/testUpgrade.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
testing | ||
testUpgrade | ||
|
||
| installation | | ||
installation := ALGInstallation new. | ||
installation versionNumber: installation latestVersion - 1. | ||
installation upgrade. | ||
self assert: installation versionNumber equals: installation latestVersion |
5 changes: 5 additions & 0 deletions
5
packages/AlgernonTests.package/ALGTestInstallation.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"testUpgrade" : "JS 6/16/2016 19:37" } } |
14 changes: 14 additions & 0 deletions
14
packages/AlgernonTests.package/ALGTestInstallation.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "AlgernonTests", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "ALGTestInstallation", | ||
"pools" : [ | ||
], | ||
"super" : "TestCase", | ||
"type" : "normal" } |
Large diffs are not rendered by default.
Oops, something went wrong.