Skip to content

Commit

Permalink
fix: Addresses URI parsing compatibility with Ruby 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfloyd authored Jul 24, 2024
2 parents a255895 + a4bae88 commit 7ff23fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/octokit/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ def url

private

ABS_URI_REGEXP = if URI.const_defined?(:RFC2396_PARSER) # Ruby 3.4+
URI::RFC2396_PARSER.regexp.fetch(:ABS_URI)
else
URI::RFC2396_Parser.new.regexp.fetch(:ABS_URI)
end

def validate_owner_and_name!(repo)
if @owner.include?('/') || @name.include?('/') || !url.match(URI::ABS_URI)
if @owner.include?('/') || @name.include?('/') || !url.match?(ABS_URI_REGEXP)
raise_invalid_repository!(repo)
end
end
Expand Down

0 comments on commit 7ff23fa

Please sign in to comment.