Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ruby 3.1 compat (#19543)

Rafael dos Santos Silva7c5744a4cbb1
diff --git a/.licensed.yml b/.licensed.yml
index f89daae2bd0..e1268542c8f 100644
--- a/.licensed.yml
+++ b/.licensed.yml
@@ -14,6 +14,8 @@ ignored:
bundler:
- rchardet # Ruby terms
- strscan # Ruby
+ - ruby2_keywords # BSD-2-Clause
+ - openssl # Ruby terms
reviewed:
bundler:
@@ -43,7 +45,6 @@ reviewed:
- net-protocol # Ruby
- net-smtp # Ruby
- omniauth # MIT
- - openssl # Ruby terms
- pg # Ruby terms
- r2 # Apache-2.0 (Twitter)
- racc # Ruby terms
diff --git a/Gemfile b/Gemfile
index b35e4805cc4..5748f027299 100644
--- a/Gemfile
+++ b/Gemfile
@@ -169,6 +169,7 @@ group :test, :development do
gem 'rswag-specs'
gem 'annotate'
+ gem 'webrick', require: false
end
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index b3d676d7a8b..28f00a67db2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -479,6 +479,7 @@ GEM
webpush (1.1.0)
hkdf (~> 0.2)
jwt (~> 2.0)
+ webrick (1.7.0)
websocket (1.2.9)
xorcist (1.1.3)
xpath (3.2.0)
@@ -625,6 +626,7 @@ DEPENDENCIES
webdrivers
webmock
webpush
+ webrick
xorcist
yaml-lint
diff --git a/plugins/chat/spec/requests/chat_controller_spec.rb b/plugins/chat/spec/requests/chat_controller_spec.rb
index 3bb10269190..949c5608b2f 100644
--- a/plugins/chat/spec/requests/chat_controller_spec.rb
+++ b/plugins/chat/spec/requests/chat_controller_spec.rb
@@ -1329,14 +1329,14 @@ RSpec.describe Chat::ChatController do
it "ensures message's channel can be seen" do
Guardian.any_instance.expects(:can_join_chat_channel?).with(channel)
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
end
context "when the message doesn’t belong to the channel" do
let!(:message) { Fabricate(:chat_message) }
it "returns a 404" do
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(404)
end
@@ -1346,18 +1346,18 @@ RSpec.describe Chat::ChatController do
let(:channel) { Fabricate(:category_channel) }
it "ensures the user can access that category" do
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(200)
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
group = Fabricate(:group)
chatable.update!(read_restricted: true)
Fabricate(:category_group, group: group, category: chatable)
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(403)
GroupUser.create!(user: user, group: group)
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(200)
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
end
@@ -1367,11 +1367,11 @@ RSpec.describe Chat::ChatController do
let(:channel) { Fabricate(:direct_message_channel) }
it "ensures the user can access that direct message channel" do
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(403)
DirectMessageUser.create!(user: user, direct_message: chatable)
- get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
+ get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
expect(response.status).to eq(200)
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
end