Skip to content

Commit aec454a

Browse files
committed
Modernize gem.
1 parent d4da564 commit aec454a

36 files changed

+167
-174
lines changed

.github/workflows/rubocop.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test External
1+
name: RuboCop
22

33
on: [push, pull_request]
44

@@ -9,26 +9,14 @@ env:
99
CONSOLE_OUTPUT: XTerm
1010

1111
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-
- "3.1"
24-
- "3.2"
25-
- "3.3"
12+
check:
13+
runs-on: ubuntu-latest
2614

2715
steps:
2816
- uses: actions/checkout@v4
2917
- uses: ruby/setup-ruby@v1
3018
with:
31-
ruby-version: ${{matrix.ruby}}
19+
ruby-version: ruby
3220
bundler-cache: true
3321

3422
- name: Run RuboCop

.github/workflows/test-coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Run tests
3434
timeout-minutes: 5
3535
run: bundle exec bake test
36-
37-
- uses: actions/upload-artifact@v3
36+
37+
- uses: actions/upload-artifact@v4
3838
with:
3939
name: coverage-${{matrix.os}}-${{matrix.ruby}}
4040
path: .covered.db
@@ -50,7 +50,7 @@ jobs:
5050
ruby-version: "3.3"
5151
bundler-cache: true
5252

53-
- uses: actions/download-artifact@v3
53+
- uses: actions/download-artifact@v4
5454

5555
- name: Validate coverage
5656
timeout-minutes: 5

.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Layout/IndentationConsistency:
1616
Enabled: true
1717
EnforcedStyle: normal
1818

19+
Layout/BlockAlignment:
20+
Enabled: true
21+
1922
Layout/EndAlignment:
2023
Enabled: true
2124
EnforcedStyleAlignWith: start_of_line
@@ -44,3 +47,7 @@ Layout/EmptyLinesAroundModuleBody:
4447

4548
Style/FrozenStringLiteralComment:
4649
Enabled: true
50+
51+
Style/StringLiterals:
52+
Enabled: true
53+
EnforcedStyle: double_quotes

async-websocket.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
1010
spec.authors = ["Samuel Williams", "Simon Crocker", "Olle Jonsson", "Thomas Morgan", "Aurora Nockert", "Bryan Powell", "Emily Love Mills", "Gleb Sinyavskiy", "Janko Marohnić", "Juan Antonio Martín Lucas", "Michel Boaventura", "Peter Runich", "Ryu Sato"]
1111
spec.license = "MIT"
1212

13-
spec.cert_chain = ['release.cert']
14-
spec.signing_key = File.expand_path('~/.gem/release.pem')
13+
spec.cert_chain = ["release.cert"]
14+
spec.signing_key = File.expand_path("~/.gem/release.pem")
1515

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

@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
2121
"source_code_uri" => "https://github.com/socketry/async-websocket.git",
2222
}
2323

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

2626
spec.required_ruby_version = ">= 3.1"
2727

config/sus.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
# Released under the MIT License.
4-
# Copyright, 2022, by Samuel Williams.
4+
# Copyright, 2022-2024, by Samuel Williams.
55

6-
require 'covered/sus'
6+
require "covered/sus"
77
include Covered::Sus

examples/binance/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Released under the MIT License.
55
# Copyright, 2021-2024, by Samuel Williams.
66

7-
require 'async'
8-
require 'async/http'
9-
require 'async/websocket'
7+
require "async"
8+
require "async/http"
9+
require "async/websocket"
1010

1111
URL = "wss://stream.binance.com:9443/ws/btcusdt@bookTicker"
1212

examples/chat/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Released under the MIT License.
55
# Copyright, 2018-2024, by Samuel Williams.
66

7-
require 'async'
8-
require 'async/http/endpoint'
9-
require_relative '../../lib/async/websocket/client'
7+
require "async"
8+
require "async/http/endpoint"
9+
require_relative "../../lib/async/websocket/client"
1010

1111
USER = ARGV.pop || "anonymous"
1212
URL = ARGV.pop || "https://localhost:8080"

examples/chat/config.ru

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env -S falcon serve --bind https://localhost:8080 --count 1 -c
22
# frozen_string_literal: true
33

4-
require_relative '../../lib/async/websocket/adapters/rack'
5-
require 'async/clock'
6-
require 'async/semaphore'
4+
require_relative "../../lib/async/websocket/adapters/rack"
5+
require "async/clock"
6+
require "async/semaphore"
77

8-
require 'set'
8+
require "set"
99

1010
# GC.disable
1111

@@ -70,7 +70,7 @@ class Room
7070
end
7171

7272
def start_profile
73-
require 'ruby-prof' unless defined?(RubyProf)
73+
require "ruby-prof" unless defined?(RubyProf)
7474

7575
return false if @profile
7676

examples/chat/multi-client.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# Released under the MIT License.
55
# Copyright, 2019-2024, by Samuel Williams.
66

7-
require 'async'
8-
require 'async/semaphore'
9-
require 'async/clock'
10-
require 'async/http/endpoint'
11-
require_relative '../../lib/async/websocket/client'
7+
require "async"
8+
require "async/semaphore"
9+
require "async/clock"
10+
require "async/http/endpoint"
11+
require_relative "../../lib/async/websocket/client"
1212

13-
require 'samovar'
13+
require "samovar"
1414

1515
# GC.disable
1616
GC::Profiler.enable

examples/mud/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# Copyright, 2019-2024, by Samuel Williams.
66
# Copyright, 2020, by Juan Antonio Martín Lucas.
77

8-
require 'async'
9-
require 'async/http/endpoint'
10-
require 'async/websocket/client'
8+
require "async"
9+
require "async/http/endpoint"
10+
require "async/websocket/client"
1111

1212
USER = ARGV.pop || "anonymous"
1313
URL = ARGV.pop || "http://127.0.0.1:7070"

0 commit comments

Comments
 (0)