Skip to content

Commit

Permalink
Implemented Binding
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Mar 16, 2017
1 parent 36d91f3 commit a111af2
Show file tree
Hide file tree
Showing 40 changed files with 178 additions and 5 deletions.
Expand Up @@ -6,8 +6,10 @@ baseline: spec
for: #common
do: [ spec
package: 'Buoy';
package: 'Buoy-Tests' with: [ spec requires: 'Buoy' ].
package: 'Buoy-Tests' with: [ spec requires: 'Buoy' ];
package: 'Buoy-Dynamic-Binding';
package: 'Buoy-Dynamic-Binding-Tests' with: [ spec requires: 'Buoy-Dynamic-Binding' ].
spec
group: 'Deployment' with: #('Buoy');
group: 'Development' with: #('Deployment' 'Buoy-Tests');
group: 'Deployment' with: #('Buoy' 'Buoy-Dynamic-Binding');
group: 'Development' with: #('Deployment' 'Buoy-Tests' 'Buoy-Dynamic-Binding-Tests');
group: 'default' with: #('Deployment') ]
@@ -1,6 +1,6 @@
{
"instance" : {
"baseline:" : "GabrielOmarCotelli 1/26/2017 19:41"
"baseline:" : "GabrielOmarCotelli 3/15/2017 16:47"
},
"class" : { }
}
2 changes: 1 addition & 1 deletion source/BaselineOfBuoy.package/monticello.meta/version
@@ -1 +1 @@
(name 'BaselineOfBuoy-GabrielOmarCotelli.3' message 'Renamed a method' id 'd5ded4e0-e1da-4012-9820-ba8d7660503d' date '26 January 2017' time '7:52:00.732487 pm' author 'GabrielOmarCotelli' ancestors ((name 'BaselineOfBuoy-GabrielOmarCotelli.2' message 'Fixed baseline' id 'f98545ba-2938-4f1d-a9cf-bcc50f795618' date '26 January 2017' time '7:41:40.33839 pm' author 'GabrielOmarCotelli' ancestors ((name 'BaselineOfBuoy-GabrielOmarCotelli.1' message 'Renamed packages' id '7025211b-51c4-4db3-adcd-d8fe28315704' date '26 January 2017' time '7:29:54.026429 pm' author 'GabrielOmarCotelli' ancestors () stepChildren ())) stepChildren ())) stepChildren ())
(name 'BaselineOfBuoy-GabrielOmarCotelli.4' message 'Updated Baseline to include new packages' id '41e46af6-2b07-0d00-9c09-cc4d0dc74540' date '15 March 2017' time '4:48:16.427317 pm' author 'GabrielOmarCotelli' ancestors ((name 'BaselineOfBuoy-GabrielOmarCotelli.3' message 'Renamed a method' id 'd5ded4e0-e1da-4012-9820-ba8d7660503d' date '26 January 2017' time '7:52:00.732487 pm' author 'GabrielOmarCotelli' ancestors ((name 'BaselineOfBuoy-GabrielOmarCotelli.2' message 'Fixed baseline' id 'f98545ba-2938-4f1d-a9cf-bcc50f795618' date '26 January 2017' time '7:41:40.33839 pm' author 'GabrielOmarCotelli' ancestors ((name 'BaselineOfBuoy-GabrielOmarCotelli.1' message 'Renamed packages' id '7025211b-51c4-4db3-adcd-d8fe28315704' date '26 January 2017' time '7:29:54.026429 pm' author 'GabrielOmarCotelli' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
5 changes: 5 additions & 0 deletions source/Buoy-Dynamic-Binding-Tests.package/.filetree
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Empty file.
@@ -0,0 +1,8 @@
tests
testBoundObjectWhenBound

| boundObject |

boundObject := Binding to: 1.

self assert: boundObject content equals: 1
@@ -0,0 +1,12 @@
tests
testUnbound

| unbound explanation |

explanation := 'Parameter not yet configured'.
unbound := Binding unboundBecause: explanation.

self
should: [ unbound content ]
raise: AssertionFailed
withExceptionDo: [ :error | self assert: error messageText equals: explanation ]
@@ -0,0 +1,7 @@
{
"instance" : {
"testBoundObjectWhenBound" : "GabrielOmarCotelli 3/15/2017 15:35",
"testUnbound" : "GabrielOmarCotelli 3/15/2017 15:35"
},
"class" : { }
}
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "TestCase",
"category" : "Buoy-Dynamic-Binding-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BindingTest",
"type" : "normal"
}
@@ -0,0 +1 @@
SystemOrganization addCategory: #'Buoy-Dynamic-Binding-Tests'!
Empty file.
@@ -0,0 +1 @@
(name 'Buoy-Dynamic-Binding-Tests')
@@ -0,0 +1 @@
(name 'Buoy-Dynamic-Binding-Tests-GabrielOmarCotelli.1' message 'Add Binding' id 'c3216def-2b07-0d00-9c08-b1180dc74540' date '15 March 2017' time '4:46:19.133575 pm' author 'GabrielOmarCotelli' ancestors () stepChildren ())
1 change: 1 addition & 0 deletions source/Buoy-Dynamic-Binding-Tests.package/properties.json
@@ -0,0 +1 @@
{ }
5 changes: 5 additions & 0 deletions source/Buoy-Dynamic-Binding.package/.filetree
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
@@ -0,0 +1 @@
I'm an abstract class representing a binding.
@@ -0,0 +1,4 @@
Instance Creation
to: anObject

^BoundObject for: anObject
@@ -0,0 +1,4 @@
Instance Creation
unboundBecause: anExplanation

^ self unboundBecause: anExplanation raising: AssertionFailed
@@ -0,0 +1,4 @@
Instance Creation
unboundBecause: anExplanation raising: anErrorClass

^ self unboundBecauseAll: {anExplanation} raising: anErrorClass
@@ -0,0 +1,4 @@
Instance Creation
unboundBecauseAll: anExplanationCollection raising: anErrorClass

^ UnboundObject becauseAll: anExplanationCollection raising: anErrorClass
@@ -0,0 +1,4 @@
accessing
content

^self subclassResponsibility
@@ -0,0 +1,11 @@
{
"instance" : {
"content" : "GabrielOmarCotelli 3/15/2017 15:34"
},
"class" : {
"unboundBecause:" : "GabrielOmarCotelli 3/15/2017 15:30",
"unboundBecauseAll:raising:" : "GabrielOmarCotelli 3/15/2017 15:30",
"to:" : "GabrielOmarCotelli 3/15/2017 15:16",
"unboundBecause:raising:" : "GabrielOmarCotelli 3/15/2017 15:30"
}
}
11 changes: 11 additions & 0 deletions source/Buoy-Dynamic-Binding.package/Binding.class/properties.json
@@ -0,0 +1,11 @@
{
"commentStamp" : "GabrielOmarCotelli 3/15/2017 15:31",
"super" : "Object",
"category" : "Buoy-Dynamic-Binding",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "Binding",
"type" : "normal"
}
@@ -0,0 +1 @@
I represent a binding to some object, so I can return a content.
@@ -0,0 +1,4 @@
Instance Creation
for: anObject

^ self new initializeFor: anObject
@@ -0,0 +1,4 @@
Accessing
content

^ contents
@@ -0,0 +1,4 @@
initialize
initializeFor: anObject

contents := anObject
@@ -0,0 +1,9 @@
{
"instance" : {
"content" : "GabrielOmarCotelli 3/15/2017 15:34",
"initializeFor:" : "GabrielOmarCotelli 3/15/2017 15:17"
},
"class" : {
"for:" : "GabrielOmarCotelli 3/15/2017 15:30"
}
}
@@ -0,0 +1,13 @@
{
"commentStamp" : "GabrielOmarCotelli 3/15/2017 15:32",
"super" : "Binding",
"category" : "Buoy-Dynamic-Binding",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"contents"
],
"name" : "BoundObject",
"type" : "normal"
}
@@ -0,0 +1 @@
I represent an unbound object and will raise an error when asked about my contents
@@ -0,0 +1,4 @@
Instance Creation
becauseAll: anExplanationCollection raising: anErrorClass

^ self new initializeBecauseAll: anExplanationCollection raising: anErrorClass
@@ -0,0 +1,4 @@
Accessing
content

^errorClass signalAll: explanations
@@ -0,0 +1,5 @@
initialize
initializeBecauseAll: anExplanationCollection raising: anErrorClass

explanations := anExplanationCollection.
errorClass := anErrorClass
@@ -0,0 +1,9 @@
{
"instance" : {
"content" : "GabrielOmarCotelli 3/15/2017 15:34",
"initializeBecauseAll:raising:" : "GabrielOmarCotelli 3/15/2017 16:39"
},
"class" : {
"becauseAll:raising:" : "GabrielOmarCotelli 3/15/2017 15:31"
}
}
@@ -0,0 +1,14 @@
{
"commentStamp" : "GabrielOmarCotelli 3/15/2017 15:32",
"super" : "Binding",
"category" : "Buoy-Dynamic-Binding",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"errorClass",
"explanations"
],
"name" : "UnboundObject",
"type" : "normal"
}
@@ -0,0 +1 @@
SystemOrganization addCategory: #'Buoy-Dynamic-Binding'!
Empty file.
@@ -0,0 +1 @@
(name 'Buoy-Dynamic-Binding')
@@ -0,0 +1 @@
(name 'Buoy-Dynamic-Binding-GabrielOmarCotelli.1' message 'Add Binding' id '1d891bee-2b07-0d00-9c07-90ae0dc74540' date '15 March 2017' time '4:45:57.00884 pm' author 'GabrielOmarCotelli' ancestors () stepChildren ())
1 change: 1 addition & 0 deletions source/Buoy-Dynamic-Binding.package/properties.json
@@ -0,0 +1 @@
{ }

0 comments on commit a111af2

Please sign in to comment.