core/MetacelloVersionMethodSection.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 19 Sep 2012 01:38:26 +0000
changeset 20 8caf2f257260
parent 16 25ac697dc747
permissions -rw-r--r--
- fixes for package support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
d354ac2af7ec Metacello package refactoring - phase 2~
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 10
diff changeset
     1
"{ Package: 'stx:goodies/metacello/core' }"
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     2
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     3
MetacelloMethodSection subclass:#MetacelloVersionMethodSection
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     4
	instanceVariableNames:'block versionSpec parent methodSections'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     5
	classVariableNames:''
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     6
	poolDictionaries:''
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     7
	category:'Metacello-Core-Constructors'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     8
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
     9
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    10
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    11
!MetacelloVersionMethodSection methodsFor:'accessing'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    12
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    13
addMethodSection: methodSection
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    14
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    15
	methodSection parent: self.
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    16
	self methodSections add: methodSection
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    17
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    18
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    19
attributeOrPath
16
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    20
	| path |
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    21
	^self parent == nil
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    22
		ifTrue: [ self attribute ]
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    23
		ifFalse: [ self parent attributePath , {(self attribute)} ]
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    24
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    25
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    26
attributePath
16
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    27
	| path |
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    28
	path := {self attribute.}.
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    29
	^self parent == nil
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    30
		ifTrue: [ path ]
25ac697dc747 - Updated from branch master
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14
diff changeset
    31
		ifFalse: [ self parent attributePath , path ]
1
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    32
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    33
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    34
block
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    35
	^ block
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    36
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    37
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    38
block: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    39
	block := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    40
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    41
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    42
methodSections
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    43
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    44
	methodSections ifNil: [ methodSections := OrderedCollection new ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    45
	^methodSections
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    46
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    47
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    48
parent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    49
	^ parent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    50
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    51
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    52
parent: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    53
	parent := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    54
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    55
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    56
topParent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    57
	self parent == nil
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    58
		ifTrue: [ ^ self ].
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    59
	^ self parent topParent
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    60
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    61
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    62
versionSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    63
	^ versionSpec
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    64
!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    65
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    66
versionSpec: anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    67
	versionSpec := anObject
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    68
! !
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    69
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    70
!MetacelloVersionMethodSection class methodsFor:'documentation'!
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    71
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    72
version_SVN
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    73
    ^ '$Id::                                                                                                                        $'
9e312de5f694 - Initial commit
jv
parents:
diff changeset
    74
! !