The Trunk: Tools-pre.834.mcz

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

The Trunk: Tools-pre.834.mcz

commits-2
Patrick Rein uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-pre.834.mcz

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

Name: Tools-pre.834
Author: pre
Time: 1 December 2018, 5:17:57.588597 pm
UUID: 39cd80ab-f62a-df4d-a3c7-20a859de9005
Ancestors: Tools-eem.833

A minor refactoring of FileContentsBrowser instance creation methods in preparation of a testing and debugging of missing methods when browsing change set files.

=============== Diff against Tools-eem.833 ===============

Item was changed:
  ----- Method: FileContentsBrowser class>>browseFiles: (in category 'instance creation') -----
  browseFiles: fileList
  "Open a browser on the packages found within the files in the list; we expect the list to contain acceptable filename strings.
  If there is more than one package found the browser will be a full system browser, otherwise it will be a category browser"
+ | browser organizerAndPackageDict |
+ Cursor wait showWhile: [
+ organizerAndPackageDict := self buildOrganizerWithPackagesFrom: fileList withEach: [:fileName |
+ FilePackage fromFileNamed: fileName].
+ (browser := self systemOrganizer: organizerAndPackageDict first)
+ packages: organizerAndPackageDict second].
- | browser |
- Cursor wait showWhile: [ | organizer packageDict |
- packageDict := Dictionary new.
- organizer := SystemOrganizer defaultList: Array new.
- fileList do: [:fileName | | package |
- package := FilePackage fromFileNamed: fileName.
- packageDict
- at: package packageName
- put: package.
- organizer
- classifyAll: package classes keys
- under: package packageName].
- (browser := self systemOrganizer: organizer)
- packages: packageDict].
  ^ browser buildAndOpenBrowser
  !

Item was changed:
  ----- Method: FileContentsBrowser class>>browseStream: (in category 'instance creation') -----
  browseStream: aStream
 
  aStream setConverterForCode.
+ ^ self browseStream: aStream named: aStream name!
- self browseStream: aStream named: aStream name!

Item was changed:
  ----- Method: FileContentsBrowser class>>browseStream:named: (in category 'instance creation') -----
  browseStream: aStream named: aString
  "Read an already opened file stream into a browser"
+ ^ (self createBrowserForStream: aStream named: aString) buildAndOpenBrowser
+ !
- | browser |
- Cursor wait showWhile: [ | package packageDict organizer |
- packageDict := Dictionary new.
- browser := self new.
- organizer := SystemOrganizer defaultList: Array new.
- package := (FilePackage new fullName: aString; fileInFrom: aStream).
- packageDict
- at: package packageName
- put: package.
- organizer
- classifyAll: package classes keys
- under: package packageName.
- (browser := self systemOrganizer: organizer)
- packages: packageDict].
- ^ browser buildAndOpenBrowser
- !

Item was added:
+ ----- Method: FileContentsBrowser class>>buildOrganizerWithPackagesFrom:withEach: (in category 'private') -----
+ buildOrganizerWithPackagesFrom: collectionOfPackageSources withEach: filePackageCreation
+
+ | organizer packageDict |
+ packageDict := Dictionary new.
+ organizer := SystemOrganizer defaultList: Array new.
+
+ collectionOfPackageSources do: [:src | | package |
+ package := filePackageCreation value: src.
+ packageDict
+ at: package packageName
+ put: package.
+ organizer
+ classifyAll: package classes keys
+ under: package packageName].
+
+ ^ {organizer . packageDict}!

Item was added:
+ ----- Method: FileContentsBrowser class>>createBrowserForStream:named: (in category 'private') -----
+ createBrowserForStream: aStream named: aString
+
+ | browser organizerAndPackageDict |
+ Cursor wait showWhile: [
+ browser := self new.
+ organizerAndPackageDict := self buildOrganizerWithPackagesFrom: {aStream} withEach: [:stream |
+ (FilePackage new fullName: aString; fileInFrom: aStream)].
+ (browser := self systemOrganizer: organizerAndPackageDict first)
+ packages: organizerAndPackageDict second].
+ ^ browser!