Skip to content

Commit c270638

Browse files
authored
Modernize gem (#11)
* Tidy up copyrights. * Migrate all tests.
1 parent 83eaf5c commit c270638

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1310
-1772
lines changed

.github/workflows/coverage.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
COVERAGE: PartialSummary
11+
12+
jobs:
13+
test:
14+
name: ${{matrix.ruby}} on ${{matrix.os}}
15+
runs-on: ${{matrix.os}}-latest
16+
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu
21+
- macos
22+
23+
ruby:
24+
- "3.2"
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{matrix.ruby}}
31+
bundler-cache: true
32+
33+
- name: Run tests
34+
timeout-minutes: 5
35+
run: bundle exec bake test
36+
37+
- uses: actions/upload-artifact@v2
38+
with:
39+
name: coverage-${{matrix.os}}-${{matrix.ruby}}
40+
path: .covered.db
41+
42+
validate:
43+
needs: test
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: "3.2"
51+
bundler-cache: true
52+
53+
- uses: actions/download-artifact@v3
54+
55+
- name: Validate coverage
56+
timeout-minutes: 5
57+
run: bundle exec bake covered:validate --paths */.covered.db \;

.github/workflows/documentation.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Allows you to run this workflow manually from the Actions tab:
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment:
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
env:
23+
CONSOLE_OUTPUT: XTerm
24+
BUNDLE_WITH: maintenance
25+
26+
jobs:
27+
generate:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v3
32+
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: "3.2"
36+
bundler-cache: true
37+
38+
- name: Installing packages
39+
run: sudo apt-get install wget
40+
41+
- name: Generate documentation
42+
timeout-minutes: 5
43+
run: bundle exec bake utopia:project:static --force no
44+
45+
- name: Upload documentation artifact
46+
uses: actions/upload-pages-artifact@v1
47+
with:
48+
path: docs
49+
50+
deploy:
51+
runs-on: ubuntu-latest
52+
53+
environment:
54+
name: github-pages
55+
url: ${{steps.deployment.outputs.page_url}}
56+
57+
needs: generate
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v1

.github/workflows/documentation.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/test-external.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test External
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
11+
jobs:
12+
test:
13+
name: ${{matrix.ruby}} on ${{matrix.os}}
14+
runs-on: ${{matrix.os}}-latest
15+
16+
strategy:
17+
matrix:
18+
os:
19+
- ubuntu
20+
- macos
21+
22+
ruby:
23+
- "2.7"
24+
- "3.0"
25+
- "3.1"
26+
- "3.2"
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: ${{matrix.ruby}}
33+
bundler-cache: true
34+
35+
- name: Run tests
36+
timeout-minutes: 10
37+
run: bundle exec bake test:external

.github/workflows/development.yml renamed to .github/workflows/test.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
name: Development
1+
name: Test
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
511
jobs:
612
test:
713
name: ${{matrix.ruby}} on ${{matrix.os}}
@@ -15,12 +21,12 @@ jobs:
1521
- macos
1622

1723
ruby:
18-
- "2.6"
1924
- "2.7"
2025
- "3.0"
26+
- "3.1"
27+
- "3.2"
2128

2229
experimental: [false]
23-
env: [""]
2430

2531
include:
2632
- os: ubuntu
@@ -34,12 +40,12 @@ jobs:
3440
experimental: true
3541

3642
steps:
37-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
3844
- uses: ruby/setup-ruby@v1
3945
with:
4046
ruby-version: ${{matrix.ruby}}
4147
bundler-cache: true
4248

4349
- name: Run tests
44-
timeout-minutes: 5
45-
run: ${{matrix.env}} bundle exec rspec
50+
timeout-minutes: 10
51+
run: bundle exec bake test

.gitignore

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
/.bundle/
2-
/.yardoc
3-
/_yardoc/
4-
/coverage/
5-
/doc/
62
/pkg/
7-
/spec/reports/
8-
/tmp/
9-
/fuzz/*/output/
10-
11-
# rspec failure tracking
12-
.rspec_status
133
/gems.locked
14-
.covered.db
4+
/.covered.db
5+
/external

.rspec

Lines changed: 0 additions & 3 deletions
This file was deleted.

config/external.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
async-http:
2+
url: https://github.com/socketry/async-http.git
3+
command: bundle exec rspec

config/sus.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2023, by Samuel Williams.
5+
6+
require 'covered/sus'
7+
include Covered::Sus

examples/http2/request.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2019-2023, by Samuel Williams.
15

26
$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
37

0 commit comments

Comments
 (0)