Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 053324f

Browse files
committed
Stop overwriting String#starts_with? and String#ends_with?
1 parent a327457 commit 053324f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/openid/extras.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ def starts_with?(other)
33
other = other.to_s
44
head = self[0, other.length]
55
head == other
6-
end
6+
end unless ''.respond_to?(:starts_with?)
77

88
def ends_with?(other)
99
other = other.to_s
1010
tail = self[-1 * other.length, other.length]
1111
tail == other
12-
end
12+
end unless ''.respond_to?(:ends_with?)
1313
end

0 commit comments

Comments
 (0)