[ruby/uri] Fix spelling of "cannot"

https://github.com/ruby/uri/commit/77241d6508
This commit is contained in:
David Rodríguez 2024-09-17 19:06:40 +02:00 committed by git
parent 5307c65c76
commit 39679d7fab
2 changed files with 13 additions and 13 deletions

View File

@ -70,17 +70,17 @@ module URI
# raise InvalidURIError # raise InvalidURIError
def check_userinfo(user) def check_userinfo(user)
raise URI::InvalidURIError, "can not set userinfo for file URI" raise URI::InvalidURIError, "cannot set userinfo for file URI"
end end
# raise InvalidURIError # raise InvalidURIError
def check_user(user) def check_user(user)
raise URI::InvalidURIError, "can not set user for file URI" raise URI::InvalidURIError, "cannot set user for file URI"
end end
# raise InvalidURIError # raise InvalidURIError
def check_password(user) def check_password(user)
raise URI::InvalidURIError, "can not set password for file URI" raise URI::InvalidURIError, "cannot set password for file URI"
end end
# do nothing # do nothing

View File

@ -393,7 +393,7 @@ module URI
def check_user(v) def check_user(v)
if @opaque if @opaque
raise InvalidURIError, raise InvalidURIError,
"can not set user with opaque" "cannot set user with opaque"
end end
return v unless v return v unless v
@ -417,7 +417,7 @@ module URI
def check_password(v, user = @user) def check_password(v, user = @user)
if @opaque if @opaque
raise InvalidURIError, raise InvalidURIError,
"can not set password with opaque" "cannot set password with opaque"
end end
return v unless v return v unless v
@ -596,7 +596,7 @@ module URI
if @opaque if @opaque
raise InvalidURIError, raise InvalidURIError,
"can not set host with registry or opaque" "cannot set host with registry or opaque"
elsif parser.regexp[:HOST] !~ v elsif parser.regexp[:HOST] !~ v
raise InvalidComponentError, raise InvalidComponentError,
"bad component(expected host component): #{v}" "bad component(expected host component): #{v}"
@ -685,7 +685,7 @@ module URI
if @opaque if @opaque
raise InvalidURIError, raise InvalidURIError,
"can not set port with registry or opaque" "cannot set port with registry or opaque"
elsif !v.kind_of?(Integer) && parser.regexp[:PORT] !~ v elsif !v.kind_of?(Integer) && parser.regexp[:PORT] !~ v
raise InvalidComponentError, raise InvalidComponentError,
"bad component(expected port component): #{v.inspect}" "bad component(expected port component): #{v.inspect}"
@ -733,17 +733,17 @@ module URI
end end
def check_registry(v) # :nodoc: def check_registry(v) # :nodoc:
raise InvalidURIError, "can not set registry" raise InvalidURIError, "cannot set registry"
end end
private :check_registry private :check_registry
def set_registry(v) #:nodoc: def set_registry(v) #:nodoc:
raise InvalidURIError, "can not set registry" raise InvalidURIError, "cannot set registry"
end end
protected :set_registry protected :set_registry
def registry=(v) def registry=(v)
raise InvalidURIError, "can not set registry" raise InvalidURIError, "cannot set registry"
end end
# #
@ -866,7 +866,7 @@ module URI
# hier_part = ( net_path | abs_path ) [ "?" query ] # hier_part = ( net_path | abs_path ) [ "?" query ]
if @host || @port || @user || @path # userinfo = @user + ':' + @password if @host || @port || @user || @path # userinfo = @user + ':' + @password
raise InvalidURIError, raise InvalidURIError,
"can not set opaque with host, port, userinfo or path" "cannot set opaque with host, port, userinfo or path"
elsif v && parser.regexp[:OPAQUE] !~ v elsif v && parser.regexp[:OPAQUE] !~ v
raise InvalidComponentError, raise InvalidComponentError,
"bad component(expected opaque component): #{v}" "bad component(expected opaque component): #{v}"
@ -1235,7 +1235,7 @@ module URI
return rel, rel return rel, rel
end end
# you can modify `rel', but can not `oth'. # you can modify `rel', but cannot `oth'.
return oth, rel return oth, rel
end end
private :route_from0 private :route_from0
@ -1260,7 +1260,7 @@ module URI
# #=> #<URI::Generic /main.rbx?page=1> # #=> #<URI::Generic /main.rbx?page=1>
# #
def route_from(oth) def route_from(oth)
# you can modify `rel', but can not `oth'. # you can modify `rel', but cannot `oth'.
begin begin
oth, rel = route_from0(oth) oth, rel = route_from0(oth)
rescue rescue