From 2e9aa332a25d1f4435ede65bb8f345f96aea72b3 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sun, 19 May 2024 10:00:06 +0900 Subject: [PATCH] Modernize gem and fix links. --- .editorconfig | 4 ++++ .github/workflows/coverage.yaml | 9 +++---- .github/workflows/documentation.yaml | 11 ++++----- .github/workflows/test-external.yaml | 36 ++++++++++++++++++++++++++++ .github/workflows/test.yaml | 3 ++- config/external.yaml | 3 +++ fiber-storage.gemspec | 14 ++++++----- gems.rb | 4 +++- lib/fiber/storage/version.rb | 2 +- readme.md | 2 ++ 10 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/test-external.yaml create mode 100644 config/external.yaml diff --git a/.editorconfig b/.editorconfig index 538ba2b..a6e7d26 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,7 @@ root = true [*] indent_style = tab indent_size = 2 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 74e529f..8cb4108 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -23,10 +23,11 @@ jobs: - "3.0" - "3.1" - "3.2" + - "3.3" - "head" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} @@ -36,7 +37,7 @@ jobs: timeout-minutes: 5 run: bundle exec bake test - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: coverage-${{matrix.os}}-${{matrix.ruby}} path: .covered.db @@ -46,10 +47,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.3" bundler-cache: true - uses: actions/download-artifact@v3 diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 0e435e2..f5f553a 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -5,9 +5,6 @@ on: branches: - main - # Allows you to run this workflow manually from the Actions tab: - workflow_dispatch: - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages: permissions: contents: read @@ -28,11 +25,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.3" bundler-cache: true - name: Installing packages @@ -43,7 +40,7 @@ jobs: run: bundle exec bake utopia:project:static --force no - name: Upload documentation artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 with: path: docs @@ -58,4 +55,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test-external.yaml b/.github/workflows/test-external.yaml new file mode 100644 index 0000000..21898f5 --- /dev/null +++ b/.github/workflows/test-external.yaml @@ -0,0 +1,36 @@ +name: Test External + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + +jobs: + test: + name: ${{matrix.ruby}} on ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + + strategy: + matrix: + os: + - ubuntu + - macos + + ruby: + - "3.1" + - "3.2" + - "3.3" + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 10 + run: bundle exec bake test:external diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3000efe..f25c810 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,6 +25,7 @@ jobs: - "3.0" - "3.1" - "3.2" + - "3.3" - "head" experimental: [false] @@ -41,7 +42,7 @@ jobs: experimental: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} diff --git a/config/external.yaml b/config/external.yaml new file mode 100644 index 0000000..53b5a4c --- /dev/null +++ b/config/external.yaml @@ -0,0 +1,3 @@ +console: + uri: https://github.com/socketry/console + command: bundle exec bake test diff --git a/fiber-storage.gemspec b/fiber-storage.gemspec index c406bee..7d922da 100644 --- a/fiber-storage.gemspec +++ b/fiber-storage.gemspec @@ -13,13 +13,15 @@ Gem::Specification.new do |spec| spec.cert_chain = ['release.cert'] spec.signing_key = File.expand_path('~/.gem/release.pem') - spec.homepage = "https://github.com/socketry/fiber-storage" + spec.homepage = "https://github.com/ioquatix/fiber-storage" - spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) + spec.metadata = { + "documentation_uri" => "https://ioquatix.github.io/fiber-storage/", + "funding_uri" => "https://github.com/sponsors/ioquatix/", + "source_code_uri" => "https://github.com/ioquatix/fiber-storage.git", + } - spec.required_ruby_version = ">= 2.7.0" + spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) - spec.add_development_dependency "bundler" - spec.add_development_dependency "covered" - spec.add_development_dependency "sus" + spec.required_ruby_version = ">= 2.7" end diff --git a/gems.rb b/gems.rb index 015b416..2dc28fb 100644 --- a/gems.rb +++ b/gems.rb @@ -13,7 +13,9 @@ end group :test do - gem "bake-test" gem "sus" gem "covered" + + gem "bake-test" + gem "bake-test-external" end diff --git a/lib/fiber/storage/version.rb b/lib/fiber/storage/version.rb index 9bf471c..f1a0bee 100644 --- a/lib/fiber/storage/version.rb +++ b/lib/fiber/storage/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2022, by Samuel Williams. +# Copyright, 2022-2023, by Samuel Williams. require 'fiber' diff --git a/readme.md b/readme.md index f759c23..e51290d 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,8 @@ This gem provides a shim for `Fiber.[]`, `Fiber.[]=`, `Fiber#storage`, `Fiber#storage=`, which was introduced in Ruby 3.2. +[![Development Status](https://github.com/ioquatix/fiber-storage/workflows/Test/badge.svg)](https://github.com/ioquatix/fiber-storage/actions?workflow=Test) + ## Motivation Ruby 3.2 introduces inheritable fiber storage for per-request or per-operation state. This gem provides a shim for Ruby 3.1 and earlier to make adoption easier. It isn't able to provide the full range of features, but it should be sufficient for most use cases.