The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Contributions We Rely On

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Contributions We Rely On Posted: Oct 16, 2007 1:54 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Contributions We Rely On
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

An interesting topic came up on one our calls today: what components in the "contributed" (i.e., not supported) section of our installation do our supported components rely on? Seems like a pain in the neck to test and figure out, but it turns out that the information is easy enough to come by. Using this code snippet, you can read the header of a parcel file:


properties := [CodeReader new readInfoFromFileNamed: 'parcelFileHere.pcl' asFilename] 
				on: OsError, CodeReader fileFormatSignal
				do: [:ex | ex return: Dictionary new].

Armed with that, the following script was easy to create:

"get the contributed parcel names"
contributedDirs := (('..\contributed' asFilename directoryContents) 
	select: [:each | ('..\contributed' asFilename construct: each) isDirectory]) asOrderedCollection.
contributedDirs := contributedDirs collect: 
		[:each | ('..\contributed' asFilename construct: each) asString].
contributedDirs add: '..\contributed'.
all := OrderedCollection new.
contributedDirs do: [:each |
	| current |
	current := each asFilename directoryContents.
	current := current select: [:each1 | '*.pcl' match: each1].
	current := current collect: [:each2 | each2 copyUpTo: $.].
	all addAll: current].

"now get the supported stuff"
top := 'c:\vw7.5.1' asFilename.
dirs := #('advanced' 'com' 'database' 'dllcc' '
DotNetConnect' 'DotNetConnect\parcels' 'dst' 'examples' 
'icc' 'net' 'opentalk' 'packaging' 'parcels' 'pdp' 'plugin' 
'preview' 'seaside' 'security' 'store' 
'wavedev' 'waveserver' 'web' 'webservices').

bad := OrderedCollection new.
dirs do: [:each |
	| dir |
	dir := top construct: each.
	files := dir directoryContents select: [:each1 | '*.pcl' match: each1].
	files do: [:each1 |
		| file |
		file := dir construct: each1.
		properties := [CodeReader new readInfoFromFileNamed: file] 
				on: OsError, CodeReader fileFormatSignal
				do: [:ex | ex return: Dictionary new].
		prereqs := properties at: #prerequisiteParcels ifAbsent: [#()].
		prereqs notEmpty
			ifTrue: [prereqs := prereqs collect: [:ea1 | ea1 first]].
		(prereqs anySatisfy: [:ea | all includes: ea])
			ifTrue: [bad add: (file asString ->prereqs)]]].

bad := bad collect: [:each |
	reqs := each value select: [:ea | all includes: ea].
	each key -> reqs].

Yes, the script could be cleaned up some, but it works for this purpose. Next, time to create a simple HTML table of results:

stream := WriteStream on: String new.
stream nextPutAll: '<table border="1" cellpadding="2"><tr>'; cr.
stream nextPutAll: '<td>Component Name</td><td>PreReq</td></tr>'; cr.
bad do: [:each |
	stream nextPutAll: '<tr>'; cr.
	stream nextPutAll: '<td>', each key asFilename tail, '</td>'; cr.
	stream nextPutAll: '<td>'.
	each value do: [:ea | stream nextPutAll: ea.
					ea ~= each value last
						ifTrue: [stream nextPutAll: ', ']].
	stream nextPutAll: '</td></tr>'; cr].
stream nextPutAll: '</table>'.
^stream contents

And the results:

Component NamePreReq
DotNETSUnitTests.pcl SUnitUI
Non-Commercialization.pcl StoreForPostgreSQL
RBRegexExtensions.pcl Regex11
RBStoreExtensions.pcl HotDraw Framework
RBSUnitExtensions.pcl SUnit
Tools-StartupOrderingTool.pcl HotDraw Framework
Seaside-Comet.pcl Seaside-Scriptaculous
Seaside-Crossfade.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-CSSBarGraph.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-FadeIn.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-NumberedList.pcl Seaside-Scriptaculous
Seaside-PlotKit.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-protoGrowl.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-Reflection.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside-SeaChartDemo.pcl Seaside-Scriptaculous, Seaside-PlotKit, Seaside-Crossfade, Seaside-CSSBarGraph, Seaside-FadeIn, Seaside-NumberedList, Seaside-Reflection, Seaside-StarRater, Seaside-protoGrowl
Seaside-ShoreComponents.pcl Seaside-Scriptaculous
Seaside-StarRater.pcl Seaside-Scriptaculous, Seaside-HTML5
Seaside.pcl SUnitToo
Wave-Server.pcl Regex11
WebToolkit.pcl Regex11, Base64Encoding
WebServicesDemo.pcl Protocols-TestingExtensions

Now, some of that is spurious - there are duplicate parcel names for Seaside, as we are still sorting that out. We don't need to worry much about the non-commercialization parcel either - but the other results are interesting. For instance, before I ran this script, I had not remembered that we use HotDraw in the browser. Interesting information all around...

Technorati Tags: ,

Read: Contributions We Rely On

Topic: Third in the Seaside Series on Tap Previous Topic   Next Topic Topic: Hating your customers as a strategy

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use