diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bd3c779..2e0f0fd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,9 +1,9 @@ name: Deploy documentation on: - push: - branches: - - main + workflow_dispatch: + release: + types: [published] jobs: deploy: @@ -21,7 +21,7 @@ jobs: run: shards install --ignore-crystal-version - name: "Generate docs" - run: crystal docs + run: crystal docs --project-name=Decorator --project-version=${GITHUB_REF##*/} - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 diff --git a/.github/workflows/shard.yml b/.github/workflows/shard.yml index 3b1b74f..126cacc 100644 --- a/.github/workflows/shard.yml +++ b/.github/workflows/shard.yml @@ -25,11 +25,14 @@ jobs: runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} - container: crystallang/crystal:${{ matrix.crystal_version }}-alpine steps: - uses: actions/checkout@v2 + - uses: oprypin/install-crystal@v1 + with: + crystal: ${{matrix.crystal_version}} + - name: Check format run: crystal tool format --check @@ -49,7 +52,7 @@ jobs: if: steps.crystal-cache.outputs.cache-hit != 'true' run: shards check || shards install --ignore-crystal-version - - name: Crystal Ameba Linter + - name: Run Ameba static code analysis run: ./bin/ameba - name: Run tests diff --git a/README.md b/README.md index bc9fe93..17e5e28 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,9 @@ Run `shards install` ## 🎬 Screencast -
+ -[Watch Screencast](https://luckycasts.com/videos/decorator-shard) +[Watch a LuckyCast on the Decorator shard](https://luckycasts.com/videos/decorator-shard) ## Usage @@ -34,10 +32,10 @@ Require the shard: require "decorator" ``` -Create a decorator that inherits from Decorator::Base, and tell the decorator what it `decorates` to decorate: +Create a decorator `Struct` that inherits from `Decorator::Base`, and define what it `decorates`: ```crystal -class TimeDecorator < Decorator::Base +struct TimeDecorator < Decorator::Base decorates time : Time # Return a pretty version of a date and weekday in the format: @@ -54,7 +52,7 @@ class TimeDecorator < Decorator::Base end ``` -In the above example, `Decorator` adds the following to the `TimeDecorator` class for you: +In the above example, `Decorator` adds the following to the `TimeDecorator` struct for you: - An `initialize(@time : Time)` method - A `getter` (or `getter?` for `Bool` types) for `@time` diff --git a/shard.yml b/shard.yml index 7e61fa2..2d59b43 100644 --- a/shard.yml +++ b/shard.yml @@ -1,6 +1,6 @@ name: decorator description: A simple object decoration library for Crystal apps -version: 0.3.0 +version: 1.0.0 authors: - Stephen Dolan