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 spelling of "cannot" #123

Merged
merged 1 commit into from
Sep 17, 2024
Merged
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
6 changes: 3 additions & 3 deletions lib/uri/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ def set_port(v)

# raise InvalidURIError
def check_userinfo(user)
raise URI::InvalidURIError, "can not set userinfo for file URI"
raise URI::InvalidURIError, "cannot set userinfo for file URI"
end

# raise InvalidURIError
def check_user(user)
raise URI::InvalidURIError, "can not set user for file URI"
raise URI::InvalidURIError, "cannot set user for file URI"
end

# raise InvalidURIError
def check_password(user)
raise URI::InvalidURIError, "can not set password for file URI"
raise URI::InvalidURIError, "cannot set password for file URI"
end

# do nothing
Expand Down
20 changes: 10 additions & 10 deletions lib/uri/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def check_userinfo(user, password = nil)
def check_user(v)
if @opaque
raise InvalidURIError,
"can not set user with opaque"
"cannot set user with opaque"
end

return v unless v
Expand All @@ -417,7 +417,7 @@ def check_user(v)
def check_password(v, user = @user)
if @opaque
raise InvalidURIError,
"can not set password with opaque"
"cannot set password with opaque"
end
return v unless v

Expand Down Expand Up @@ -596,7 +596,7 @@ def check_host(v)

if @opaque
raise InvalidURIError,
"can not set host with registry or opaque"
"cannot set host with registry or opaque"
elsif parser.regexp[:HOST] !~ v
raise InvalidComponentError,
"bad component(expected host component): #{v}"
Expand Down Expand Up @@ -685,7 +685,7 @@ def check_port(v)

if @opaque
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
raise InvalidComponentError,
"bad component(expected port component): #{v.inspect}"
Expand Down Expand Up @@ -733,17 +733,17 @@ def port=(v)
end

def check_registry(v) # :nodoc:
raise InvalidURIError, "can not set registry"
raise InvalidURIError, "cannot set registry"
end
private :check_registry

def set_registry(v) #:nodoc:
raise InvalidURIError, "can not set registry"
raise InvalidURIError, "cannot set registry"
end
protected :set_registry

def registry=(v)
raise InvalidURIError, "can not set registry"
raise InvalidURIError, "cannot set registry"
end

#
Expand Down Expand Up @@ -866,7 +866,7 @@ def check_opaque(v)
# hier_part = ( net_path | abs_path ) [ "?" query ]
if @host || @port || @user || @path # userinfo = @user + ':' + @password
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
raise InvalidComponentError,
"bad component(expected opaque component): #{v}"
Expand Down Expand Up @@ -1235,7 +1235,7 @@ def route_from0(oth)
return rel, rel
end

# you can modify `rel', but can not `oth'.
# you can modify `rel', but cannot `oth'.
return oth, rel
end
private :route_from0
Expand All @@ -1260,7 +1260,7 @@ def route_from0(oth)
# #=> #<URI::Generic /main.rbx?page=1>
#
def route_from(oth)
# you can modify `rel', but can not `oth'.
# you can modify `rel', but cannot `oth'.
begin
oth, rel = route_from0(oth)
rescue
Expand Down