SourceCityHeader

SourceCity

SourceCity include some existent strategy. How to use it ?

Introduction

Step one

Create and import the city.

sourceCityImporter := (SourceCityImporter title: 'SourceCity for RPackage' 
		strategy: SourceCityImporterRPackageStrategy 
		new import:  RPackageOrganizer default packageNames  ).
  • Title is just the name of city.
  • Strategy, select your strategy class. Here we choice to use RPackageStrategy
  • Put whatever you want. In this example, we put a Collection of RPackage
Step two

Create a SourceCityGL instance and pass it the city via SourceCityConfiguration.

sourceCityGL := SourceCityGL sourceCityConfiguration: 
	(SourceCityConfiguration city: sourceCityImporter city).
Step three and the final one

Just do openInWorld on sourceCityGL

sourceCityGL openInWorld.

Example for RPackage

| sourceCityImporter sourceCityGL |
sourceCityImporter := (SourceCityImporter title: 'SourceCity for RPackage' 
		strategy: SourceCityImporterRPackageStrategy 
		new import:  RPackageOrganizer default packageNames  ).
sourceCityGL := SourceCityGL sourceCityConfiguration: 
	(SourceCityConfiguration city: sourceCityImporter city).
sourceCityGL openInWorld.

Example for PackageInfo

| sourceCityImporter sourceCityGL |
sourceCityImporter := (SourceCityImporter title: 'SourceCity for PackageInfo' 
		strategy: SourceCityImporterPackageInfoStrategy 
		new import: PackageInfo allPackages).
sourceCityGL := SourceCityGL sourceCityConfiguration: 
	(SourceCityConfiguration city: sourceCityImporter city).
sourceCityGL openInWorld.