From 48eb0706408ad5fdb00a9ae379ff01a86f0970ba Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Mon, 26 Jul 2021 16:11:49 -0700 Subject: [PATCH] Create APIReference.md and reference from README.md recover from https://code.google.com/archive/p/metacello/wikis/APIReference.wiki at the suggestion of @seandenigris [ci skip] --- README.md | 3 +- docs/APIReference.md | 137 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 docs/APIReference.md diff --git a/README.md b/README.md index e780b976..0f6b2a15 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Installer gemsource See the [.travis.yml file](./.travis.yml) for list of supported platforms and versions. If you are interested in using GitHub with the Metacello Preview, you should read The excellent [chapter on Metacello in Deep Into Pharo][5], then check out -[Getting Started with GitHub][1], the [Metacello User Guide][2], the [Metacello Scripting API][3], and [Issue #136 detail][4]. +[Getting Started with GitHub][1], the [Metacello User Guide][2], the [Metacello Scripting API][3], [Issue #136 detail][4], and [Metacello APR Reference][8]. ### TravisCI Status **master branch**: [![Build Status](https://travis-ci.org/Metacello/metacello.svg?branch=master)](https://travis-ci.org/Metacello/metacello) @@ -126,6 +126,7 @@ Interesting problem - non-reproducable builds when using non-exact dependent pro [5]: http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/Metacello.pdf [6]: https://blog.ometer.com/2017/01/10/dear-package-managers-dependency-resolution-results-should-be-in-version-control/ [7]: https://twitter.com/migueldeicaza/status/868450752347480064 +[8]: docs/APIReference.md ## Contribution diff --git a/docs/APIReference.md b/docs/APIReference.md new file mode 100644 index 00000000..598d0104 --- /dev/null +++ b/docs/APIReference.md @@ -0,0 +1,137 @@ +``` smalltalk +"Example baseline with an example of just about every message that can be used in a spec" +baseline10: spec + +spec for: #common do: [ + "#development, #baseline, #release, #beta, etc." + spec blessing: #baseline. + spec description: 'Descriptive comment'. + spec author: 'dkh'. + spec timestamp: '10/7/2009 14:40'. + spec + "Before loading packages or projects in this version, send #preloadForVersion to an instance of this config" + preLoadDoIt: #preloadForVersion; + "After loading packages or projects in this version, send #postloadForVersion to an instance of this config" + postLoadDoIt: #postloadForVersion. + spec repository: 'http://www.example.com/rr'. + spec repository: 'http://www.example.com/private' username: 'foo' password: 'bar'. + spec repositories: [ + "One or more repositories may be defined (MCReposioryGroup). Previous forms useful when specifying a single reposiory." + spec + "directory-based repositories" + repository: '/opt/mc/repository'; + repository: 'c:\pharo\myapp\repo\'; + "ftp-based repository ... note, supported in Pharo/Squeak only" + repository: 'ftp://ftp.example.com/repo'; + "dictionary-based repository ... repository stored at `Smalltalk at: #GlobalName`" + repository: 'dictionary://GlobalName'; + repository: 'http://www.example.com/rr'; + repository: 'http://www.example.com/ar'; + repository: 'http://www.example.com/private' username: 'foo' password: 'bar' ]. + spec + "Create or update a project reference" + project: 'UI Support' with: [ + "One or more of the following attributes may be defined or changed" + spec + "Name of config class (i.e., ConfigurationOfXXX)" + className: 'ConfigurationOfUI'; + "Version of project to be loaded. if theversionString is not specified, then the latest version of the project is used." + versionString: '1.0'; + "Before loading this project, send #preloadForProject to an instance of this config" + preLoadDoIt: #preloadForProject; + "After loading this project, send #postloadForProject to an instance of this config" + postLoadDoIt: #postloadForProject; + "OPTIONAL: Version comparison operator #= #~= #> #< #>= #<= #~> " + operator: #~>; + "OPTIONAL: List of packages to be loaded from project" + loads: #('UI-Core' ); + "Optional: Name of package containing the config, by convention same as className" + file: 'ConfigurationOfUI'; + "Repository where package resides" + repository: 'http://www.example.com/r' ]; + "Create a new project reference to replace existing project reference" + project: 'UI Support' overrides: [ + "One or more of the following attributes may be defined" + spec + className: 'ConfigurationOfUINew'; + versionString: '1.0'; + operator: #>=; + loads: #('UI-Core' 'UI-Tests' ); + repository: 'http://www.example.com/r' username: 'foo' password: 'bar' ]; + "Create project reference named 'UI Tests'" + project: 'UI Tests' + "based on c copy of 'UI Support' project" + copyFrom: 'UI Support' + with: [ + "One or more of the following attributes may be changed" + spec + className: 'ConfigurationOfUI'; + versionString: '1.0'; + operator: #~>; + loads: #('UI-Core' 'UI-Tests' ); + repository: 'http://www.example.com/r']; + "Change the versionString for 'UI Support' to '1.0.1'" + project: 'UI Support' with: '1.0.1'; + "Remove the project reference 'UI Tests'" + removeProject: 'UI Tests'; + "Multiple repositories for configuration - config may be found in either repository. + Secondary repository is useful when primary repository may not be available" + project: 'UI Multi' with: [ + spec + className: 'ConfigurationOfMulti'; + repository: 'http://www.example.com/r'; + repository: 'http://www.example.com/s' ]. + "Create or update 'Example-AddOn' package" + spec + package: 'Example-AddOn' with: [ + "One or more of the following attributes may be defined or changed" + spec + "'Example-Core' must be loaded before 'Example-AddOn'" + requires: #('Example-Core' ); + "When 'Example-AddOn' is loaded, load 'Example-UI'" + includes: #('Example-UI' ); + "Explicitly oad version 'Example-AddOn-anon.3' of the package" + file: 'Example-AddOn-anon.3'; + repositories: [ + spec + "Load 'Example-AddOn' from the 'http://www.example.com/yar'" + repository: 'http://www.example.com/yar'; + "or 'http://www.example.com/yas' repositores" + repository: 'http://www.example.com/yas']; + "Before loading 'Example-AddOn' send #preloadForAddOn to an instance of this config" + preLoadDoIt: #preloadForAddOn; + "After loading 'Example-AddOn' send #postloadForAddOn to an instance of this config" + postLoadDoIt: #postloadForAddOn ]; + "Create a new package to replace existing package" + package: 'Example-AddOn' overrides: [ + "One or more of the following attributes may be defined" + spec + requires: #('Example-Core' 'UI Support' ); + includes: #('Example-UI' ); + file: 'Example-AddOn-anon.7'; + supplyingAnswers: #( #('list of packages' 'Kernel* Collection*')); + repository: 'http://www.example.com/or' username: 'foo' password: 'bar' ; + preLoadDoIt: #preloadForAddOn; + postLoadDoIt: #postloadForAddOn ]; + "Change the package version loaded" + package: 'Example-AddOn' with:'Example-AddOn-anon.5'; + "Create 'Example-Core' package in project" + package: 'Example-Core'; + package: 'Example-Tests' with: [ + spec requires: #('Example-Core' ) ]; + package: 'Example-TestsUI' with: [ + spec requires: #('Example-UI' ) ]; + package: 'Example-UI' with: [ + spec requires: #('Example-AddOn' ) ]; + "Remove the package 'Example-Tests'" + removePackage: 'Example-Tests'. + spec + "Create or update the group 'default', adding 'Example-Core' and 'Example-AddOn' to the group." + group: 'default' + with: #('Example-Core' 'Example-AddOn' ); + "Create the group 'default' to replace existing group, consisting of 'Example-Core' and 'Example-AddOn'" + group: 'default' + overrides: #('Example-Core' 'Example-Tests' ); + "Remove the group 'default'" + removeGroup: 'default' ]. +```