The Trunk: Files-mt.145.mcz

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

The Trunk: Files-mt.145.mcz

commits-2
Marcel Taeumel uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-mt.145.mcz

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

Name: Files-mt.145
Author: mt
Time: 7 October 2015, 10:16:24.866 am
UUID: f726696f-12e1-0146-a181-ad701c233a62
Ancestors: Files-cmm.144

Updates service descriptions in FileStream to be extensible by message name pattern.

Note: We should discuss this way of extensibility and apply it to other service descriptions in the system if okay.

=============== Diff against Files-cmm.144 ===============

Item was changed:
  ----- Method: FileStream class>>fileReaderServicesForFile:suffix: (in category 'file reader services') -----
  fileReaderServicesForFile: fullName suffix: suffix
  "Answer services for the given file"
 
+ ^ self servicesWithSuffixes
+ select: [:spec | spec key anySatisfy: [:pattern | suffix = '*' or: [pattern match: suffix]]]
+ thenCollect: [:spec | spec value]!
- ^ ((self isSourceFileSuffix: suffix) or: [ suffix = '*' ])
- ifTrue:
- [{self serviceRemoveLineFeeds.
- self serviceFileIn}]
- ifFalse:
- [#()]!

Item was added:
+ ----- Method: FileStream class>>serviceFileInSuffixes (in category 'file reader services') -----
+ serviceFileInSuffixes
+
+ ^ self sourceFileSuffixes!

Item was added:
+ ----- Method: FileStream class>>serviceRemoveLineFeedsSuffixes (in category 'file reader services') -----
+ serviceRemoveLineFeedsSuffixes
+
+ ^ self sourceFileSuffixes!

Item was changed:
  ----- Method: FileStream class>>services (in category 'file reader services') -----
  services
 
+ ^ (((self class selectors copyWithout: #services)
+ select: [:symbol | symbol beginsWith: #service])
+ reject: [:symbol | symbol endsWith: #Suffixes])
+ collect: [:selector | self perform: selector]!
- ^ Array
- with: self serviceRemoveLineFeeds
- with: self serviceFileIn
- !

Item was added:
+ ----- Method: FileStream class>>servicesWithSuffixes (in category 'file reader services') -----
+ servicesWithSuffixes
+
+ ^ (((self class selectors copyWithout: #services)
+ select: [:symbol | symbol beginsWith: #service])
+ reject: [:symbol | symbol endsWith: #Suffixes])
+ collect: [:selector |
+ (self perform: (selector, #Suffixes) asSymbol) -> (self perform: selector)]!