-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from pharo-vcs/59-import-fails-on-method-exten…
…sion 59-import-fails-on-method-extension
- Loading branch information
Showing
4 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
13 changes: 11 additions & 2 deletions
13
MonticelloTonel-Core.package/TonelWriter.class/instance/createDefaultOrganizationFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
private | ||
createDefaultOrganizationFrom: aMCClassDefinition | ||
^ MCOrganizationDefinition categories: { aMCClassDefinition category } | ||
createDefaultOrganizationFrom: aCollection | ||
"answers a default organisation for the cases where there are none" | ||
|
||
"simplest case, I answer the clas definition" | ||
snapshot definitions | ||
detect: #isClassDefinition | ||
ifFound: [ :each | ^ each category ]. | ||
|
||
^ self createDefaultOrganizationFromDefinition: (snapshot definitions | ||
detect: #isMethodDefinition | ||
ifNone: [ self error: 'cannot determine package name from empty snapshot' ]) |
4 changes: 4 additions & 0 deletions
4
...Tonel-Core.package/TonelWriter.class/instance/createDefaultOrganizationFromDefinition..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
createDefaultOrganizationFromDefinition: aMethodDefinition | ||
|
||
^ MCOrganizationDefinition categories: (self packageNameForMethodDefinition: aMethodDefinition) |
10 changes: 10 additions & 0 deletions
10
MonticelloTonel-Core.package/TonelWriter.class/instance/packageNameForMethodDefinition..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
private | ||
packageNameForMethodDefinition: aMethodDefinition | ||
| category | | ||
|
||
self assert: aMethodDefinition category first = $*. | ||
category := aMethodDefinition category allButFirst. | ||
^(MCWorkingCopy allManagers | ||
detect: ((category allSatisfy: #isLowercase) | ||
ifTrue: [[: wc| category beginsWith: wc packageName asLowercase]] | ||
ifFalse: [[: wc| category beginsWith: wc packageName]])) packageName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters