Skip to content

Instantly share code, notes, and snippets.

xmi := OPUMLBootstrapGeneratorTest umlSpecs.
reader := OPUMLXMIReader new.
reader classPrefix: 'OPUML'.
model := (reader readXmi: xmi) first.
"select all classes in the entire metamodel"
cls := (model packagedElements flatCollect: #packagedElements) select: [ :each | each isKindOf: OPUMLClass ].
rootName := 'Behavior'.
BaselineOfXMLMAGenerator project latestVersion projects collect: [ :each | each name -> each versionString ] as: Array. "{'XMLParser'->#stable. 'XPath'->#stable. 'Magritte'->#stable. 'MagritteXMLBindings'->'baseline'. 'ChangesBuilder'->'baseline'}"
version := BaselineOfXMLMAGenerator project latestVersion.
nodes := version projects, version packages, version groups.
b := RTMondrian new.
b shape text text: #name.
b nodes: nodes.
@peteruhnak
peteruhnak / StHubToGitHub.st
Last active August 18, 2017 12:31
Copy a project from SmalltalkHub to GitHub
"Based on Uko's script https://gist.github.com/Uko/6898022"
"Get reference to the source repository"
source := MCSmalltalkhubRepository allInstances detect: [ :each |
each location includesSubstring: 'StName/project-name'
].
"Get reference to the target repository"
destination := MCFileTreeGitRepository allInstances detect: [ :each |
each location includesSubstring: 'project-name/repository'
@peteruhnak
peteruhnak / slot-vs-accessor.md
Last active September 20, 2017 17:28
Slot vs accessor methods for subscribing/unsubscribing

Subscription Slot vs Accessor

Base (subscription to the model in some manner)

BaseController>>subscribeTo: aModel
  aModel announcer when: ModelRenamed do: [ :ann | self logCr: self class name, ': ' , aModel name ]

BaseController>>unsubscribeFrom: aModel
  aModel announcer unsubscribe: self
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 ]

RBParser node rewrite

Question

something: aSomething
    something := aSomething

[OUT]

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.
MetacelloPharoPlatform select.
#(
'BaselineOfTonel'
'BaselineOfLibGit'
'BaselineOfIceberg'
'Iceberg-UI'
'Iceberg-Plugin-GitHub'
'Iceberg-Plugin'
'Iceberg-Metacello-Integration'
'Iceberg-Libgit-Tonel'
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'