Skip to content

Commit

Permalink
Merge pull request #88 from ba-st/gs64-pre-release
Browse files Browse the repository at this point in the history
GS64: Pre-release updates
  • Loading branch information
gcotelli authored Aug 10, 2023
2 parents 16a3d09 + f5a18ff commit a2c26e2
Show file tree
Hide file tree
Showing 17 changed files with 395 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/loading-gs64-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'GS64 Components Loading'

on: [push,pull_request,workflow_dispatch]

jobs:
component-loading:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
load-spec: [ Deployment, Dependent-SUnit-Extensions ]
name: GS64 + ${{ matrix.load-spec }}
steps:
- uses: actions/checkout@v3
- name: Load component in image
uses: ba-st-actions/gs64-ci@v1
with:
project_name: 'Buoy'
load_spec: 'Buoy-${{ matrix.load-spec }}'
4 changes: 1 addition & 3 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Release Notifications

on:
release:
types: [published]
on: workflow_dispatch

jobs:
notify:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Tests
name: Pharo Unit Tests

on: [push,pull_request,workflow_dispatch]

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
This project aims to complement [Pharo](https://www.pharo.org) and [GS64](https://gemtalksystems.com/products/gs64/)
adding useful extensions.

[![Unit Tests](https://github.com/ba-st/Buoy/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/unit-tests.yml)
[![Pharo - Unit Tests](https://github.com/ba-st/Buoy/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/unit-tests.yml)
[![GS64 - Unit Tests](https://github.com/ba-st/Buoy/actions/workflows/unit-tests-gs64.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/unit-tests-gs64.yml)
[![Coverage Status](https://codecov.io/github/ba-st/Buoy/coverage.svg?branch=release-candidate)](https://codecov.io/gh/ba-st/Buoy/branch/release-candidate)

[![Baseline Groups](https://github.com/ba-st/Buoy/actions/workflows/loading-groups.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/loading-groups.yml)
[![GS64 Components](https://github.com/ba-st/Buoy/actions/workflows/loading-gs64-components.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/loading-gs64-components.yml)
[![Markdown Lint](https://github.com/ba-st/Buoy/actions/workflows/markdown-lint.yml/badge.svg)](https://github.com/ba-st/Buoy/actions/workflows/markdown-lint.yml)

[![GitHub release](https://img.shields.io/github/release/ba-st/Buoy.svg)](https://github.com/ba-st/Buoy/releases/latest)

[![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)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org)

[![GS64 3.6.6](https://img.shields.io/badge/GS64-3.6.6-informational)](https://gemtalksystems.com/products/gs64/)

Quick links

- [**Explore the docs**](docs/README.md)
Expand All @@ -41,7 +47,7 @@ Quick links

## Installation

To load the project in a Pharo image follow this [instructions](docs/how-to/how-to-load-in-pharo.md).
To load the project in a Pharo image follow these [instructions](docs/how-to/how-to-load-in-pharo.md).

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ understanding over specific topics:
required values, that can be unknown at the beginning of an execution.
See the [related documentation.](reference/BindingsAndOptionals.md)
- **Exception Handling**: Extensions to the [exception handling mechanics](reference/ExceptionHandling.md).
- **Meta-programming**: Some abstractions like [namespaces](reference/Namespaces.md)
and [interfaces](reference/Interfaces.md).
- **Meta-programming**: Some abstractions like [namespaces](reference/Namespaces.md),
[interfaces](reference/Interfaces.md) and extensions to the [Object model](reference/MOP.md).
- **SUnit**: [Extensions to the SUnit framework](reference/SUnit.md).

---

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

- [How to use Buoy as a dependency](how-to/how-to-use-as-dependency-in-pharo.md)
- [Baseline groups reference](reference/Baseline-groups.md)
- [Pharo: How to use Buoy as a dependency](how-to/how-to-use-as-dependency-in-pharo.md)
- [Baseline groups & components reference](reference/Baseline-groups.md)
19 changes: 18 additions & 1 deletion docs/reference/Baseline-groups.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Baseline Groups
# Baseline Groups & GS 64 Components

## Pharo Baseline Groups

Buoy includes the following groups in its Baseline that can be used as
loading targets:
Expand All @@ -11,3 +13,18 @@ loading targets:
particular case it is the same as `Tests`
- `Development` will load all the needed packages to develop and contribute to
the project

- `GS64-Development` is an optional group that will load `Development` and all
the packages required to develop changes applicable to GS64. Loading this package
will make dirty other packages in the project but this is expected, just remember
to cherry-pick the changes to commit and don't remove the changed methods in the
Pharo package.

## GS64 Components

Buoy includes the following components in its Rowan configuration that can be
used as loading targets:

- `Deployment` will load all the packages needed in a deployed application
- `Tests` will load the test cases
- `Dependent-SUnit-Extensions` will load extensions to SUnit
47 changes: 47 additions & 0 deletions docs/reference/Collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ Some examples
#( #(1) #(3 1) #(2) ) minUsing: [:array | array first ] >>> 1
```

### `Collection` extensions for GS64

- `anyOne` is just an alias of `any`
- `collect:as:` evaluates a block with each of the receiver's elements as the
argument collecting the result into an instance of the argument class.
- `count:` counts the number of elements evaluating true for the argument block.
- `detect:ifFound:` evaluates an action block if any of the elements match the
condition block. If no elements match does nothing.
- `detect:ifFound:ifNone:` evaluates an action block if any of the elements match
the condition block. If no elements match evaluates the fail block.
- `ifEmpty:ifNotEmpty:` evaluates one of two blocks depending on the collection emptiness.
- `removeAll` removes all elements of the receiver.
- `select:thenCollect:` filters the elements in the receiver using the condition
block, collecting after the results evaluating the action block.

## `SequenceableCollection` extensions

- `copyFirst:` Copy the first `n` elements of the collection. If `n` is 0 it
Expand Down Expand Up @@ -67,6 +82,38 @@ Some examples
```

### `SequenceableCollection` extensions for GS64

- `copyAfter:` returns a copy of the receiver after the first occurrence
of the argument up to the end, or empty if no element matches.
- `endsWith:` returns true if the argument is a suffix of the receiver.
- `writeStream` returns a write stream over the receiver.

## `Dictionary` extensions for GS64

- `at:ifPresent:ifAbsentPut:` lookups a value, if any matches evaluates a block,
if no one matches put under the key the result o evaluating the second block.

## `String` extensions for GS64

- `expandMacros`
- `expandMacrosWith:`
- `expandMacrosWith:With:`
- `expandMacrosWith:With:With:`
- `expandMacrosWith:With:With:With:`
- `expandMacrosWithArguments:`

These methods interpolate the receiver pattern using the provided arguments:

- `<r>` is replaced by `CR`
- `<l>` is replaced by `LF`
- `<n>` is replaced by the underlying OS line delimiter
- `<t>` is replaced by `TAB`
- `<Np>` is replaced by the `printString` of the nth argument
- `<Ns>` is replaced by the string provided in the nth argument
- `<N?trueString:falseString>` is replaced by `trueString` or `falseString`
depending on the boolean provided in the nth argument.

## Circular Iterator

A `CircularIterator` provides an abstraction to iterate over a collection
Expand Down
10 changes: 10 additions & 0 deletions docs/reference/MOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Meta Object Protocol

## `Symbol` extensions for GS64

- `value:` allows to use a unary symbol as a replacement for a unary block

## `Class` extensions for GS64

- `allLeafSubclasses` returns all the subclasses of the receiver that don't
have further subclasses
19 changes: 15 additions & 4 deletions docs/reference/Math.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The easier way to create a percentage is to send the message `percent` to a
number. For example `5 percent` will create an object representing `5%`.
There are two common cases also covered as instance creation methods (`0%` and
There are two common cases also covered as instance creation methods (`0%` and
`100%`):

```smalltalk
Expand All @@ -22,8 +22,8 @@ Percentage ratio: 1. "100%"
Percentage ratio: 1/2 "50%"
```

This percentages can be operated arithmetically with any number or other
percentages. Try printing the following expressions:
These percentages can be operated arithmetically with any number or other
percentages. Try printing the following expressions:

```smalltalk
20 percent * 5. "1"
Expand Down Expand Up @@ -53,5 +53,16 @@ create one is to send the message `perMille` to a number.
12 perMille "12‰"
```

## `Number` Extensions for GS64

- `isZero` returns true if the receiver equals 0
- `nthRoot:` returns the nth root of the receiver
- `round:` round the decimal part of the receiver to be limited to the desired
number of decimal digits

## `Float` Extensions for GS64

- `isInfinite` returns true if the receiver is infinite

---
Some definitions and examples are based on the ones in [Wikipedia](https://en.wikipedia.org/wiki/Percentage)
Some definitions and examples are based on the ones on [Wikipedia](https://en.wikipedia.org/wiki/Percentage)
18 changes: 17 additions & 1 deletion docs/reference/SUnit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@
sequenceable collections have the same elements in the same order
- `assert:includes:` asserts that a collection includes an element
- `deny:includes:` denies that a collection includes an element
- `should:raise:withMessageText:` asserts that a block raises an specific
- `should:raise:withMessageText:` asserts that a block raises a specific
exception including a specific message text
- `withTheOnlyOneIn:do:` provides a facility to assert that a collection has
only one element and evaluates a block with it

### `TestAsserter` extensions for GS64

- `assert:identicalTo:` asserts that an object is identical to another one
- `deny:identicalTo:` denies that an object is identical to another one
- `assertCollection:hasSameElements:` asserts that two collections have the
same elements
- `fail` will make the test fail
- `should:raise:withExceptionDo:` asserts that a block raises a specific
exception and evaluates the provided block with the signal

## `TestCase` extensions

- `runOnlyInGemStone64:` evaluates the block only if running in GS64
- `runOnlyInPharo:` evaluates the block only if running in Pharo
- `runOnlyInVAST:` evaluates the block only if running in VAST Platform
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RwSimpleProjectLoadComponentV2 {
#name : 'SUnit-Dependent-Extensions',
#name : 'Dependent-SUnit-Extensions',
#condition : 'sunit',
#projectNames : [ ],
#componentNames : [ ],
Expand Down
2 changes: 1 addition & 1 deletion rowan/components/Tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RwSimpleProjectLoadComponentV2 {
#projectNames : [ ],
#componentNames : [
'Deployment',
'SUnit-Dependent-Extensions'
'Dependent-SUnit-Extensions'
],
#packageNames : [
'Buoy-Assertions-Tests',
Expand Down
20 changes: 20 additions & 0 deletions rowan/specs/Buoy-Dependent-SUnit-Extensions.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
RwLoadSpecificationV2 {
#specName: 'Buoy-CI',
#projectName : 'Buoy',
#diskUrl : '/opt/gemstone/projects/Buoy',
#projectSpecFile : 'rowan/project.ston',
#componentNames : [
'Dependent-SUnit-Extensions'
],
#platformProperties : {
'gemstone' : {
'allusers' : {
#defaultSymbolDictName : 'Buoy'
}
}
},
#customConditionalAttributes : [
'sunit'
],
#comment : 'Loading spec for Dependent-SUnit-Extensions'
}
17 changes: 17 additions & 0 deletions rowan/specs/Buoy-Deployment.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
RwLoadSpecificationV2 {
#specName: 'Buoy-CI',
#projectName : 'Buoy',
#diskUrl : '/opt/gemstone/projects/Buoy',
#projectSpecFile : 'rowan/project.ston',
#componentNames : [
'Deployment'
],
#platformProperties : {
'gemstone' : {
'allusers' : {
#defaultSymbolDictName : 'Buoy'
}
}
},
#comment : 'Loading spec for Deployment'
}
28 changes: 27 additions & 1 deletion source/BaselineOfBuoy/BaselineOfBuoy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ BaselineOfBuoy >> baseline: spec [
baselineMath: spec;
baselineMetaprogramming: spec;
baselineSUnit: spec;
baselineTools: spec.
baselineTools: spec;
baselineGS64Development: spec.
spec
group: 'CI' with: 'Tests';
group: 'Development' with: #('Tools' 'Tests')
Expand Down Expand Up @@ -125,6 +126,31 @@ BaselineOfBuoy >> baselineExceptionHandling: spec [
group: 'Tests' with: 'Buoy-Exception-Handling-Tests'
]

{ #category : #baselines }
BaselineOfBuoy >> baselineGS64Development: spec [

spec
package: 'Buoy-GS64-Compatibility'
with: [ spec requires: 'Development' ];
group: 'GS64-Development' with: 'Buoy-GS64-Compatibility';
package: 'Buoy-Collections-GS64-Extensions'
with: [ spec requires: 'Buoy-GS64-Compatibility' ];
group: 'GS64-Development' with: 'Buoy-Collections-GS64-Extensions';
package: 'Buoy-Math-GS64-Base-Extensions'
with: [ spec requires: 'Buoy-GS64-Compatibility' ];
group: 'GS64-Development' with: 'Buoy-Math-GS64-Base-Extensions';
package: 'Buoy-Math-GS64-Extensions'
with: [ spec requires: 'Buoy-GS64-Compatibility' ];
group: 'GS64-Development' with: 'Buoy-Math-GS64-Extensions';
package: 'Buoy-Metaprogramming-GS64-Extensions'
with: [ spec requires: 'Buoy-GS64-Compatibility' ];
group: 'GS64-Development'
with: 'Buoy-Metaprogramming-GS64-Extensions';
package: 'Buoy-SUnit-GS64-Extensions'
with: [ spec requires: 'Buoy-GS64-Compatibility' ];
group: 'GS64-Development' with: 'Buoy-SUnit-GS64-Extensions'
]

{ #category : #baselines }
BaselineOfBuoy >> baselineMath: spec [

Expand Down
Loading

0 comments on commit a2c26e2

Please sign in to comment.