Skip to content

Commit f2a313b

Browse files
authored
Merge pull request #265 from joshbuker/update/version-requirements
Update Version Requirements to resolve CircleCI failures
2 parents 913710f + 0049d22 commit f2a313b

File tree

17 files changed

+134
-36
lines changed

17 files changed

+134
-36
lines changed

.circleci/config.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ commands:
66
steps:
77
- run:
88
name: Install OS packages
9-
command: apk add git build-base ruby-dev ruby-etc ruby-json libsodium
9+
command: apk add git build-base ruby-dev ruby-etc ruby-json libsodium-dev
1010
- checkout
1111
- run:
1212
name: "Ruby version"
@@ -27,9 +27,9 @@ commands:
2727
- ./vendor/bundle
2828

2929
jobs:
30-
test_ruby_27:
30+
test_ruby_31:
3131
docker:
32-
- image: ruby:2.7-alpine
32+
- image: ruby:3.1-alpine
3333
steps:
3434
- setup-env
3535
- run:
@@ -38,9 +38,9 @@ jobs:
3838
- store_test_results:
3939
path: ~/rspec
4040

41-
test_ruby_30:
41+
test_ruby_32:
4242
docker:
43-
- image: ruby:3.0-alpine
43+
- image: ruby:3.2-alpine
4444
steps:
4545
- setup-env
4646
- run:
@@ -50,9 +50,9 @@ jobs:
5050
path: ~/rspec
5151

5252

53-
test_ruby_31:
53+
test_ruby_33:
5454
docker:
55-
- image: ruby:3.1-alpine
55+
- image: ruby:3.3-alpine
5656
steps:
5757
- setup-env
5858
- run:
@@ -61,7 +61,7 @@ jobs:
6161

6262
rubocop:
6363
docker:
64-
- image: ruby:2.7-alpine
64+
- image: ruby:3.3-alpine
6565
steps:
6666
- setup-env
6767
- run:
@@ -70,7 +70,7 @@ jobs:
7070

7171
yard:
7272
docker:
73-
- image: ruby:2.7-alpine
73+
- image: ruby:3.3-alpine
7474
steps:
7575
- setup-env
7676
- attach_workspace:
@@ -125,9 +125,9 @@ jobs:
125125
workflows:
126126
test:
127127
jobs:
128-
- test_ruby_27
129-
- test_ruby_30
130128
- test_ruby_31
129+
- test_ruby_32
130+
- test_ruby_33
131131
- rubocop
132132
- yard
133133
deploy:

.devcontainer/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Which Ruby version to use. You may need to use a more restrictive version,
2+
# e.g. `3.0`
3+
ARG VARIANT=3.3
4+
5+
# Pull Microsoft's ruby devcontainer base image
6+
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}
7+
8+
# Install libsodium dependency for voice channel interactions
9+
RUN apt update -yq && apt install -y libsodium-dev
10+
11+
# Ensure we're running the latest bundler, as what ships with the Ruby image may
12+
# not be current, and bundler will auto-downgrade to match the Gemfile.lock
13+
RUN gem install bundler

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "Ruby",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
7+
// Configure tool-specific properties.
8+
"customizations": {
9+
// Configure properties specific to VS Code.
10+
"vscode": {
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": [
13+
"shopify.ruby-lsp"
14+
]
15+
}
16+
},
17+
18+
// Set the environment variables
19+
// "runArgs": ["--env-file",".env"],
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
"postCreateCommand": "bash .devcontainer/postcreate.sh",
26+
27+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
28+
"remoteUser": "vscode"
29+
}

.devcontainer/postcreate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
bundle config set path vendor/bundle
4+
bundle install --jobs=1

.rubocop.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inherit_mode:
88

99
AllCops:
1010
NewCops: enable
11-
TargetRubyVersion: 2.7
11+
TargetRubyVersion: 3.3
1212

1313
# Disable line length checks
1414
Layout/LineLength:
@@ -66,3 +66,53 @@ Style/SingleLineBlockParams:
6666
Methods:
6767
- reduce: [m, e]
6868
- inject: [m, e]
69+
70+
###################################
71+
## NEW COPS TO MAKE DECISIONS ON ##
72+
###################################
73+
74+
# TODO: Decide how you want to handle this:
75+
# https://rubydoc.info/gems/rubocop/RuboCop/Cop/Style/HashSyntax
76+
Style/HashSyntax:
77+
EnforcedShorthandSyntax: either
78+
79+
Style/ArgumentsForwarding:
80+
Enabled: false
81+
82+
Performance/StringIdentifierArgument:
83+
Enabled: false
84+
85+
Style/ComparableClamp:
86+
Enabled: false
87+
88+
Style/SuperArguments:
89+
Enabled: false
90+
91+
Naming/BlockForwarding:
92+
Enabled: false
93+
94+
Style/RedundantSelfAssignmentBranch:
95+
Enabled: false
96+
97+
Performance/MapCompact:
98+
Enabled: false
99+
100+
Gemspec/RequiredRubyVersion:
101+
Enabled: false
102+
103+
Gemspec/DevelopmentDependencies:
104+
Enabled: false
105+
106+
Style/RedundantReturn:
107+
Enabled: false
108+
109+
Style/RedundantParentheses:
110+
Enabled: false
111+
112+
# This will probably be a breaking change, but should happen
113+
Style/ReturnNilInPredicateMethodDefinition:
114+
Enabled: false
115+
116+
# FIXME: Disabled due to breaking tests, should probably refactor the code instead
117+
Style/SafeNavigation:
118+
Enabled: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you enjoy using the library, consider getting involved with the community to
4444

4545
## Dependencies
4646

47-
* Ruby >= 2.7 supported
47+
* Ruby >= 3.1 supported
4848
* An installed build system for native extensions (on Windows, make sure you download the "Ruby+Devkit" version of [RubyInstaller](https://rubyinstaller.org/downloads/))
4949

5050
### Voice dependencies

discordrb-webhooks.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
2222

2323
spec.add_dependency 'rest-client', '>= 2.0.0'
2424

25-
spec.required_ruby_version = '>= 2.7'
25+
spec.required_ruby_version = '>= 3.1'
2626
spec.metadata = {
2727
'rubygems_mfa_required' => 'true'
2828
}

discordrb.gemspec

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ Gem::Specification.new do |spec|
1919
spec.bindir = 'exe'
2020
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2121
spec.metadata = {
22+
'bug_tracker_uri' => 'https://github.com/shardlab/discordrb/issues',
2223
'changelog_uri' => 'https://github.com/shardlab/discordrb/blob/main/CHANGELOG.md',
24+
'documentation_uri' => 'https://github.com/shardlab/discordrb/wiki',
25+
'source_code_uri' => 'https://github.com/shardlab/discordrb',
2326
'rubygems_mfa_required' => 'true'
2427
}
2528
spec.require_paths = ['lib']
@@ -31,17 +34,17 @@ Gem::Specification.new do |spec|
3134

3235
spec.add_dependency 'discordrb-webhooks', '~> 3.5.0'
3336

34-
spec.required_ruby_version = '>= 2.7'
37+
spec.required_ruby_version = '>= 3.1'
3538

3639
spec.add_development_dependency 'bundler', '>= 1.10', '< 3'
3740
spec.add_development_dependency 'rake', '~> 13.0'
38-
spec.add_development_dependency 'redcarpet', '~> 3.5.0' # YARD markdown formatting
39-
spec.add_development_dependency 'rspec', '~> 3.11.0'
40-
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.5.1'
41-
spec.add_development_dependency 'rspec-prof', '~> 0.0.7'
42-
spec.add_development_dependency 'rubocop', '~> 1.36.0'
41+
spec.add_development_dependency 'redcarpet', '~> 3.5' # YARD markdown formatting
42+
spec.add_development_dependency 'rspec', '~> 3.0'
43+
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.5'
44+
spec.add_development_dependency 'rspec-prof', '~> 0.0'
45+
spec.add_development_dependency 'rubocop', '~> 1.0'
4346
spec.add_development_dependency 'rubocop-performance', '~> 1.0'
44-
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
45-
spec.add_development_dependency 'simplecov', '~> 0.21.0'
46-
spec.add_development_dependency 'yard', '~> 0.9.9'
47+
spec.add_development_dependency 'rubocop-rake', '~> 0.6'
48+
spec.add_development_dependency 'simplecov', '~> 0.21'
49+
spec.add_development_dependency 'yard', '~> 0.9'
4750
end

lib/discordrb/bot.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require 'rest-client'
44
require 'zlib'
5-
require 'set'
65

76
require 'discordrb/events/message'
87
require 'discordrb/events/typing'
@@ -1700,7 +1699,7 @@ def call_event(handler, event)
17001699

17011700
def handle_awaits(event)
17021701
@awaits ||= {}
1703-
@awaits.each do |_, await|
1702+
@awaits.each_value do |await|
17041703
key, should_delete = await.match(event)
17051704
next unless key
17061705

lib/discordrb/commands/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def execute_bare(event)
159159
escaped = false
160160
hacky_delim, hacky_space, hacky_prev, hacky_newline = [0xe001, 0xe002, 0xe003, 0xe004].pack('U*').chars
161161

162-
@chain.each_char.each_with_index do |char, index|
162+
@chain.each_char.with_index do |char, index|
163163
# Escape character
164164
if char == '\\' && !escaped
165165
escaped = true

0 commit comments

Comments
 (0)