Expand tabs before writing .mcz
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 06 Nov 2014 10:08:04 +0100
changeset 938 f544f968df1d
parent 937 8cbc9884f0cd
child 939 64b784b699f9
Expand tabs before writing .mcz
MCStXSnapshotPreWriteTransformation.st
--- a/MCStXSnapshotPreWriteTransformation.st	Thu Nov 06 04:14:18 2014 +0100
+++ b/MCStXSnapshotPreWriteTransformation.st	Thu Nov 06 10:08:04 2014 +0100
@@ -27,7 +27,7 @@
 
 !MCStXSnapshotPreWriteTransformation methodsFor:'accessing'!
 
-monticelloName  
+monticelloName
     | def |
 
     def := self projectDefinition.
@@ -38,8 +38,8 @@
 
 projectDefinition
     original definitions reverseDo:[:d|
-        | c |    
-        (d isClassDefinition 
+        | c |
+        (d isClassDefinition
             and:[(c := d actualClass) notNil
                 and:[c isProjectDefinition]])
                     ifTrue:[ ^ c  ]
@@ -103,18 +103,18 @@
     "Returns a transformed **copy** of the original snapshot"
 
     extensionMethodCategoryMap := OrderedCollection new.
-    original := anMCSnapshot.    
+    original := anMCSnapshot.
     projectDefinition := self projectDefinition.
     projectDefinition isNil ifTrue:[
         "/ Not a Smalltalk/X package - no transformation
         transformed := original.
-        ^transformed 
+        ^transformed
     ].
     super transform: anMCSnapshot.
     (projectDefinition notNil and:[extensionMethodCategoryMap notEmpty]) ifTrue:[
         | source |
 
-        source := 
+        source :=
             self monticelloSmalltalkXExtensionMethodCategories_Code bindWith:
                 (String streamContents:[:s|
                     extensionMethodCategoryMap do:[:entry|
@@ -156,7 +156,7 @@
                 selector: 'monticelloProjectDefinitionTypeName'
                 category: 'accessing - monticello'
                 timeStamp: 'Generated by ', self class name , ' at ' , Timestamp now printString
-                source: 
+                source:
                     (self monticelloSmalltalkXProjectType_Code bindWith: (class isApplicationDefinition ifTrue:[#application] ifFalse:[#library]) storeString))
     ]
 
@@ -165,13 +165,18 @@
 !
 
 visitMethodDefinition: definition
+    | source |
+
+    source := definition source asStringWithNativeLineEndings asStringCollection withTabs asStringWithSqueakLineEndings.
+    definition source: source.
+
     (self isExtensionMethodDefinition: definition) ifTrue:[
         | prefix |
 
         prefix := '*' , self monticelloName asLowercase.
         (definition category asLowercase startsWith: prefix) ifFalse:[
             extensionMethodCategoryMap add:
-                (Array 
+                (Array
                     with: definition className , (definition classIsMeta ifTrue:[' class'] ifFalse:[''])
                     with: definition selector
                     with: definition category).
@@ -180,7 +185,7 @@
     ].
 
     "Created: / 30-05-2013 / 22:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 01-11-2014 / 00:20:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-11-2014 / 03:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitOrganizationDefinition: defintion
@@ -189,7 +194,7 @@
     | categories |
 
     categories := defintion categories.
-    (categories includes: projectDefinition monticelloName) ifFalse:[ 
+    (categories includes: projectDefinition monticelloName) ifFalse:[
         categories := categories copyWith: projectDefinition monticelloName asSymbol.
         defintion categories: categories.
     ].
@@ -200,10 +205,10 @@
 !MCStXSnapshotPreWriteTransformation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.9 2014-11-01 00:21:08 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.10 2014-11-06 09:08:04 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.9 2014-11-01 00:21:08 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXSnapshotPreWriteTransformation.st,v 1.10 2014-11-06 09:08:04 vrany Exp $'
 ! !