X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ smalltalk:
- 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
- GemStone-3.2.16
- GemStone-3.3.4
cache:
directories:
- $SMALLTALK_CI_CACHE
matrix:
allow_failures:
- smalltalk: Pharo-6.0
#matrix:
# allow_failures:
# - smalltalk: Pharo-6.0
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ 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.

##Travis builds
## 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 |
| Squeak 5.1 | Pharo 6.0 | GemStone 3.3.4 |
| | Pharo 5.0 | GemStone 3.2.16 |
| | Pharo 4.0 | GemStone 3.1.0.6 |
| | Pharo 3.0 | |

##Installation
## Installation

###Squeak and Pharo
### 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.

Expand All @@ -47,7 +48,7 @@ Metacello new
githubUser: 'SeasideSt' project: 'Grease' commitish: '' path: 'repository';
load
```
###GemStone
### GemStone

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:
Expand Down
5 changes: 3 additions & 2 deletions repository/BaselineOfGrease.package/.filetree
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,25 @@ baseline: spec
spec
group: 'Slime' with: #('Grease-Pharo40-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ].
spec
for: #(#'pharo6.x')
do: [
spec
package: 'Grease-Core'
with: [ spec includes: #('Grease-Pharo60-Core') ];
package: 'Grease-Tests-Core'
with: [ spec includes: #('Grease-Tests-Pharo20-Core') ];
package: 'Grease-Pharo60-Core'
with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Tests-Pharo20-Core'
with: [ spec requires: #('Grease-Tests-Core') ];
package: 'Grease-Pharo40-Slime'
with: [ spec requires: #('Grease-Core') ];
package: 'Grease-Tests-Slime'
with: [ spec requires: #('Grease-Pharo40-Slime') ].
spec
group: 'Slime' with: #('Grease-Pharo40-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ].
spec
for: #'gemstone'
do: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"class" : {
},
"instance" : {
"baseline:" : "JohanBrichau 2/27/2016 13:46",
"initializeLatin1ToUtf8Encodings" : "JohanBrichau 10/19/2014 10:00",
"slimeForSqueakPharo1xPharo2x:" : "JohanBrichau 02/16/2014 03:49" } }
"slimeForSqueakPharo1xPharo2x:" : "JohanBrichau 02/16/2014 03:49",
"baseline:" : "JohanBrichau 5/25/2017 12:45"
},
"class" : { }
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "BaselineOfGrease",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "BaselineOfGrease",
"pools" : [
],
"super" : "BaselineOf",
"type" : "normal" }
"category" : "BaselineOfGrease",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BaselineOfGrease",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'BaselineOfGrease-dkh.16' message 'merged by GitFileTree-MergeDriver' id '644ab134-dd42-4b9f-948b-c277cd963d5d' date '26 August 2016' time '5:20:50.221776 am' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.15' message 'merged by GitFileTree-MergeDriver' id '86b6f4f6-f95f-4bd7-9224-f31c5460e354' date '4 April 2016' time '9:40:53.04415 am' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.10' message 'update for GemStone 3.4 ...' id 'ad7f9331-d83f-4976-bf57-1d1e81111fc6' date '21 December 2015' time '3:07:11 pm' author 'dkh' 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 ())(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 ((id 'af9364dd-14bc-4e5e-9fc7-0abe08732ab2')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'BaselineOfGrease-dkh.15' message 'merged by GitFileTree-MergeDriver' id '415af41c-2c3d-40a8-9f75-d9e8de921224' date '26 August 2016' time '2:19:29.551006 pm' author 'dkh' ancestors ((id 'ad7f9331-d83f-4976-bf57-1d1e81111fc6')(id 'abde1bd6-a8d6-45fc-a922-bcf63ec38f03')) stepChildren ())) stepChildren ())
(name 'BaselineOfGrease-JohanBrichau.18' message 'Pharo 6 compatibility' id 'd2d614aa-b80c-0d00-b4b6-ae9900bfc9db' date '25 May 2017' time '12:46:04.246978 pm' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-JohanBrichau.17' message 'Added pharo6' id '52335469-982c-483b-a975-4518820b9bcf' date '25 May 2017' time '11:20:35.004053 am' author 'JohanBrichau' ancestors ((name 'BaselineOfGrease-dkh.16' message 'merged by GitFileTree-MergeDriver' id '644ab134-dd42-4b9f-948b-c277cd963d5d' date '26 August 2016' time '5:20:50.221776 am' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.15' message 'merged by GitFileTree-MergeDriver' id '86b6f4f6-f95f-4bd7-9224-f31c5460e354' date '4 April 2016' time '9:40:53.04415 am' author 'dkh' ancestors ((name 'BaselineOfGrease-dkh.10' message 'update for GemStone 3.4 ...' id 'ad7f9331-d83f-4976-bf57-1d1e81111fc6' date '21 December 2015' time '3:07:11 pm' author 'dkh' 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 ())(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 ((id 'af9364dd-14bc-4e5e-9fc7-0abe08732ab2')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'BaselineOfGrease-dkh.15' message 'merged by GitFileTree-MergeDriver' id '415af41c-2c3d-40a8-9f75-d9e8de921224' date '26 August 2016' time '2:19:29.551006 pm' author 'dkh' ancestors ((id 'ad7f9331-d83f-4976-bf57-1d1e81111fc6')(id 'abde1bd6-a8d6-45fc-a922-bcf63ec38f03')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
3 changes: 1 addition & 2 deletions repository/BaselineOfGrease.package/properties.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{
}
{ }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
adding
accessing
add: anAssociation
self privateAt: anAssociation key put: anAssociation value.
^ anAssociation
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
adding
"protocol: adding"
addAll: aDictionary
aDictionary keysAndValuesDo: [ :key :value |
self privateAt: key put: value ].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
accessing
allAt: aKey
^ self privateAllAt: aKey startingAt: 1
^ Array streamContents: [ :stream |
1 to: size do: [ :index |
(keys at: index) = aKey
ifTrue: [ stream nextPut: (values at: index) ] ] ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
adding
accessing
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
Expand Up @@ -2,9 +2,9 @@ enumerating
keysAndAllValuesDo: aTwoArgumentBlock
| seenKeys |
seenKeys := GRSmallOrderedSet new.
1 to: size * 2 - 1 by: 2 do: [ :index |
1 to: size do: [ :index |
| key |
key := table at: index.
key := keys at: index.
(seenKeys includes: key) ifFalse: [
aTwoArgumentBlock
value: key
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
private
privateAllAt: aKey startingAt: index
private
privateAllAt: aKey startingAt: aStartInteger
^ 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) ] ] ]
aStartInteger to: size do: [ :index |
(keys at: index) = aKey
ifTrue: [ stream nextPut: (values at: index) ] ] ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
removing
accessing
removeKey: aKey ifAbsent: aBlock
"Remove aKey from the receiver, evaluate aBlock if the element is missing."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
},
"instance" : {
"add:" : "lr 7/25/2011 19:52",
"addAll:" : "pmm 8/25/2016 12:32",
"allAt:" : "pmm 8/25/2016 15:09",
"addAll:" : "pmm 8/26/2016 15:57",
"allAt:" : "jf 2/15/2010 15:39",
"allAt:ifAbsent:" : "jf 2/15/2010 15:39",
"at:add:" : "jf 2/15/2010 13:24",
"keysAndAllValuesDo:" : "pmm 8/25/2016 15:12",
"privateAllAt:startingAt:" : "pmm 8/25/2016 15:08",
"removeKey:ifAbsent:" : "pmm 8/22/2016 12:10" } }
"keysAndAllValuesDo:" : "pmm 8/26/2016 15:52",
"privateAllAt:startingAt:" : "pmm 8/26/2016 15:52",
"removeKey:ifAbsent:" : "pmm 8/26/2016 15:56" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am an implementation of an ordered multi-map. I allow multiple values to be associated with the same key and maintain the order of addition. #at: and its derivatives all operate on the first matching key, while #allAt: returns the complete list of values for a key in the order they were added.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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
@@ -0,0 +1,3 @@
accessing
allAt: aKey
^ self privateAllAt: aKey startingAt: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
allAt: aKey ifAbsent: absentBlock
| results |
results := self allAt: aKey.
^ results isEmpty
ifTrue: [ absentBlock value ]
ifFalse: [ results ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
adding
at: aKey add: aValue
"Add an association between aKey and aValue. Do not replace existing
values with the same key."

^ self privateAt: aKey put: aValue
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
@@ -0,0 +1,13 @@
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 new: 2 streamContents: [ :stream |
| index |
[ (index := self findIndexFor: aKey) = 0 ] whileFalse: [
stream nextPut: (self removeIndex: index) ] ].
^ removed isEmpty
ifTrue: [ aBlock value ]
ifFalse: [ removed ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"class" : {
},
"instance" : {
"add:" : "lr 7/25/2011 19:52",
"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",
"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
@@ -0,0 +1,14 @@
{
"category" : "Grease-Core-Collections",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "jf 2/15/2010 16:04",
"instvars" : [
],
"name" : "GROrderedMultiMap2",
"pools" : [
],
"super" : "GRSmallDictionary2",
"type" : "normal" }
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: 2 revision: 8)
^ (GRVersion major: 1 minor: 3 revision: 0)
yourself
Loading
X Tutup