Skip to content

Commit f13a3c3

Browse files
authored
Modernize gem. (#20)
* Remove profiling support - it segfaults on Ruby head.
1 parent 048847a commit f13a3c3

30 files changed

+300
-366
lines changed

.github/workflows/async-v1.yml renamed to .github/workflows/async-v1.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ jobs:
1212
- ubuntu
1313

1414
ruby:
15-
- 2.7
16-
15+
- "2.7"
16+
- "3.0"
17+
- "3.1"
18+
- "3.2"
19+
1720
env:
1821
BUNDLE_GEMFILE: gems/async-v1.rb
1922

.github/workflows/async-head.yml renamed to .github/workflows/async-v2.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Async head
1+
name: Async v2
22

33
on: [push, pull_request]
44

@@ -12,10 +12,11 @@ jobs:
1212
- ubuntu
1313

1414
ruby:
15-
- head
15+
- "3.1"
16+
- "3.2"
1617

1718
env:
18-
BUNDLE_GEMFILE: gems/async-head.rb
19+
BUNDLE_GEMFILE: gems/async-v2.rb
1920

2021
steps:
2122
- uses: actions/checkout@v2

.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 & 32 deletions
This file was deleted.

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
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:
13+
name: ${{matrix.ruby}} on ${{matrix.os}}
714
runs-on: ${{matrix.os}}-latest
815
continue-on-error: ${{matrix.experimental}}
916

@@ -14,12 +21,12 @@ jobs:
1421
- macos
1522

1623
ruby:
17-
- 2.6
18-
- 2.7
24+
- "2.7"
1925
- "3.0"
26+
- "3.1"
27+
- "3.2"
2028

2129
experimental: [false]
22-
env: [""]
2330

2431
include:
2532
- os: ubuntu
@@ -33,12 +40,12 @@ jobs:
3340
experimental: true
3441

3542
steps:
36-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
3744
- uses: ruby/setup-ruby@v1
3845
with:
3946
ruby-version: ${{matrix.ruby}}
4047
bundler-cache: true
4148

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

.gitignore

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/.bundle/
2-
/.yardoc
3-
/gems.locked
4-
/_yardoc/
5-
/coverage/
6-
/doc/
72
/pkg/
8-
/spec/reports/
9-
/tmp/
3+
/gems.locked
4+
/.covered.db
5+
/external
106

11-
# rspec failure tracking
12-
.rspec_status
13-
.covered.db
7+
/.rspec
8+
/.rspec_status

async-rspec.gemspec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12

23
require_relative "lib/async/rspec/version"
34

@@ -6,12 +7,15 @@ Gem::Specification.new do |spec|
67
spec.version = Async::RSpec::VERSION
78

89
spec.summary = "Helpers for writing specs against the async gem."
9-
spec.authors = ["Samuel Williams"]
10+
spec.authors = ["Samuel Williams", "Janko Marohnić", "Olle Jonsson", "Cyril Roelandt", "Jeremy Jung", "Robin Goos"]
1011
spec.license = "MIT"
1112

13+
spec.cert_chain = ['release.cert']
14+
spec.signing_key = File.expand_path('~/.gem/release.pem')
15+
1216
spec.homepage = "https://github.com/socketry/async-rspec"
1317

14-
spec.files = Dir.glob('{lib}/**/*', File::FNM_DOTMATCH, base: __dir__)
18+
spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)
1519

1620
spec.add_dependency "rspec", "~> 3.0"
1721
spec.add_dependency "rspec-files", "~> 1.0"

gems.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2017-2023, by Samuel Williams.
5+
16
source 'https://rubygems.org'
27

38
# Specify your gem's dependencies in async-rspec.gemspec
49
gemspec
510

611
# gem "async", path: "../async"
712

13+
gem "rugged", "= 1.4.4"
14+
815
group :maintenance, optional: true do
916
gem "bake-modernize"
10-
gem "bake-bundler"
17+
gem "bake-gem"
1118
end
1219

1320
group :test do
14-
gem "ruby-prof", git: "https://github.com/ruby-prof/ruby-prof"
21+
gem "bake-test"
1522
end

gems/async-head.rb

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

gems/async-v1.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
# Released under the MIT License.
4+
# Copyright, 2021, by Samuel Williams.
5+
36
source 'https://rubygems.org'
47

58
gemspec path: "../"

gems/async-v2.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2021-2023, by Samuel Williams.
5+
6+
source 'https://rubygems.org'
7+
8+
gemspec path: "../"
9+
10+
gem 'async', '~> 2.0'

lib/async/rspec.rb

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2-
#
3-
# Permission is hereby granted, free of charge, to any person obtaining a copy
4-
# of this software and associated documentation files (the "Software"), to deal
5-
# in the Software without restriction, including without limitation the rights
6-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
# copies of the Software, and to permit persons to whom the Software is
8-
# furnished to do so, subject to the following conditions:
9-
#
10-
# The above copyright notice and this permission notice shall be included in
11-
# all copies or substantial portions of the Software.
12-
#
13-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
# THE SOFTWARE.
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2017-2018, by Samuel Williams.
205

216
require_relative "rspec/version"
227
require_relative "rspec/reactor"

lib/async/rspec/buffer.rb

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2-
#
3-
# Permission is hereby granted, free of charge, to any person obtaining a copy
4-
# of this software and associated documentation files (the "Software"), to deal
5-
# in the Software without restriction, including without limitation the rights
6-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
# copies of the Software, and to permit persons to whom the Software is
8-
# furnished to do so, subject to the following conditions:
9-
#
10-
# The above copyright notice and this permission notice shall be included in
11-
# all copies or substantial portions of the Software.
12-
#
13-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
# THE SOFTWARE.
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2018, by Samuel Williams.
205

216
require 'securerandom'
227

0 commit comments

Comments
 (0)