Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build in MacOS with ruby 3.2.0 #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "fileutils"

MRUBY_VERSION = "3.0.0"
MRUBY_VERSION = "3.2.0"

task :mruby do
sh "git clone --branch=#{MRUBY_VERSION} --depth=1 https://github.com/mruby/mruby"
Expand Down
16 changes: 8 additions & 8 deletions build_config.rb.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
mruby:
version: 3.0.0
release_no: 30000
git_commit: 0f45836b5954accf508f333f932741b925214471
version: 3.2.0
release_no: 30200
git_commit: 87260e7bb1a9edfb2ce9b41549c4142129061ca5
builds:
host:
https://github.com/iij/mruby-regexp-pcre.git:
Expand All @@ -27,8 +27,8 @@ builds:
version: 0.0.0
https://github.com/Asmod4n/mruby-simplemsgpack.git:
url: https://github.com/Asmod4n/mruby-simplemsgpack.git
branch: HEAD
commit: 9df3c4a4d6ff1b62cbedb6c680b2af2f72015e40
branch: master
commit: d7e9142afe9d5d53855c1611d2c35b5b71f02fa9
version: 0.0.0
https://github.com/iij/mruby-mtest.git:
url: https://github.com/iij/mruby-mtest.git
Expand All @@ -37,13 +37,13 @@ builds:
version: 0.0.0
https://github.com/iij/mruby-errno.git:
url: https://github.com/iij/mruby-errno.git
branch: HEAD
branch: master
commit: b4415207ff6ea62360619c89a1cff83259dc4db0
version: 0.0.0
https://github.com/Asmod4n/mruby-phr.git:
url: https://github.com/Asmod4n/mruby-phr.git
branch: HEAD
commit: 1bab77000280141802d56a20a5413ba0900b69df
commit: a9b5776c5c6926ce30b09aadd5743c34e16ca522
version: 0.0.0
https://github.com/Asmod4n/mruby-wslay:
url: https://github.com/Asmod4n/mruby-wslay
Expand All @@ -53,7 +53,7 @@ builds:
https://github.com/Asmod4n/mruby-poll.git:
url: https://github.com/Asmod4n/mruby-poll.git
branch: HEAD
commit: f33ce28bc3ebb8650d91a0bf31da3e163e29af45
commit: 404299c264c183ec4fa65d0f1bdb322ba761c296
version: 0.0.0
https://github.com/Asmod4n/mruby-tls.git:
url: https://github.com/Asmod4n/mruby-tls.git
Expand Down
42 changes: 21 additions & 21 deletions mrblib/acli/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ def close
def handle_incoming(msg)
logger.log "Incoming: #{msg}"

data = coder.decode(msg)
data = data.transform_keys!(&:to_sym)
case data
in type: "confirm_subscription", identifier:
subscribed! identifier
in type: "reject_subscription", identifier:
data = coder.decode(msg).transform_keys!(&:to_sym)

case data[:type]
when "confirm_subscription"
Comment on lines +50 to +53
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this change?

subscribed! data[:identifier]
when "reject_subscription"
puts "Subscription rejected"
in type: "confirm_history", identifier:
when "confirm_history"
# no-op
in type: "reject_history", identifier:
when "reject_history"
puts "Failed to retrieve history"
in type: "ping"
when "ping"
track_ping!
in type: "welcome", **opts
connected!(opts)
in type: "disconnect", **opts
when "welcome"
connected!(data)
when "disconnect"
puts "Disconnected by server: " \
"#{opts.fetch(:reason, "unknown reason")} " \
"(reconnect: #{opts.fetch(:reconnect, "<none>")})"
"#{data.fetch(:reason, "unknown reason")} " \
"(reconnect: #{data.fetch(:reconnect, "<none>")})"
close
in message:, identifier:, **meta
received(message, meta)
else
received(data[:message], data)
end
end

Expand Down Expand Up @@ -134,11 +134,11 @@ def quit!
def parse_quit_after!(value)
@quit_after =
case value
in "connect" | "subscribed"
value
in /\d+/
@quit_after_messages = value.to_i
"message"
when "connect", "subscribed"
value
when /\d+/
@quit_after_messages = value.to_i
"message"
end
end
end
Expand Down
Loading