Skip to content

Commit 68b46b3

Browse files
committed
Modernize gem.
1 parent 45b991b commit 68b46b3

Some content is hidden

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

72 files changed

+329
-1014
lines changed

.github/workflows/coverage.yml renamed to .github/workflows/coverage.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ permissions:
66
contents: read
77

88
env:
9-
CONSOLE_OUTPUT: Text
9+
CONSOLE_OUTPUT: XTerm
1010
COVERAGE: PartialSummary
1111

1212
jobs:
@@ -18,7 +18,6 @@ jobs:
1818
matrix:
1919
os:
2020
- ubuntu
21-
- macos
2221

2322
ruby:
2423
- "3.1"
@@ -32,7 +31,7 @@ jobs:
3231

3332
- name: Run tests
3433
timeout-minutes: 5
35-
run: bundle exec rspec
34+
run: bundle exec bake test
3635

3736
- uses: actions/upload-artifact@v2
3837
with:

.github/workflows/documentation.yaml

+61
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.1"
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

-41
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
name: External
1+
name: Test External
22

33
on: [push, pull_request]
44

55
permissions:
66
contents: read
77

88
env:
9-
CONSOLE_OUTPUT: Text
9+
CONSOLE_OUTPUT: XTerm
1010

1111
jobs:
1212
test:
1313
name: ${{matrix.ruby}} on ${{matrix.os}}
1414
runs-on: ${{matrix.os}}-latest
15-
15+
1616
strategy:
1717
matrix:
1818
os:
1919
- ubuntu
20-
20+
2121
ruby:
2222
- "3.1"
23-
- "head"
24-
23+
2524
steps:
2625
- uses: actions/checkout@v3
2726
- uses: ruby/setup-ruby@v1
2827
with:
2928
ruby-version: ${{matrix.ruby}}
3029
bundler-cache: true
31-
30+
3231
- name: Run tests
33-
timeout-minutes: 5
34-
run: ${{matrix.env}} bundle exec bake external
32+
timeout-minutes: 10
33+
run: bundle exec bake test:external

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Development
1+
name: Test
22

33
on: [push, pull_request]
44

55
permissions:
66
contents: read
77

88
env:
9-
CONSOLE_OUTPUT: Text
9+
CONSOLE_OUTPUT: XTerm
1010

1111
jobs:
1212
test:
@@ -30,7 +30,7 @@ jobs:
3030
ruby: truffleruby
3131
experimental: true
3232
- os: ubuntu
33-
ruby: jruby
33+
ruby: jruby-head
3434
experimental: true
3535
- os: ubuntu
3636
ruby: head
@@ -44,5 +44,5 @@ jobs:
4444
bundler-cache: true
4545

4646
- name: Run tests
47-
timeout-minutes: 5
48-
run: bundle exec rspec
47+
timeout-minutes: 10
48+
run: bundle exec bake test

.gitignore

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
.tags
2-
31
/.bundle/
4-
/.yardoc
5-
/gems.locked
6-
/_yardoc/
7-
/coverage/
8-
/doc/
92
/pkg/
10-
/spec/reports/
11-
/tmp/
12-
/external/
3+
/gems.locked
4+
/.covered.db
5+
/external
136

14-
.rspec_status
15-
.covered.db
7+
/.rspec_status

.mailmap

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Jun Jiang <[email protected]>
2+
Ken Muryoi <[email protected]>
3+
Jeremy Jung <[email protected]>
4+
Sokolov Yura <[email protected]>

async.gemspec

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515

1616
spec.homepage = "https://github.com/socketry/async"
1717

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

2020
spec.required_ruby_version = ">= 3.1.1"
2121

@@ -24,7 +24,8 @@ Gem::Specification.new do |spec|
2424
spec.add_dependency "timers", "~> 4.1"
2525

2626
spec.add_development_dependency "async-rspec", "~> 1.1"
27-
spec.add_development_dependency "bake"
27+
spec.add_development_dependency "bake-test"
28+
spec.add_development_dependency "bake-test-external"
2829
spec.add_development_dependency "benchmark-ips"
2930
spec.add_development_dependency "bundler"
3031
spec.add_development_dependency "covered", "~> 0.10"

bake.rb

+3
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, 2020-2022, by Samuel Williams.
5+
36
def external
47
require 'bundler'
58

benchmark/async_vs_lightio.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2018-2022, by Samuel Williams.
6+
47
require 'async'
58
require 'lightio'
69

benchmark/fiber_count.rb

+3
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, 2019-2022, by Samuel Williams.
5+
36
fibers = []
47

58
(1..).each do |i|

benchmark/rubies/benchmark.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2019-2022, by Samuel Williams.
6+
47
require 'socket'
58
require 'fiber'
69

@@ -217,4 +220,4 @@ def write(buffer)
217220

218221
puts Process.times
219222

220-
# Exit
223+
# Exit

benchmark/thread_count.rb

+3
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, 2019-2022, by Samuel Williams.
5+
36
threads = []
47

58
(1..).each do |i|

benchmark/thread_vs_fiber.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

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

247
require 'benchmark/ips'
258

examples/buffer/buffer.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# Released under the MIT License.
5+
# Copyright, 2021-2022, by Samuel Williams.
26

37
# abort "Need IO::Buffer" unless IO.const_defined?(:Buffer)
48

examples/callback/loop.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# Released under the MIT License.
5+
# Copyright, 2018-2022, by Samuel Williams.
26

37
# frozen_string_literal: true
48

examples/capture/capture.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2019-2022, by Samuel Williams.
6+
47
require 'irb'
58
require 'console'
69

examples/queue/producer.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2019-2022, by Samuel Williams.
6+
47
require 'async'
58
require 'async/queue'
69

examples/stop/condition.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4-
# require 'async'; require 'async/queue'
4+
# Released under the MIT License.
5+
# Copyright, 2019-2022, by Samuel Williams.
56

67
require_relative '../../lib/async'; require_relative '../../lib/async/queue'
78

examples/stop/sleep.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2019-2022, by Samuel Williams.
6+
47
require_relative '../../lib/async'
58

69
require 'async/http/endpoint'

gems.rb

+3
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, 2020-2022, by Samuel Williams.
5+
36
source 'https://rubygems.org'
47

58
gemspec

0 commit comments

Comments
 (0)