{"id":16086488,"url":"https://github.com/jecisc/stoncustomizer","last_synced_at":"2026-03-07T18:32:47.189Z","repository":{"id":93121294,"uuid":"224453255","full_name":"jecisc/STONCustomizer","owner":"jecisc","description":"I am project to customize STON imports/exports.","archived":false,"fork":false,"pushed_at":"2025-05-20T13:43:56.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T15:46:52.789Z","etag":null,"topics":["export","pharo","smalltalk","ston"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jecisc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-27T14:49:25.000Z","updated_at":"2025-05-20T13:42:17.000Z","dependencies_parsed_at":"2025-08-01T15:26:50.297Z","dependency_job_id":"c42ebf69-99e6-4b22-a01e-1fe34475fb5c","html_url":"https://github.com/jecisc/STONCustomizer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jecisc/STONCustomizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSTONCustomizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSTONCustomizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSTONCustomizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSTONCustomizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jecisc","download_url":"https://codeload.github.com/jecisc/STONCustomizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jecisc%2FSTONCustomizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30226247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T18:12:09.766Z","status":"ssl_error","status_checked_at":"2026-03-07T18:11:58.786Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["export","pharo","smalltalk","ston"],"created_at":"2024-10-09T13:13:23.691Z","updated_at":"2026-03-07T18:32:47.144Z","avatar_url":"https://github.com/jecisc.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STONCustomizer\n\n I am project to customize STON imports/exports.\n\n[![Build Status](https://travis-ci.org/jecisc/STONCustomizer.svg?branch=master)](https://travis-ci.org/jecisc/STONCustomizer)\n\n  - [Installation](#installation)\n  - [Documentation](#documentation)\n  - [Version management](#version-management)\n  - [Smalltalk versions compatibility](#smalltalk-versions-compatibility)\n  - [Contact](#contact)\n\n## Installation\n\nTo install the project into your Pharo image, execute the following script: \n\n```Smalltalk\nMetacello new\n\tgithubUser: 'jecisc' project: 'STONCustomizer' commitish: 'v1.x.x' path: 'src';\n\tbaseline: 'STONCustomizer';\n\tload\n```\n\nTo add the project to your baseline:\n\n```Smalltalk\nspec\n\tbaseline: 'STONCustomizer'\n\twith: [ spec repository: 'github://jecisc/STONCustomizer:v1.x.x/src' ]\n```\n\nNote you can replace the #master by another branch such as #development or a tag such as #v1.0.0, #v1.? or #v1.2.? .\n\n## Documentation\n\n\u003e The code used in the example is available in `STONCustomizer-Tests` package.\n\nIn order to customize you STON export with this project you can add a class side method to the object to export with a pragma `\u003cstonCustomazationFor:\u003e` taking as parameter a symbol that is the name of an instance variable.\nThis method should return a STONCustomizer that will take care of the writing/reading of the variable content.\n\nExample: \n\n```Smalltalk\nyearOfBirthCustomizer\n\t\u003cstonCustomizationFor: #yearOfBirth\u003e\n\t^ STONCustomizer\n\t\treadBlock: [ :person :value :reader | person yearOfBirth: value asYear ]\n\t\twriteBlock: [ :person | person yearOfBirth start year ]\n```\n\nHere we have an object with a variable `#yearOfBirth` containing a year. To export this entity we do not wish to export a `Year` but an integer and transform it into a `Year` back when we read a STON file for this object.\n\nOnce you have objects using this, you can use `SCExporter` and `SCImporter` to export/import your objects.\n\nThe following examples will take those inputs as datas:\n\n```Smalltalk\ncountryHolder := SCMockCountryHolder new.\n\nfrance := countryHolder countryNamed: 'France'.\nbelgium := countryHolder countryNamed: 'Belgium'.\ngermany := countryHolder countryNamed: 'Germany'.\n\npeoples := {\n\t(SCMockPerson country: france yearOfBirth: 1993 asYear).\n\t(SCMockPerson country: france yearOfBirth: 1992 asYear).\n\t(SCMockPerson country: belgium yearOfBirth: 1990 asYear).\n\t(SCMockPerson country: germany yearOfBirth: 1999 asYear )\n}.\n```\n\nYou can export it in strings:\n\n```Smalltalk\nexport := SCExporter toString: peoples.\n\nSCImporter fromString: export\n```\n\nOr in files:\n\n```Smalltalk\nfile := FileSystem memory / 'test.ston'.\n\nSCExporter export: peoples inFile: file.\n\nSCImporter fromFile:: export\n```\n\nOr directly to a stream via `#export:toStream:` and `#fromStream:`.\n\nAnother feature of STONCustomization is that you can customize you import/export using states of your application. \n\nFor example, in the previous example we have a `#countryHolder` acting as a cache for the countries. During the import of countries we might want to get back the instances it holds. \n\nIn that case we can implement a customization this way:\n\n```Smalltalk\ncountryCustomizer\n\t\u003cstonCustomizationFor: #country\u003e\n\t^ STONCustomizer\n\t\treadBlock: [ :person :value :reader | person country: (reader state countryNamed: value) ]\n\t\twriteBlock: [ :person | person country name ]\n```\n\nAnd export/import the objects this way:\n\n```Smalltalk\nexport := SCExporter toString: peoples.\n\nSCImporter fromString: export state: countryHolder\n```\n\n## Version management \n\nThis project use semantic versioning to define the releases. This means that each stable release of the project will be assigned a version number of the form `vX.Y.Z`. \n\n- **X** defines the major version number\n- **Y** defines the minor version number \n- **Z** defines the patch version number\n\nWhen a release contains only bug fixes, the patch number increases. When the release contains new features that are backward compatible, the minor version increases. When the release contains breaking changes, the major version increases. \n\nThus, it should be safe to depend on a fixed major version and moving minor version of this project.\n\n## Smalltalk versions compatibility\n\n| Version \t| Compatible Pharo versions \t\t|\n|-------------\t|----------------------------------\t|\n| 1.x.x       \t| Pharo 6.1, 7, 8, 9, 10, 11, 12\t|\n\n## Contact\n\nIf you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.me \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjecisc%2Fstoncustomizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjecisc%2Fstoncustomizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjecisc%2Fstoncustomizer/lists"}