Skip to content

Commit

Permalink
Merge pull request #36 from ba-st/pharo_10
Browse files Browse the repository at this point in the history
Add Pharo 10 support
  • Loading branch information
gcotelli authored Apr 19, 2022
2 parents b7974fa + 9b57090 commit 9f48c39
Show file tree
Hide file tree
Showing 29 changed files with 222 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.st linguist-language=Smalltalk
*.st eol=lf
*.st text diff
29 changes: 29 additions & 0 deletions .github/workflows/loading-groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Baseline groups

on: [push,pull_request,workflow_dispatch]

jobs:
group-loading:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
load-spec: [ deployment, tests, development, tools ]
name: ${{ matrix.smalltalk }} + ${{ matrix.load-spec }}
services:
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load group in image
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.loading.${{ matrix.load-spec }}.ston
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-8.0, Pharo64-7.0, Pharo32-7.0 ]
smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0, Pharo64-7.0, Pharo32-7.0 ]
name: ${{ matrix.smalltalk }}
services:
rabbitmq:
Expand Down
13 changes: 13 additions & 0 deletions .smalltalkci/.loading.deployment.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Ansible',
#directory : '../source',
#load : [ 'Deployment' ],
#platforms : [ #pharo ]
}
],
#testing : {
#failOnZeroTests : false
}
}
13 changes: 13 additions & 0 deletions .smalltalkci/.loading.development.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Ansible',
#directory : '../source',
#load : [ 'Development' ],
#platforms : [ #pharo ]
}
],
#testing : {
#failOnZeroTests : false
}
}
13 changes: 13 additions & 0 deletions .smalltalkci/.loading.tests.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Ansible',
#directory : '../source',
#load : [ 'Tests' ],
#platforms : [ #pharo ]
}
],
#testing : {
#failOnZeroTests : false
}
}
13 changes: 13 additions & 0 deletions .smalltalkci/.loading.tools.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Ansible',
#directory : '../source',
#load : [ 'Tools' ],
#platforms : [ #pharo ]
}
],
#testing : {
#failOnZeroTests : false
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Buenos Aires Smalltalk Contributors
Copyright (c) 2019-2022 Buenos Aires Smalltalk Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ Ansible is a AMQP client library for Smalltalk supporting 0-8 and 0-9-1
versions of the protocol.

[![GitHub release](https://img.shields.io/github/release/ba-st/Ansible.svg)](https://github.com/ba-st/Ansible/releases/latest)
[![Unit Tests](https://github.com/ba-st/Ansible/workflows/unit-tests.yml/badge.svg)](https://github.com/ba-st/Ansible/actions/workflows/unit-tests.yml)
[![Unit Tests](https://github.com/ba-st/Ansible/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ba-st/Ansible/actions/workflows/unit-tests.yml)
[![Coverage Status](https://codecov.io/gh/ba-st/Ansible/coverage.svg?branch=release-candidate)](https://codecov.io/gh/ba-st/Ansible/branch/release-candidate)
[![Baseline Groups](https://github.com/ba-st/Ansible/actions/workflows/loading-groups.yml/badge.svg)](https://github.com/ba-st/Ansible/actions/workflows/loading-groups.yml)
[![Markdown Lint](https://github.com/ba-st/Ansible/actions/workflows/markdown-lint.yml/badge.svg)](https://github.com/ba-st/Ansible/actions/workflows/markdown-lint.yml)

[![Pharo 7.0](https://img.shields.io/badge/Pharo-7.0-informational)](https://pharo.org)
[![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://pharo.org)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org)

An [ansible](https://en.wikipedia.org/wiki/Ansible) is a fictional device
capable of near-instantaneus communication. It can send and receive message
to and from a corresponding device over any distance or obstable whatsover
with no delay even betwenn star systems.
capable of near-instantaneous communication. It can send and receive message
to and from a corresponding device over any distance or obstacle whatsoever
with no delay even between star systems.

Quick links
## Quick links

- [**Getting Started**](docs/GettingStarted.md) is a good place to start to
explore the docs 😉
- [**Getting Started**](docs/README.md) is a good place to start
exploring the docs 😉
- [Report a defect](https://github.com/ba-st/Ansible/issues/new?labels=Type%3A+Defect)
- [Request feature](https://github.com/ba-st/Ansible/issues/new?labels=Type%3A+Feature)

Expand Down
6 changes: 3 additions & 3 deletions assets/specs/amqp0-8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ localised reply text
so that the client can acknowledge multiple messages with a single
method. If set to zero, the delivery tag refers to a single
message. If the multiple field is 1, and the delivery tag is zero,
tells the server to acknowledge all outstanding mesages.
tells the server to acknowledge all outstanding messages.
</doc>
<doc name = "rule" test = "amq_basic_20">
The server MUST validate that a non-zero delivery-tag refers to an
Expand Down Expand Up @@ -3002,7 +3002,7 @@ localised reply text
so that the client can acknowledge multiple messages with a single
method. If set to zero, the delivery tag refers to a single
message. If the multiple field is 1, and the delivery tag is zero,
tells the server to acknowledge all outstanding mesages.
tells the server to acknowledge all outstanding messages.
</doc>
<doc name = "rule">
The server MUST validate that a non-zero delivery-tag refers to an
Expand Down Expand Up @@ -3797,7 +3797,7 @@ confirm transaction mode
test fields and return the result.
</doc>
<assert check="enum">
<value name="add">return concatentation of test strings</value>
<value name="add">return concatenation of test strings</value>
<value name="min">return shortest of test strings</value>
<value name="max">return longest of test strings</value>
</assert>
Expand Down
4 changes: 2 additions & 2 deletions assets/specs/amqp0-9-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@
We use the 'name' attribute as an identifier, usually within the context
of the surrounding entities.
We use spaces to seperate words in names, so that we can print names in
We use spaces to separate words in names, so that we can print names in
their natural form depending on the context - underlines for source code,
hyphens for written text, etc.
We do not enforce any particular validation mechanism but we support all
mechanisms. The protocol definition conforms to a formal grammar that is
published seperately in several technologies.
published separately in several technologies.
-->

Expand Down
51 changes: 0 additions & 51 deletions docs/Installation.md

This file was deleted.

33 changes: 15 additions & 18 deletions docs/GettingStarted.md → docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting started with Ansible

**Ansible** implements two of the major versions of the [AMQP](http://www.amqp.org)
messaging prototol: AMQP 0-8 and AMQP 0-9-0.
messaging protocol: AMQP 0-8 and AMQP 0-9-0.

AMQP is a programmable protocol allowing several messaging patterns, you'll
learn some of those patterns with a set of tutorials.
Expand All @@ -23,33 +23,30 @@ This starts up a RabbitMQ server listening on the default port.

## Installing Ansible

Now, on a Pharo image open a Playground and evaluate the following code to load Ansible

```smalltalk
Metacello new
baseline: 'Ansible';
repository: 'github://ba-st/Ansible:release-candidate/source';
load.
```
Now, on a Pharo image open a Playground and follow the instructions [here](how-to/how-to-load-in-pharo.md).

Save and close this image, you'll use it to perform the tutorials.

See [Installation.md](Installation.md) to learn more about how install **Ansible**
on your image or how to use it as dependency of your project.

That's it! You are ready to start with the tutorials.

## Tutorials

The tutorials are intended to be read in order and are inspired by those in the
[Get Started](https://www.rabbitmq.com/getstarted.html) of the official documentation.
They are not a rewrite but rather my interpretation.
[Get Started](https://www.rabbitmq.com/getstarted.html) of the official documentation.
They are not a rewrite but rather my interpretation.

1. [Worker queue](WorkerQueue.md)
2. [Publish - Subscribe](PublishSubscribe.md)
3. [Routing](Routing.md)
1. [Worker queue](tutorials/WorkerQueue.md)
2. [Publish - Subscribe](tutorials/PublishSubscribe.md)
3. [Routing](tutorials/Routing.md)

**Note:** The [official documentation](https://www.rabbitmq.com/documentation.html)
is very good and covers each of these topics in great detail. We recommend
reading it to get a complete understanding. They also provide this [great tool](http://tryrabbitmq.com)
to help you explore diferent messaging patterns.
to help you explore different messaging patterns.

---

To use the project as a dependency of your project, take a look at:

- [How to use Ansible as a dependency](how-to/how-to-use-as-dependency-in-pharo.md)
- [Baseline groups reference](reference/Baseline-groups.md)
35 changes: 35 additions & 0 deletions docs/how-to/how-to-load-in-pharo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# How to load Ansible in a Pharo image

## Using Metacello

1. Download a [Pharo VM and image](https://pharo.org/download)
2. Open your Pharo image
3. Open a Playground
4. Evaluate:

```smalltalk
Metacello new
baseline: 'Ansible';
repository: 'github://ba-st/Ansible:release-candidate';
load: 'Development'.
```
> Change `release-candidate` to some released version if you want a pinned version
## Using Iceberg
1. Download [pharo VM and image](https://pharo.org/download)
2. Open your Pharo image
3. Open Iceberg
4. Click the *Add* repository button
5. Select *Clone from github.com* and enter `ba-st` as owner name and `Ansible`
as project name
6. Click *Ok*
7. Select the repository in the main Iceberg window
8. Open the contextual menu and select
*Metacello -> Install baseline of Ansible ...*
9. Type `Development` and click *Ok*
> After Iceberg cloned a repository, it will be checked-out at the default
> branch (in this case `release-candidate`). If you want to work on a different
> branch or commit, perform the checkout before the baseline installation step.
42 changes: 42 additions & 0 deletions docs/how-to/how-to-use-as-dependency-in-pharo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# How to use Ansible as dependency in a Pharo product

In order to include **Ansible** as part of your project, you should reference
the package in your product baseline:

1. Define the Ansible repository and version to be used, and the [baseline groups](../reference/Baseline-groups.md)
you want to depend on (usually it will be `Deployment`).

If you're unsure on what to depend use the *Dependency Analyzer*
tool to choose an appropriate group including the packages you need.

2. Create a method like this one in the baseline class of your product:

```smalltalk
setUpDependencies: spec
spec
baseline: 'Ansible'
with: [ spec repository: 'github://github://ba-st/Ansible:v{XX}' ];
project: 'Ansible-Deployment'
copyFrom: 'Ansible' with: [ spec loads: 'Deployment' ]
```
This will create `Ansible-Deployment` as a valid target that can be used
as requirement in your own packages.
> Replace `{XX}` with the version you want to depend on
3. Use the new loading target as a requirement on your packages. For example:
```smalltalk
baseline: spec
<baseline>
spec
for: #pharo
do: [
self setUpDependencies: spec.
spec
package: 'My-Package'
with: [ spec requires: #('Ansible-Deployment') ] ]
```
12 changes: 12 additions & 0 deletions docs/reference/Baseline-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Baseline Groups

Ansible includes the following groups in its Baseline that can be used as
loading targets:

- `Deployment` will load all the packages needed in a deployed application
- `Tests` will load the test cases
- `Tools` will load tooling extensions
- `CI` is the group loaded in the continuous integration setup, in this
particular case it is the same as `Tests`
- `Development` will load all the needed packages to develop and contribute to
the project
Loading

0 comments on commit 9f48c39

Please sign in to comment.