X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Grease',
#directory : 'repository',
#load : [ 'Tests' ],
#platforms : [ #squeak, #pharo ]
},
SCIMetacelloLoadSpec {
#baseline : 'Grease',
#directory : 'repository',
#onWarningLog : true,
#load : [ 'Tests' ],
#platforms : [ #gemstone ]
}
]
}
43 changes: 17 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
language: erlang

env:

- ST=Pharo-1.4 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=Pharo-2.0 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=Pharo-3.0 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=Pharo-4.0 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=Squeak-4.4 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=Squeak-4.5 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=GemStone-2.4.4.2 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=GemStone-3.1.0.6 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"
- ST=GemStone-3.2.2 BASELINE=Grease LOADS="'Tests'" REPOSITORY="filetree://${TRAVIS_BUILD_DIR}/repository"

install:

- export PROJECT_HOME="$(pwd)"
- cd $HOME
- wget -q -O builderCI.zip https://github.com/dalehenrich/builderCI/zipball/master
- unzip -q builderCI.zip
- cd dalehenrich-builderCI*
- source build_env_vars
- ln -s $PROJECT_HOME $GIT_PATH
- ./build_image.sh

script: $PROJECT_HOME/tests/testTravisCI.sh -verbose
language: smalltalk
sudo: false
smalltalk:
- Pharo-6.0
- Pharo-5.0
- Pharo-4.0
- Pharo-3.0
- Squeak-5.1
- Squeak-5.0
- Squeak-4.6
- Squeak-4.5
- GemStone-3.1.0.6
- GemStone-3.2.12
- GemStone-3.3.0
cache:
directories:
- $SMALLTALK_CI_CACHE
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ The Grease Portability Library [![Build Status](https://travis-ci.org/SeasideSt

The main repository of Grease is on Smalltalkhub: (http://www.smalltalkhub.com/#!/~Seaside/Grease11). This repository mirrors it.

The Travis CI builds currently test Grease for Pharo1.4, Pharo2.0, Pharo3.0, Pharo4.0, Squeak 4.4, Squeak 4.5, Gemstone 2.4.4.1, Gemstone 3.1.0.6 and Gemstone 3.2.2

Grease enhances the ANSI Smalltalk standard. With only a few exceptions, we assume platforms are fully ANSI-compliant. Platforms want to support Seaside and standardization makes this easier for the project’s developers and its porters.

Grease defines expected APIs with unit tests. Platforms can quickly determine if they are compatible and users can examine the tests to determine exactly which behaviours they can count on.
Expand All @@ -17,9 +15,42 @@ Grease does not try to solve all problems. We are not testing Sockets or HTTP cl

Grease is widely adopted. Implementations exist already for all platforms that support Seaside 3.x. As well as Seaside, new versions of Magritte, Pier, and Monticello are already being implemented on top of Grease.

##GemStone Installation
##Travis builds

The [Travis CI builds](https://travis-ci.org/SeasideSt/Grease) currently test Grease for the following platforms and versions:

| Squeak | Pharo | GemStone |
| --------------- | ---------------- | -------------------- |
| Squeak 5.0 | Pharo 5.0 | GemStone 3.3.0 |
| Squeak 4.5 | Pharo 4.0 | GemStone 3.2.12 |
| | Pharo 3.0 | GemStone 3.1.0.6 |

##Installation

###Squeak and Pharo

Make sure you have the [MetacelloPreview version](https://github.com/dalehenrich/metacello-work), otherwise the load will not work. You have two options for loading: from Smalltalkhub or from Github.

Load from Smalltalkhub:
```Smalltalk
Metacello new
configuration: 'Grease';
repository: 'http://www.smalltalkhub.com/mc/Seaside/MetacelloConfigurations/main';
version: #stable;
load
```
-or-
Load from: Github:
```Smalltalk
Metacello new
baseline: 'Grease';
githubUser: 'SeasideSt' project: 'Grease' commitish: '' path: 'repository';
load
```
###GemStone

GsUpgrader works on all versions of GemStone against all Versions of GLASS:
Grease is part of the GLASS setup. You can upgrade your version of Grease using [GsUpgrader](https://github.com/GsDevKit/gsUpgrader).
GsUpgrader works on all versions of GemStone against all versions of GLASS:

```Smalltalk
Gofer new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ baseline: spec
group: 'Tests' with: #('Core Tests' 'Slime Tests');
group: 'default' with: #('Slime') ].
spec
for: #'squeak'
for: #'squeak4.x'
do: [
spec
package: 'Grease-Core'
Expand All @@ -31,6 +31,21 @@ baseline: spec
package: 'Grease-Tests-Squeak-Core'
with: [ spec requires: #('Grease-Tests-Pharo-Core') ].
self slimeForSqueakPharo1xPharo2x: spec ].
spec
for: #'squeak5.x'
do: [
spec
package: 'Grease-Core'
with: [ spec includes: #('Grease-Squeak5-Core') ];
package: 'Grease-Tests-Core'
with: [ spec includes: #('Grease-Tests-Squeak-Core' 'Grease-Tests-Squeak5-Core') ];
package: 'Grease-Squeak5-Core'
with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Tests-Squeak-Core'
with: [ spec requires: #('Grease-Tests-Core') ];
package: 'Grease-Tests-Squeak5-Core'
with: [ spec requires: #('Grease-Tests-Squeak-Core') ].
self slimeForSqueakPharo1xPharo2x: spec ].
spec
for: #'pharo1.0'
do: [
Expand Down Expand Up @@ -86,7 +101,7 @@ baseline: spec
group: 'Slime' with: #('Grease-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ].
spec
for: #'pharo4.x'
for: #(#'pharo4.x' #'pharo5.x')
do: [
spec
package: 'Grease-Core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
},
"instance" : {
"baseline:" : "dkh 05/26/2015 11:45",
"baseline:" : "JohanBrichau 2/27/2016 13:46",
"initializeLatin1ToUtf8Encodings" : "JohanBrichau 10/19/2014 10:00",
"slimeForSqueakPharo1xPharo2x:" : "JohanBrichau 02/16/2014 03:49" } }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SystemOrganization addCategory: #'BaselineOfGrease'!
SystemOrganization addCategory: #BaselineOfGrease!
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'BaselineOfGrease-dkh.9' message 'Update baseline for GemStone 3.3' id 'af9364dd-14bc-4e5e-9fc7-0abe08732ab2' date '05/26/2015' time '11:46:07' author 'dkh' ancestors ((name 'BaselineOfGrease-JohanBrichau.8' message 'separate package for Squeak' id '91c019c7-2b8b-40c3-97d9-2047a69512a7' date '03/22/2015' time '12:01:37' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.7' message 'included Pharo 4 and did some baseline formatting' id '3722041d-d4b5-4496-a25a-0e891fe9a945' date '11/08/2014' time '09:28:01' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.6' message 'added initializeLatin1ToUtf8Encodings' id '4d976044-1aa9-44b6-bab0-b66ac758b3cd' date '10/19/2014' time '10:05:25' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.6' message 'added initializeLatin1ToUtf8Encodings' id 'b4ac5766-d472-4557-beff-59e5b733bce0' date '10/19/2014' time '10:04:55' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-dkh.5' message 'typoe' id '93eb3230-7956-4a6e-85dc-243f3dd895a1' date '06/04/2014' time '15:13:26' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.4' message 'woops specified the package branch incorrectly ... I think I got it right this time...' id '3003ee31-9d17-4dd1-9b9a-f8a80e4f0ba1' date '06/04/2014' time '15:12:31' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.3' message 'add Grease-Tests-GemStone-Core.v32 to baseline' id '26f128ca-b62e-4295-9a58-a9758b670c37' date '06/04/2014' time '14:57:48' author 'dkh' ancestors ((name 'BaselineOfGrease-JohanBrichau.2' message 'forgotten methods' id '38758da9-c922-4530-a19e-f8783900e787' date '02/16/2014' time '03:50:22' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.1' message 'first baseline' id 'b89398df-14c6-4b6a-a2ba-91ad806bb07f' date '02/16/2014' time '01:49:46' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'BaselineOfGrease-JohanBrichau.14' message 'Ensure Squeak5 tests package is loaded in Squeak5' id 'abde1bd6-a8d6-45fc-a922-bcf63ec38f03' date '27 February 2016' time '1:47:23.046532 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.13' message 'Forked Grease-Tests-Pharo-Core into Grease-Tests-Squeak5-Core' id '3a01ebbc-8859-45db-ae5a-e5de8073d3a4' date '27 February 2016' time '1:40:18.726436 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.12' message 'added Pharo-Tests to Squeak5 load' id 'ffe11ade-e4f1-496d-ae59-74543cfad134' date '27 February 2016' time '1:21:56.832518 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.11' message 'added pharo5 platform to baseline' id '5c0332e9-ef4c-43cd-9066-7c9fe9ed6506' date '27 February 2016' time '12:12:12.067693 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.10' message 'added squeak 5 platform' id '18f9d568-869f-4550-804a-b0ba101f33f3' date '13 December 2015' time '8:36:25.150207 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-dkh.9' message 'Update baseline for GemStone 3.3' id 'af9364dd-14bc-4e5e-9fc7-0abe08732ab2' date '26 May 2015' time '11:46:07 am' author 'dkh' ancestors ((name 'BaselineOfGrease-JohanBrichau.8' message 'separate package for Squeak' id '91c019c7-2b8b-40c3-97d9-2047a69512a7' date '22 March 2015' time '12:01:37 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.7' message 'included Pharo 4 and did some baseline formatting' id '3722041d-d4b5-4496-a25a-0e891fe9a945' date '8 November 2014' time '9:28:01 am' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.6' message 'added initializeLatin1ToUtf8Encodings' id '4d976044-1aa9-44b6-bab0-b66ac758b3cd' date '19 October 2014' time '10:05:25 am' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.6' message 'added initializeLatin1ToUtf8Encodings' id 'b4ac5766-d472-4557-beff-59e5b733bce0' date '19 October 2014' time '10:04:55 am' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-dkh.5' message 'typoe' id '93eb3230-7956-4a6e-85dc-243f3dd895a1' date '4 June 2014' time '3:13:26 pm' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.4' message 'woops specified the package branch incorrectly ... I think I got it right this time...' id '3003ee31-9d17-4dd1-9b9a-f8a80e4f0ba1' date '4 June 2014' time '3:12:31 pm' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.3' message 'add Grease-Tests-GemStone-Core.v32 to baseline' id '26f128ca-b62e-4295-9a58-a9758b670c37' date '4 June 2014' time '2:57:48 pm' author 'dkh' ancestors ((name 'BaselineOfGrease-JohanBrichau.2' message 'forgotten methods' id '38758da9-c922-4530-a19e-f8783900e787' date '16 February 2014' time '3:50:22 am' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.1' message 'first baseline' id 'b89398df-14c6-4b6a-a2ba-91ad806bb07f' date '16 February 2014' time '1:49:46 am' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
adding
add: anAssociation
self privateAt: anAssociation key put: anAssociation value.
^ anAssociation
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
adding
addAll: aDictionary
aDictionary keysAndValuesDo: [ :key :value |
self privateAt: key put: value ].
^ aDictionary
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
accessing
allAt: aKey
^ Array streamContents: [ :stream |
1 to: size do: [ :index |
(keys at: index) = aKey
ifTrue: [ stream nextPut: (values at: index) ] ] ]
^ self privateAllAt: aKey startingAt: 1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
adding
at: aKey add: aValue
"Add an association between aKey and aValue. Do not replace existing
values with the same key."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
enumerating
keysAndAllValuesDo: aTwoArgumentBlock
| seenKeys |
seenKeys := GRSmallOrderedSet new.
1 to: size * 2 - 1 by: 2 do: [ :index |
| key |
key := table at: index.
(seenKeys includes: key) ifFalse: [
aTwoArgumentBlock
value: key
value: (self privateAllAt: key startingAt: index).
seenKeys add: key ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
private
privateAllAt: aKey startingAt: index
^ Array new: 2 streamContents: [ :stream |
index to: size * 2 - 1 by: 2 do: [ :i |
(table at: i) = aKey
ifTrue: [ stream nextPut: (table at: i + 1) ] ] ]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
accessing
removing
removeKey: aKey ifAbsent: aBlock
"Remove aKey from the receiver, evaluate aBlock if the element is missing."

"This is inefficient and could be optimized."
| removed |
removed := Array streamContents: [ :stream |
removed := Array new: 2 streamContents: [ :stream |
| index |
[ (index := self findIndexFor: aKey) = 0 ] whileFalse: [
stream nextPut: (self removeIndex: index) ] ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
},
"instance" : {
"add:" : "lr 7/25/2011 19:52",
"allAt:" : "jf 2/15/2010 15:39",
"addAll:" : "pmm 8/25/2016 12:32",
"allAt:" : "pmm 8/25/2016 15:09",
"allAt:ifAbsent:" : "jf 2/15/2010 15:39",
"at:add:" : "jf 2/15/2010 13:24",
"removeKey:ifAbsent:" : "jf 2/15/2010 14:43" } }
"keysAndAllValuesDo:" : "pmm 8/25/2016 15:12",
"privateAllAt:startingAt:" : "pmm 8/25/2016 15:08",
"removeKey:ifAbsent:" : "pmm 8/22/2016 12:10" } }
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ resolveWith: aDictionary
aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo30-') ifAbsent: [
"try -Pharo40-"
aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo40-') ifAbsent: [
self error: self name printString , ' depends on unknown package ' , each printString ] ] ] ] ] ]
"try -Pharo50-"
aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo50-') ifAbsent: [
"try -Squeak-"
aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Squeak-') ifAbsent: [
"try -Squeak5-"
aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Squeak5-') ifAbsent: [
self error: self name printString , ' depends on unknown package ' , each printString ] ] ] ] ] ] ] ] ]
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name" : "lr 2/17/2010 15:18",
"name:" : "lr 10/25/2009 11:26",
"printOn:" : "merged 10/20/2008 09:24",
"resolveWith:" : "jok 8/23/2014 10:59",
"resolveWith:" : "TravisCI 8/23/2016 10:48",
"seasideAddonsUrl" : "pmm 9/12/2013 15:59",
"seasideLGPLUrl" : "pmm 9/12/2013 15:59",
"seasideUrl" : "pmm 9/12/2013 15:58",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ version info
version
"Answer the Grease version"

^ (GRVersion major: 1 minor: 1 revision: 10)
^ (GRVersion major: 1 minor: 2 revision: 8)
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"semaphoreClass" : "jf 1/22/2009 02:10",
"stackDepth" : "jf 1/22/2009 02:11",
"terminateProcess:" : "jf 2/6/2009 16:00",
"version" : "JohanBrichau 7/20/2014 17:51",
"version" : "JohanBrichau 5/5/2016 12:55",
"versionString" : "jf 2/9/2010 00:57",
"weakDictionaryOfSize:" : "jf 1/22/2009 02:11",
"write:toFile:inFolder:" : "pmm 8/19/2014 10:11",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
I am an implementation of a dictionary. Compared to other dictionaries I am very efficient for small sizes, speed- and space-wise. I also mantain the order in which elements are added when iterating. My implementation features some ideas from the RefactoringBrowser.
I am an implementation of a dictionary. Compared to other dictionaries I am very efficient for small sizes, speed- and space-wise. I also mantain the order in which elements are added when iterating. My implementation features some ideas from the RefactoringBrowser and others from Eclipse Collections.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
adding
add: anAssociation
self at: anAssociation key put: anAssociation value.
^ anAssociation
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
adding
addAll: aDictionary
aDictionary keysAndValuesDo: [ :key :value | self add: key -> value ].
aDictionary keysAndValuesDo: [ :key :value | self at: key put: value ].
^ aDictionary
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ at: aKey ifAbsent: aBlock
| index |
index := self findIndexFor: aKey.
^ index = 0
ifFalse: [ values at: index ]
ifFalse: [ table at: index + 1 ]
ifTrue: [ aBlock value ]
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ at: aKey ifAbsentPut: aBlock
| index |
index := self findIndexFor: aKey.
^ index = 0
ifFalse: [ values at: index ]
ifFalse: [ table at: index + 1 ]
ifTrue: [ self privateAt: aKey put: aBlock value ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ at: aKey ifPresent: aBlock

| index |
index := self findIndexFor: aKey.
^ index = 0 ifFalse: [ aBlock value: (values at: index) ]
^ index = 0 ifFalse: [ aBlock value: (table at: index + 1) ]
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ at: aKey put: aValue
| index |
index := self findIndexFor: aKey.
^ index = 0
ifFalse: [ values at: index put: aValue ]
ifFalse: [ table at: index + 1 put: aValue ]
ifTrue: [ self privateAt: aKey put: aValue ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
enumerating
do: aBlock
1 to: size do: [ :index | aBlock value: (values at: index) ]
2 to: size * 2 by: 2 do: [ :index |
aBlock value: (table at: index) ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
private
findIndexFor: aKey
1 to: size do: [ :index |
(keys at: index) = aKey
1 to: size * 2 - 1 by: 2 do: [ :index |
(table at: index) = aKey
ifTrue: [ ^ index ] ].
^ 0
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
private
grow
| newKeys newValues |
newKeys := Array new: 2 * size.
newValues := Array new: 2 * size.
1 to: size do: [ :index |
newKeys at: index put: (keys at: index).
newValues at: index put: (values at: index) ].
keys := newKeys.
values := newValues
| newTable |
"#replaceFrom:to:with:startingAt: would be better but not portable"
newTable := Array new: 4 * size.
1 to: size * 2 do: [ :index |
newTable at: index put: (table at: index) ].
table := newTable
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ initialization
initialize: anInteger
self initialize.
size := 0.
keys := Array new: anInteger.
values := Array new: anInteger
table := Array new: anInteger * 2
Loading
X Tutup