From a3f5505f0f53f7522e70b0491dd4a669006a2ac8 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 14 Nov 2024 22:26:59 +0900 Subject: [PATCH 1/3] Update Gemfile.lock --- gemfile_steep/Gemfile.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/gemfile_steep/Gemfile.lock b/gemfile_steep/Gemfile.lock index 430e0dec..9ca4865f 100644 --- a/gemfile_steep/Gemfile.lock +++ b/gemfile_steep/Gemfile.lock @@ -72,6 +72,7 @@ PLATFORMS arm64-darwin-21 arm64-darwin-22 arm64-darwin-23 + arm64-darwin-24 x86_64-linux DEPENDENCIES From 9880305bbac8a2fc2f1a994ce58ac4ebbb6bb487 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 14 Nov 2024 22:27:22 +0900 Subject: [PATCH 2/3] bin/rbs collection update --- rbs_collection.steep.lock.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rbs_collection.steep.lock.yaml b/rbs_collection.steep.lock.yaml index db04e1ed..2aa9e96a 100644 --- a/rbs_collection.steep.lock.yaml +++ b/rbs_collection.steep.lock.yaml @@ -13,6 +13,10 @@ gems: version: '0' source: type: stdlib +- name: benchmark + version: '0' + source: + type: stdlib - name: bigdecimal version: '0' source: From 9379c508c82836a1965dfcf121a65eb33231eafa Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 14 Nov 2024 22:27:34 +0900 Subject: [PATCH 3/3] Use `RFC::2396_Parser` --- lib/steep/path_helper.rb | 6 ++++-- sig/steep/path_helper.rbs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/steep/path_helper.rb b/lib/steep/path_helper.rb index d9cc2de8..f7845bb0 100644 --- a/lib/steep/path_helper.rb +++ b/lib/steep/path_helper.rb @@ -2,12 +2,14 @@ module Steep module PathHelper module_function + URIParser = URI::RFC2396_Parser.new() + def to_pathname(uri, dosish: Gem.win_platform?) uri = URI.parse(uri) if uri.scheme == "file" path = uri.path or raise path.sub!(%r{^/([a-zA-Z])(:|%3A)//?}i, '\1:/') if dosish - path = URI::DEFAULT_PARSER.unescape(path) + path = URIParser.unescape(path) Pathname(path) end end @@ -21,7 +23,7 @@ def to_uri(path, dosish: Gem.win_platform?) if dosish str_path.insert(0, "/") if str_path[0] != "/" end - str_path = URI::DEFAULT_PARSER.escape(str_path) + str_path = URIParser.escape(str_path) URI::File.build(path: str_path) end end diff --git a/sig/steep/path_helper.rbs b/sig/steep/path_helper.rbs index 4206d160..e48c5dae 100644 --- a/sig/steep/path_helper.rbs +++ b/sig/steep/path_helper.rbs @@ -1,5 +1,7 @@ module Steep module PathHelper + URIParser: URI::RFC2396_Parser + # Receives a String that represents a *file* URI and returns a Pathname # # Returns `nil` when the schema of given URI is not `file://`.