A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-ar.329.mcz ==================== Summary ==================== Name: System-ar.329 Author: Andreas Raab Time: 7 May 2010, 9:20:09.55 pm UUID: 8d1871a4-662d-c64a-a225-27e313977dab Ancestors: System-ar.328 Experimental: Derive the authorInitials directly from the authorName so that we have both initials as well as name for a change. Both can be useful - for example Monticello should use initials to disambiguate file names but should include the full author name in the ancestry. =============== Diff against System-ar.328 =============== Item was changed: ----- Method: Utilities class>>setAuthorInitials (in category 'identification') ----- setAuthorInitials + "Deprecated. Please ask for the author's name since the initials will be derived." - "Put up a dialog allowing the user to specify the author's initials. " + self setAuthorName. + ! - self setAuthorInitials: - (UIManager default request: 'Please type your initials: ' translated - initialAnswer: AuthorInitials)! Item was changed: ----- Method: Utilities class>>authorNamePerSe (in category 'identification') ----- authorNamePerSe + "Answer the currently-prevailing author name, such as they, empty or not" ^ AuthorName! Item was changed: ----- Method: Utilities class>>authorInitials (in category 'identification') ----- authorInitials "Answer the initials to be used to identify the current code author. " + [(self authorInitialsFrom: self authorName) ifNotEmpty:[:initials| ^initials]] repeat.! - [AuthorInitials isEmpty] whileTrue: [self setAuthorInitials]. - ^ AuthorInitials! Item was added: + ----- Method: Utilities class>>authorInitialsFrom: (in category 'identification') ----- + authorInitialsFrom: aString + "Answer the initials derived from the given name string. + Respects initials, for example: + Utilities authorInitialsFrom: 'Joe Sixpack'. + Utilities authorInitialsFrom: 'Joe Bernard Sixpack'. + Utilities authorInitialsFrom: 'Joe B. Sixpack'. + " + | tokens | + tokens := aString findTokens:' .'. + tokens size > 1 ifTrue:[ + ^tokens inject: '' into:[:string :n| string, n first asLowercase] + ]. + "Otherwise just return aString" + ^aString! Item was changed: ----- Method: Utilities class>>authorName (in category 'identification') ----- authorName + "Answer the name of the current code author." + AuthorName ifEmpty: [self setAuthorName]. ^ AuthorName! Item was changed: ----- Method: Utilities class>>setAuthorName (in category 'identification') ----- setAuthorName + "Put up a dialog allowing the user to specify the author's name. " + AuthorName := UIManager default request: 'Please type your name:' translated + initialAnswer: 'Your Name' translated. + ! - initialAnswer: 'Your Name' translated! Item was changed: ----- Method: Utilities class>>setAuthorInitials: (in category 'identification') ----- setAuthorInitials: aString + "Deprecated." + ^self authorName: aString! - - AuthorInitials := aString. - - "Case of being reset due to, eg, copy of image." - aString isEmpty ifTrue: [AuthorName := '']! Item was changed: Object subclass: #Utilities instanceVariableNames: '' + classVariableNames: 'AuthorName CommonRequestStrings LastStats RecentSubmissions ScrapsBook UpdateDownloader UpdateUrlLists' - classVariableNames: 'AuthorInitials AuthorName CommonRequestStrings LastStats RecentSubmissions ScrapsBook UpdateDownloader UpdateUrlLists' poolDictionaries: '' category: 'System-Support'! !Utilities commentStamp: '<historical>' prior: 0! A repository for general and miscellaneous utilities; much of what is here are in effect global methods that don't naturally attach to anything else. 1/96 sw! Item was changed: ----- Method: Utilities class>>authorName: (in category 'identification') ----- authorName: aString + "Answer the name of the current code author." + AuthorName := aString! Item was changed: ----- Method: Utilities class>>authorInitialsPerSe (in category 'identification') ----- authorInitialsPerSe "Answer the currently-prevailing author initials, such as they, empty or not" + ^AuthorName isEmptyOrNil ifTrue:[AuthorName] ifFalse:[self authorInitials]! - ^ AuthorInitials! |
Free forum by Nabble | Edit this page |