-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Fiber storage for inheritance/dynamic scope. (#3)
* Modernize gem.
- Loading branch information
Showing
18 changed files
with
353 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,7 @@ root = true | |
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
|
||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Coverage | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CONSOLE_OUTPUT: XTerm | ||
COVERAGE: PartialSummary | ||
|
||
jobs: | ||
test: | ||
name: ${{matrix.ruby}} on ${{matrix.os}} | ||
runs-on: ${{matrix.os}}-latest | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu | ||
- macos | ||
|
||
ruby: | ||
- "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: 5 | ||
run: bundle exec bake test | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-${{matrix.os}}-${{matrix.ruby}} | ||
path: .covered.db | ||
|
||
validate: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.3" | ||
bundler-cache: true | ||
|
||
- uses: actions/download-artifact@v3 | ||
|
||
- name: Validate coverage | ||
timeout-minutes: 5 | ||
run: bundle exec bake covered:validate --paths */.covered.db \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages: | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment: | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
env: | ||
CONSOLE_OUTPUT: XTerm | ||
BUNDLE_WITH: maintenance | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.3" | ||
bundler-cache: true | ||
|
||
- name: Installing packages | ||
run: sudo apt-get install wget | ||
|
||
- name: Generate documentation | ||
timeout-minutes: 5 | ||
run: bundle exec bake utopia:project:static --force no | ||
|
||
- name: Upload documentation artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{steps.deployment.outputs.page_url}} | ||
|
||
needs: generate | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
# Released under the MIT License. | ||
# Copyright, 2021, by Samuel Williams. | ||
|
||
require_relative '../lib/fiber/local' | ||
|
||
require 'securerandom' | ||
|
||
module RequestID | ||
extend Fiber::Local | ||
end | ||
|
||
Fiber.new do | ||
RequestID.instance = SecureRandom.uuid | ||
|
||
pp RequestID.instance | ||
|
||
pp Fiber.current | ||
|
||
Fiber.new do | ||
pp RequestID.instance | ||
end.resume | ||
end.resume | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
# Released under the MIT License. | ||
# Copyright, 2020-2024, by Samuel Williams. | ||
|
||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
group :maintenance, optional: true do | ||
gem "bake-bundler" | ||
gem "bake-gem" | ||
gem "bake-modernize" | ||
|
||
gem "utopia-project" | ||
end | ||
|
||
group :test do | ||
gem "sus" | ||
gem "covered" | ||
|
||
gem "bake-test" | ||
gem "bake-test-external" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.