Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
peteruhnak / release.st
Last active March 28, 2021 17:56
Iceberg git release with tags
"
Release 'master' branch of <repoName>:
1. merge it into release_base repository
2. adjust baseline if necessary
3. commit & push to origin/release_base
4. multi-tag with SEMVER (v1.2.3, v1.2.x, v1.x)
5. delete & push remote tags
"
@peteruhnak
peteruhnak / tonel-read-write.md
Created October 3, 2018 11:31
Tonel Reading & Writing

Reading (Memory FS)

store := FileSystem memory root.
(store / 'Somewhere') ensureCreateDirectory.
(store / 'Somewhere' / 'Something.class.st')
    ensureDelete;
    writeStreamDo: [ :stream | stream << 'Class {
    #name : #Something,
 #superclass : #Object,
@peteruhnak
peteruhnak / FastTree-expansion-saveload.st
Created April 20, 2018 11:29
FastTree expansion save/load
ds := FTTreeDataSource
roots: (1 to: 6)
children: [ :data :item |
2 to: data - 1 ].
save := nil.
save := [ :item :exp | |d|
d := Dictionary new.
exp at: item data put: d.
{
"service_name": "travis-ci",
"git": {
"branch": "master",
"head": {
"author_name": "Peter Uhnak",
"author_email": "i.uhnak@gmail.com",
"committer_name": "Peter Uhnak",
"message": "Obviously baseline issue.",
"id": "a18be5418f773475676408e292d269c2cef63327",
variables:
TOOLS_DEPS: "zip unzip"
DEFAULT_DEPS: "libc6:i386 libuuid1:i386 libfreetype6:i386 libssl1.0.0:i386"
PHARO_DEPS: "$DEFAULT_DEPS libcairo2:i386"
S3_BUCKET: "XXX"
AWS_DEFAULT_REGION: "XXX"
ARTIFACTS: '../../../../../artifacts/$CI_RUNNER_ID/$CI_PROJECT_PATH/$CI_PIPELINE_ID'
ARTIFACT_DIR: 'nsp-$CI_JOB_ID'
SMALLTALK_EDGE_SOURCE: 'peteruhnak/smalltalkCI'
SMALLTALK_EDGE_BRANCH: 'gitlab-coverage-2'
@peteruhnak
peteruhnak / MyClyGlmXmlEditorTool.st
Last active February 27, 2018 11:26
Calypso XML tool
'From Pharo6.0 of 13 May 2016 [Latest update: #60530] on 21 February 2018 at 9:43:37.179327 am'!
ClyBrowserTool subclass: #MyClyGlmXmlEditorTool
instanceVariableNames: 'editingMethod'
classVariableNames: ''
poolDictionaries: ''
category: 'Cly-Editors'!
!MyClyGlmXmlEditorTool commentStamp: 'PeterUhnak 2/21/2018 09:43' prior: 0!
I am a Calypso tool for editing XML method containing <resource: 'xml'> pragma.
Select #exampleXml method in me.!
MetacelloPharoPlatform select.
#(
'BaselineOfTonel'
'BaselineOfLibGit'
'BaselineOfIceberg'
'Iceberg-UI'
'Iceberg-Plugin-GitHub'
'Iceberg-Plugin'
'Iceberg-Metacello-Integration'
'Iceberg-Libgit-Tonel'
stereotypeText := BrRopedText string: '<<Metaclass>>'.
stereotypeText
attributes: { BrFontSizeAttribute size: 12 }
from: 1 to: stereotypeText size.
stereotype := BlTextElement new
constraintsDo: [ :c |
c linear horizontal alignCenter
];
text: stereotypeText.

RBParser node rewrite

Question

something: aSomething
    something := aSomething

[OUT]

OpalCompiler>>compile
| cm |
[ [ ast := self parse.
self doSemanticAnalysis.
self callPlugins ]
on: OCSourceCodeChanged
do: [ :notification |
self source: notification newSourceCode.
notification retry ].
cm := ast generate: self compilationContext compiledMethodTrailer ]