The Inbox: Help-Squeak-Project-topa.78.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Help-Squeak-Project-topa.78.mcz

commits-2
Tobias Pape uploaded a new version of Help-Squeak-Project to project The Inbox:
http://source.squeak.org/inbox/Help-Squeak-Project-topa.78.mcz

==================== Summary ====================

Name: Help-Squeak-Project-topa.78
Author: topa
Time: 11 February 2020, 12:03:59.622256 am
UUID: 1aa15f8c-302e-4b2c-bef2-71ed42df7b36
Ancestors: Help-Squeak-Project-tpr.77

Avoid dependencies from the Help to all over the place Classes.
That way, only examples are shown that can actually be browsed in the image.


Transformation used:

org := Scanner new scanTokens:  SqueakMessageCategoriesHelp organization asString.
[SqueakMessageCategoriesHelp copyOfMethodDictionary
        keysAndValuesDo:
                [:selector :method | | source old new|
                source := method getSource asString lines.
                [old := source allButLast.
                new := source last.
                new withBlanksTrimmed isEmpty] whileTrue: [source := old].
                new := new copyWithRegex: '\<(:isUppercase::isAlphaNumeric:*)>>' matchesTranslatedUsing: [:each | '#', each ].
                new := new copyWithRegex: '\<(:isUppercase::isAlphaNumeric:*) class' matchesTranslatedUsing: [:each | '#''', each, ''''].
                new := new copyReplaceAll: '>>' with: ' -> '.
                source last = new
                        ifFalse: [ | code |
                                code := (old copyWith: new) joinSeparatedBy: String cr.
                                SqueakMessageCategoriesHelp compile: code]]
] ensure: [SqueakMessageCategoriesHelp organization changeFromCategorySpecs: org]

=============== Diff against Help-Squeak-Project-tpr.77 ===============

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp class>>addCategoryTopicsTo: (in category 'private') -----
  addCategoryTopicsTo: aTopic
 
+ self selectors sorted do: [:selector | | helpContents examples validExamples |
- self selectors sorted do: [:selector | | helpContents examples |
  examples := (self new perform: selector).
  examples := examples isCollection ifTrue: [examples] ifFalse: [#()].
+ validExamples := examples select:
+ [:association | (self class environment classNamed: association key) notNil].
+ validExamples := validExamples collect:
+ [:association |
+ MethodReference
+ class: (self class environment classNamed: association key)
+ selector: association value].
+
+ helpContents := Text streamContents:
+ [:stream | stream
+ nextPutAll: (self commentsAt: selector) first;
+ crlf;
+ crlf;
+ nextPutAll: ('Examples:' asText allBold; yourself); crlf.
+ validExamples
+ do: [:example | example compiledMethod printReferenceOn: stream]
+ separatedBy: [stream nextPut: $,; crlf]].
 
- helpContents := (self commentsAt: selector) first asText,
- String crlf asText , String crlf asText ,
- ('Examples:' asText allBold; yourself) ,
- String crlf asText ,
- ((examples collect: [:m | m reference]) joinSeparatedBy: ', ' , String crlf) asText.
-
  aTopic addSubtopic: ((HelpTopic
  title: (self organization categoryOfElement: selector)
  icon: (HelpIcons iconNamed: #pageIcon)
  contents: helpContents)
  priority: 999;
  yourself)]!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>arithmetic (in category 'arithmetic') -----
  arithmetic
  "This category contains methods implementing all kinds of arithmetic operations. Note that the content of the method and not the selector is relevant for whether a method belongs to that category. A method with the selector #+ that implements the composition of two things which is not the arithmetic addition does not belong here.  (For example TraitComposition>>#+)"
 
+ ^ {#Fraction -> #+ . #Point -> #//}!
- ^ {Fraction>>#+ . Point>>#//}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>comparing (in category 'comparing') -----
  comparing
  "This category contains all methods for comparing objects. The main selectors are #= and #hash which should both be implemented consistently. Subclasses such as Magnitude add specialized selectors such as #<=."
 
+ ^ { #Object -> #= . #String -> #charactersExactlyMatching: }!
- ^ { Object>>#= . String>>#charactersExactlyMatching: }!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>converting (in category 'converting') -----
  converting
  "This category contains methods for converting objects to other representations.
  Note: For converting to string representations for displaying or storing see the 'printing' category."
 
+ ^ {#Object -> #asString . #PositionableStream -> #asBinaryOrTextStream}!
- ^ {Object>>#asString . PositionableStream>>#asBinaryOrTextStream}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>copying (in category 'copying') -----
  copying
  "This category contains methods for different ways to copy an object. The standard method is #copy which is mapped to specialized methods."
 
+ ^ {#Object -> #postCopy . #String -> #copyReplaceTokens:with: }!
- ^ {Object>>#postCopy . String>>#copyReplaceTokens:with: }!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>debugging (in category 'debugging') -----
  debugging
  "The debugging category contains all kinds of methods related to debugging."
 
+ ^ {#Object -> #inspectOnce . #Object -> #haltIf:}!
- ^ {Object>>#inspectOnce . Object>>#haltIf:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>displaying (in category 'displaying') -----
  displaying
  "In the context of the ST80 package this category contains methods for displaying an object on screen. This is related to the drawing category in Morphic."
 
+ ^ {#FormView -> #displayOn: . #Circle -> #displayOn:at:clippingBox:rule:fillColor:}!
- ^ {FormView>>#displayOn: . Circle>>#displayOn:at:clippingBox:rule:fillColor:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>drawing (in category 'drawing') -----
  drawing
  "In the context of the Morphic package, the drawing category contains the methods for displaying a Morph on the screen. The main entry points are the 'drawOn:' methods. This category is related to the displaying category in the ST80 package."
 
+ ^ {#EllipseMorph -> #drawOn: . #HandMorph -> #fullDrawOn:}!
- ^ {EllipseMorph>>#drawOn: . HandMorph>>#fullDrawOn:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>enumerating (in category 'enumerating') -----
  enumerating
  "This category is mostly found with classes representing some form of collection. The methods in this category allow all sorts of iteration and enumeration on the receiver."
 
+ ^ {#Collection -> #select: . #HelpBrowser -> #do:}!
- ^ {Collection>>#select: . HelpBrowser>>#do:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>eventHandling (in category 'event handling') -----
  eventHandling
  "In the context of the Morphic package, this category defines methods for processing events and methods Morph classes can override to handle particular events."
 
+ ^ {#Morph -> #hasFocus . #ScrollPane -> #handlesKeyboard:}!
- ^ {Morph>>#hasFocus . ScrollPane>>#handlesKeyboard:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>examples (in category 'examples') -----
  examples
  "This category is mostly found on meta classes. The methods in this category can be called to create an example instance for the class."
 
+ ^ {#'SystemProgressMorph class' -> #exampleLabelOnly . #'Form class' -> #exampleShrink}!
- ^ {SystemProgressMorph class>>#exampleLabelOnly . Form class>>#exampleShrink}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>initializeRelease (in category 'initialize-release') -----
  initializeRelease
  "This category contains methods related to initializing and, seldomly, releasing objects. The most common method in here is the #initialize method and any related methods. Further, this category also sometimes includes methods used by clients of the object to set an initial state after the object was initialized by #initialize."
 
+ ^ {#WeakRegistry -> #initialize . #RxMatcher -> #initialize:ignoreCase:}!
- ^ {WeakRegistry>>#initialize . RxMatcher>>#initialize:ignoreCase:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>instanceCreation (in category 'instance creation') -----
  instanceCreation
  "This category contains methods for creating instances. Most often these are implemented for the class object."
 
+ ^ {#'TestCase class' -> #selector: . #'Symbol class' -> #empty}!
- ^ {TestCase class>>#selector: . Symbol class>>#empty}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>layout (in category 'layout') -----
  layout
  "In the context of the Morphic package, the layout category contain methods for setting layout policies or layout properties. In subcategories it futher contains methods for controling context menus for setting the layout parameters."
 
+ ^ {#Morph -> #fullBounds . #StringMorph -> #fitContents}!
- ^ {Morph>>#fullBounds . StringMorph>>#fitContents}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>menu (in category 'menu') -----
  menu
  "This category includes all methods related to menus, often context menus in particular. It contains methods defining the menu as well as often callbacks for the labels of menu items or the actions to be executed. Sometimes the menus are split up in different categories if there are multiple menus or submenus."
 
+ ^ {#DictionaryInspector -> #mainFieldListMenu: . #SystemWindow -> #makeClosable}!
- ^ {DictionaryInspector>>#mainFieldListMenu: . SystemWindow>>#makeClosable}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>printing (in category 'printing') -----
  printing
  "This category contains methods for creating a textual representation of an object, may it be for displaying (#printString) or storing (#storeOn:)."
 
+ ^ {#Character -> #printOn: . #Object -> #storeString}!
- ^ {Character>>#printOn: . Object>>#storeString}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>private (in category 'private') -----
  private
  "This category contains methods which are only (and should only be) used by the containing class and its relatives up and down the class hierarchy. Often these methods expect a particular object state and are only useful in a particular control flow. One common reason for that is that the method is only a substep of a more elaborate process."
 
+ ^ {#Monitor -> #privateCleanup . #Collection -> #emptyCheck}!
- ^ {Monitor>>#privateCleanup . Collection>>#emptyCheck}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>removing (in category 'removing') -----
  removing
  "The 'removing' category is mostly used with objects representing collections of some kind and include methods for "
 
+ ^ {#MethodDictionary -> #removeAll . #ProcessorScheduler -> #remove:ifAbsent:}!
- ^ {MethodDictionary>>#removeAll . ProcessorScheduler>>#remove:ifAbsent:}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>running (in category 'running') -----
  running
  "In the context of a TestCase class, the 'running' category most often contains the #setUp and #tearDown methods."
 
+ ^ {#ClipboardTest -> #setUp . #LocaleTest -> #tearDown}!
- ^ {ClipboardTest>>#setUp . LocaleTest>>#tearDown}!

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>testing (in category 'testing') -----
  testing
  "The testing category contains predicate methods which typically answer a Boolean value."
 
+ ^ {#SMPackage -> #isAvailable . #FontImporterFontDescription -> #hasChildren}!
- ^ {SMPackage>>#isAvailable . FontImporterFontDescription>>#hasChildren}
- !

Item was changed:
  ----- Method: SqueakMessageCategoriesHelp>>tests (in category 'tests') -----
  tests
  "The tests category contains test methods in a TestCase class."
 
+ ^ {#MCAncestryTest -> #testLinearPath . #DurationTest -> #testNegated}!
- ^ {MCAncestryTest>>#testLinearPath . DurationTest>>#testNegated}
-
- !

Item was changed:
  ----- Method: SqueakMessageCategoriesHelpTest>>testCategoriesAreConsistent (in category 'tests') -----
  testCategoriesAreConsistent
 
  | helpInstance |
  helpInstance := SqueakMessageCategoriesHelp new.
+ SqueakMessageCategoriesHelp selectors do: [:selector | |correctCategory validExamples|
- SqueakMessageCategoriesHelp selectors do: [:selector | |correctCategory|
  correctCategory := SqueakMessageCategoriesHelp organization categoryOfElement: selector.
+ validExamples := (helpInstance perform: selector) select:
+ [:association | (self class environment classNamed: association key) notNil].
+ validExamples := validExamples collect:
+ [:association |
+ MethodReference
+ class: (self class environment classNamed: association key)
+ selector: association value].
+ validExamples do: [:methodRef |
- (helpInstance perform: selector) do: [:method |
  self
+ assert: (methodRef category beginsWith: correctCategory)
- assert: ((method methodClass organization categoryOfElement: method selector) beginsWith: correctCategory)
  description: 'Expected category ' , correctCategory]]!