Skip to content

Commit 1e867bf

Browse files
Initial implementation.
1 parent 012102a commit 1e867bf

23 files changed

+1302
-3
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 2
6+
7+
[*.{yml,yaml}]
8+
indent_style = space
9+
indent_size = 2
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Documentation Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
COVERAGE: PartialSummary
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: ruby
20+
bundler-cache: true
21+
22+
- name: Validate coverage
23+
timeout-minutes: 5
24+
run: bundle exec bake decode:index:coverage lib

.github/workflows/documentation.yaml

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

.github/workflows/rubocop.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: RuboCop
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ruby
17+
bundler-cache: true
18+
19+
- name: Run RuboCop
20+
timeout-minutes: 10
21+
run: bundle exec rubocop

.github/workflows/test-coverage.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
COVERAGE: PartialSummary
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+
- ruby
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ${{matrix.ruby}}
30+
bundler-cache: true
31+
32+
- name: Run tests
33+
timeout-minutes: 5
34+
run: bundle exec bake test
35+
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
include-hidden-files: true
39+
if-no-files-found: error
40+
name: coverage-${{matrix.os}}-${{matrix.ruby}}
41+
path: .covered.db
42+
43+
validate:
44+
needs: test
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: ruby/setup-ruby@v1
50+
with:
51+
ruby-version: ruby
52+
bundler-cache: true
53+
54+
- uses: actions/download-artifact@v4
55+
56+
- name: Validate coverage
57+
timeout-minutes: 5
58+
run: bundle exec bake covered:validate --paths */.covered.db \;

.github/workflows/test-external.yaml

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

.github/workflows/test.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
test:
10+
name: ${{matrix.ruby}} on ${{matrix.os}}
11+
runs-on: ${{matrix.os}}-latest
12+
continue-on-error: ${{matrix.experimental}}
13+
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu
18+
- macos
19+
20+
ruby:
21+
- "3.2"
22+
- "3.3"
23+
- "3.4"
24+
25+
experimental: [false]
26+
27+
include:
28+
- os: ubuntu
29+
ruby: truffleruby
30+
experimental: true
31+
- os: ubuntu
32+
ruby: jruby
33+
experimental: true
34+
- os: ubuntu
35+
ruby: head
36+
experimental: true
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: ${{matrix.ruby}}
43+
bundler-cache: true
44+
45+
- name: Run tests
46+
timeout-minutes: 10
47+
run: bundle exec bake test

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/agent.md
2+
/.context
3+
/.bundle
4+
/pkg
5+
/gems.locked
6+
/.covered.db
7+
/external

.rubocop.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
plugins:
2+
- rubocop-socketry
3+
4+
AllCops:
5+
DisabledByDefault: true
6+
7+
Layout/ConsistentBlankLineIndentation:
8+
Enabled: true
9+
10+
Layout/IndentationStyle:
11+
Enabled: true
12+
EnforcedStyle: tabs
13+
14+
Layout/InitialIndentation:
15+
Enabled: true
16+
17+
Layout/IndentationWidth:
18+
Enabled: true
19+
Width: 1
20+
21+
Layout/IndentationConsistency:
22+
Enabled: true
23+
EnforcedStyle: normal
24+
25+
Layout/BlockAlignment:
26+
Enabled: true
27+
28+
Layout/EndAlignment:
29+
Enabled: true
30+
EnforcedStyleAlignWith: start_of_line
31+
32+
Layout/BeginEndAlignment:
33+
Enabled: true
34+
EnforcedStyleAlignWith: start_of_line
35+
36+
Layout/ElseAlignment:
37+
Enabled: true
38+
39+
Layout/DefEndAlignment:
40+
Enabled: true
41+
42+
Layout/CaseIndentation:
43+
Enabled: true
44+
45+
Layout/CommentIndentation:
46+
Enabled: true
47+
48+
Layout/EmptyLinesAroundClassBody:
49+
Enabled: true
50+
51+
Layout/EmptyLinesAroundModuleBody:
52+
Enabled: true
53+
54+
Layout/EmptyLineAfterMagicComment:
55+
Enabled: true
56+
57+
Layout/SpaceInsideBlockBraces:
58+
Enabled: true
59+
EnforcedStyle: no_space
60+
SpaceBeforeBlockParameters: false
61+
62+
Layout/SpaceAroundBlockParameters:
63+
Enabled: true
64+
EnforcedStyleInsidePipes: no_space
65+
66+
Style/FrozenStringLiteralComment:
67+
Enabled: true
68+
69+
Style/StringLiterals:
70+
Enabled: true
71+
EnforcedStyle: double_quotes

async-http-recorder.gemspec

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "lib/async/http/recorder/version"
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = "async-http"
7+
spec.version = Async::HTTP::Recorder::VERSION
8+
9+
spec.summary = "A HTTP request and response recorder."
10+
spec.authors = ["Samuel Williams"]
11+
spec.license = "MIT"
12+
13+
spec.homepage = "https://github.com/socketry/async-http"
14+
15+
spec.metadata = {
16+
"documentation_uri" => "https://socketry.github.io/async-http-recorder/",
17+
"source_code_uri" => "https://github.com/socketry/async-http-recorder.git",
18+
}
19+
20+
spec.files = Dir.glob(["{lib}/**/*", "*.md"], File::FNM_DOTMATCH, base: __dir__)
21+
22+
spec.required_ruby_version = ">= 3.2"
23+
24+
spec.add_dependency "async-http", "~> 0.90"
25+
end

0 commit comments

Comments
 (0)