- CypressPackageReader
authorjv
Mon, 03 Sep 2012 11:09:18 +0000
changeset 8 5d48f4894483
parent 7 dce8e52bd7ea
child 9 f3dbb42d4e97
- CypressPackageReader comment/format in: #readClassStructureFromEntry: - CypressPackageStructure added: #asChangeSet - CypressClassStructure changed: #changesOn: - CypressMethodStructure changed: #changesOn: #classStructure: - stx_goodies_cypress changed: #classNamesAndAttributes #extensionMethodNames #preRequisites - extensions ...
CypressClassStructure.st
CypressMethodStructure.st
CypressPackageReader.st
CypressPackageStructure.st
Make.proto
bc.mak
cypress.rc
extensions.st
stx_goodies_cypress.st
--- a/CypressClassStructure.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/CypressClassStructure.st	Mon Sep 03 11:09:18 2012 +0000
@@ -131,13 +131,15 @@
         def instanceVariableNames: (String streamContents:[:s|((properties at: #instvars ifAbsent:[#()])) do:[:i|s nextPutAll:i; space]]).
         def classInstanceVariableNames: (String streamContents:[:s|((properties at: #classinstvars ifAbsent:[#()]) ) do:[:i|s nextPutAll:i; space]]).
         def classVariableNames: (String streamContents:[:s|((properties at: #classvars ifAbsent:[#()] ) ) do:[:i|s nextPutAll:i; space]]).
+        def package: packageStructure name asSymbol.
+        def category: (properties at: #category).
         aStream nextPut: def.
     ].
 
     instanceMethods ? #() do:[:each|each changesOn: aStream].
     classMethods ? #()  do:[:each|each changesOn: aStream].
 
-    "Modified: / 31-08-2012 / 19:23:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-09-2012 / 11:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CypressClassStructure methodsFor:'initialization'!
--- a/CypressMethodStructure.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/CypressMethodStructure.st	Mon Sep 03 11:09:18 2012 +0000
@@ -37,7 +37,10 @@
 !
 
 classStructure: aCypressClassStructure
-	classStructure := aCypressClassStructure
+        classStructure := aCypressClassStructure.
+        packageStructure := aCypressClassStructure packageStructure.
+
+    "Modified: / 03-09-2012 / 11:34:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cypressSource
@@ -133,10 +136,11 @@
     parser := Parser parseMethodSpecification: source. 
     change selector: parser selector.
     change source: source.
+    change package: packageStructure name asSymbol.
 
     aStream nextPut: change
 
-    "Modified: / 31-08-2012 / 19:25:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-09-2012 / 11:09:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CypressMethodStructure methodsFor:'initialization'!
--- a/CypressPackageReader.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/CypressPackageReader.st	Mon Sep 03 11:09:18 2012 +0000
@@ -23,21 +23,6 @@
     "Created: / 30-08-2012 / 14:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!CypressPackageReader class methodsFor:'services'!
-
-installAsCodePackage: aCypressPackageDirectory
-	"
-	For example:
-		CypressPackageReader installAsCodePackage: (FileDirectory default directoryNamed: 'Cypress-Mocks.package')
-	"
-	| reader cypressStructure incomingSnapshot |
-	reader _ CypressPackageReader readPackageStructureFrom: aCypressPackageDirectory.
-	cypressStructure _ reader packageStructure.
-	incomingSnapshot _ cypressStructure snapshot.
-	incomingSnapshot updatePackage: (CypressPackageDefinition new name: cypressStructure packageName).
-	CodePackage named: cypressStructure packageName createIfAbsent: true registerIfNew: true
-! !
-
 !CypressPackageReader methodsFor:'accessing'!
 
 packageDirectory
@@ -99,6 +84,7 @@
 
 readClassStructureFromEntry: classEntry
         | classDirectory methodPropertiesDict classPropertiesDict classComment entries classStructure propertyEntry |
+
         classDirectory := classEntry asFilename.
         entries := classDirectory directoryContentsAsFilenames.
         propertyEntry := entries detect: [ :entry | entry baseName = 'properties.json' ] ifNone: [ nil ] .
@@ -120,6 +106,7 @@
         ^ classStructure.
 
     "Modified: / 31-08-2012 / 19:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 03-09-2012 / 11:32:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 readExtensionClassStructureFromEntry: classEntry
--- a/CypressPackageStructure.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/CypressPackageStructure.st	Mon Sep 03 11:09:18 2012 +0000
@@ -55,6 +55,16 @@
 
 !CypressPackageStructure methodsFor:'converting'!
 
+asChangeSet
+    | changeset |
+
+    changeset := super asChangeSet.
+    changeset name: (self name , ' (loaded from Cypress)').
+    ^changeset
+
+    "Created: / 03-09-2012 / 11:52:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 changesOn:aStream
     "superclass CypressStructure says that I am responsible to implement this method"
 
--- a/Make.proto	Mon Sep 03 10:00:33 2012 +0000
+++ b/Make.proto	Mon Sep 03 11:09:18 2012 +0000
@@ -162,7 +162,7 @@
 $(OUTDIR)CypressModification.$(O) CypressModification.$(H): CypressModification.st $(INCLUDE_TOP)/stx/goodies/cypress/CypressPatchOperation.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)CypressPackageStructure.$(O) CypressPackageStructure.$(H): CypressPackageStructure.st $(INCLUDE_TOP)/stx/goodies/cypress/CypressStructure.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)CypressRemoval.$(O) CypressRemoval.$(H): CypressRemoval.st $(INCLUDE_TOP)/stx/goodies/cypress/CypressPatchOperation.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/CharacterArray.$(H) $(INCLUDE_TOP)/stx/libbasic/ByteArray.$(H) $(INCLUDE_TOP)/stx/libbasic/UninterpretedBytes.$(H) $(INCLUDE_TOP)/stx/libbasic/ArrayedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Array.$(H) $(INCLUDE_TOP)/stx/libbasic/Boolean.$(H) $(INCLUDE_TOP)/stx/libbasic/Character.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Class.$(H) $(INCLUDE_TOP)/stx/libbasic/ClassDescription.$(H) $(INCLUDE_TOP)/stx/libbasic/Behavior.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Number.$(H) $(INCLUDE_TOP)/stx/libbasic/ArithmeticValue.$(H) $(INCLUDE_TOP)/stx/libbasic/String.$(H) $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/CharacterArray.$(H) $(INCLUDE_TOP)/stx/libbasic/ByteArray.$(H) $(INCLUDE_TOP)/stx/libbasic/UninterpretedBytes.$(H) $(INCLUDE_TOP)/stx/libbasic/ArrayedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Array.$(H) $(INCLUDE_TOP)/stx/libbasic/Boolean.$(H) $(INCLUDE_TOP)/stx/libbasic/Character.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Class.$(H) $(INCLUDE_TOP)/stx/libbasic/ClassDescription.$(H) $(INCLUDE_TOP)/stx/libbasic/Behavior.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Number.$(H) $(INCLUDE_TOP)/stx/libbasic/ArithmeticValue.$(H) $(INCLUDE_TOP)/stx/libbasic/String.$(H) $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/bc.mak	Mon Sep 03 10:00:33 2012 +0000
+++ b/bc.mak	Mon Sep 03 11:09:18 2012 +0000
@@ -98,6 +98,6 @@
 $(OUTDIR)CypressModification.$(O) CypressModification.$(H): CypressModification.st $(INCLUDE_TOP)\stx\goodies\cypress\CypressPatchOperation.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)CypressPackageStructure.$(O) CypressPackageStructure.$(H): CypressPackageStructure.st $(INCLUDE_TOP)\stx\goodies\cypress\CypressStructure.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)CypressRemoval.$(O) CypressRemoval.$(H): CypressRemoval.st $(INCLUDE_TOP)\stx\goodies\cypress\CypressPatchOperation.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\CharacterArray.$(H) $(INCLUDE_TOP)\stx\libbasic\ByteArray.$(H) $(INCLUDE_TOP)\stx\libbasic\UninterpretedBytes.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Array.$(H) $(INCLUDE_TOP)\stx\libbasic\Boolean.$(H) $(INCLUDE_TOP)\stx\libbasic\Character.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Class.$(H) $(INCLUDE_TOP)\stx\libbasic\ClassDescription.$(H) $(INCLUDE_TOP)\stx\libbasic\Behavior.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Number.$(H) $(INCLUDE_TOP)\stx\libbasic\ArithmeticValue.$(H) $(INCLUDE_TOP)\stx\libbasic\String.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\CharacterArray.$(H) $(INCLUDE_TOP)\stx\libbasic\ByteArray.$(H) $(INCLUDE_TOP)\stx\libbasic\UninterpretedBytes.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Array.$(H) $(INCLUDE_TOP)\stx\libbasic\Boolean.$(H) $(INCLUDE_TOP)\stx\libbasic\Character.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Class.$(H) $(INCLUDE_TOP)\stx\libbasic\ClassDescription.$(H) $(INCLUDE_TOP)\stx\libbasic\Behavior.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Number.$(H) $(INCLUDE_TOP)\stx\libbasic\ArithmeticValue.$(H) $(INCLUDE_TOP)\stx\libbasic\String.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
--- a/cypress.rc	Mon Sep 03 10:00:33 2012 +0000
+++ b/cypress.rc	Mon Sep 03 11:09:18 2012 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.1\0"
-      VALUE "ProductDate", "Fri, 31 Aug 2012 18:32:14 GMT\0"
+      VALUE "ProductDate", "Mon, 03 Sep 2012 11:09:03 GMT\0"
     END
 
   END
--- a/extensions.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/extensions.st	Mon Sep 03 11:09:18 2012 +0000
@@ -86,6 +86,22 @@
 		comment: self comment
 ! !
 
+!ConfigurableFeatures class methodsFor:'queries-features'!
+
+hasCypressSupport
+    "Returns true, if Cypress support is loaded"
+
+    ^(Smalltalk at: #CypressPackageReader) notNil
+
+
+    "
+     ConfigurableFeatures hasCypressSupport              
+     ConfigurableFeatures includesFeature:#CypressSupport
+    "
+
+    "Created: / 03-09-2012 / 11:41:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !Dictionary methodsFor:'*Cypress-Structure'!
 
 asCypressPropertyObject
--- a/stx_goodies_cypress.st	Mon Sep 03 10:00:33 2012 +0000
+++ b/stx_goodies_cypress.st	Mon Sep 03 11:09:18 2012 +0000
@@ -28,10 +28,10 @@
 
     ^ #(
         #'stx:goodies/monticello'
-        #'stx:goodies/sunit'    "TestAsserter - superclass of CypressSnapshotTest "
-        #'stx:libbasic'    "Magnitude - superclass of extended Number "
+        #'stx:goodies/sunit'
+        #'stx:libbasic'    "Autoload - superclass of CypressAbstractTest "
         #'stx:libbasic2'
-        #'stx:libbasic3'
+        #'stx:libbasic3'    "ClassDefinitionChange - referenced by CypressClassStructure>>changesOn: "
         #'stx:libcomp'    "Parser - referenced by CypressPackageReader>>readMethodStructureFor:in:methodProperties: "
         #'stx:libcompat'
         #'stx:libhtml'
@@ -99,6 +99,7 @@
         String encodeForHTTP
         String writeCypressJsonOn:forHtml:indent:
         Method asCypressMethodDefinition
+        'ConfigurableFeatures class' hasCypressSupport
     )
 ! !
 
@@ -157,7 +158,7 @@
     "Return a SVN revision number of myself.
      This number is updated after a commit"
 
-    ^ "$SVN-Revision:"'5               '"$"
+    ^ "$SVN-Revision:"'8               '"$"
 ! !
 
 !stx_goodies_cypress class methodsFor:'documentation'!