Skip to content

Commit 736dabb

Browse files
committed
Revert Digest::Class method changes
The original definition allows for flexible behavior in subclasses, but it can also lead to overlooking issues that should be discovered. If we want to increase the number of arguments in a subclass, we should write an overload in that class. ``` Digest::SHA256.base64digest("aaa", :bbb) #=> ArgumentError ``` ref: #2967
1 parent 12b95e4 commit 736dabb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

stdlib/digest/0/digest.rbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ class Digest::Class
319319
# Returns the base64 encoded hash value of a given *string*. The return value
320320
# is properly padded with '=' and contains no line feeds.
321321
#
322-
def self.base64digest: (string str, *untyped args) -> String
322+
def self.base64digest: (string str) -> String
323323

324324
# <!--
325325
# rdoc-file=ext/digest/bubblebabble/bubblebabble.c
326326
# - Digest::Class.bubblebabble(string, ...) -> hash_string
327327
# -->
328328
# Returns the BubbleBabble encoded hash value of a given *string*.
329329
#
330-
def self.bubblebabble: (string, *untyped) -> String
330+
def self.bubblebabble: (string) -> String
331331

332332
# <!--
333333
# rdoc-file=ext/digest/digest.c
@@ -338,7 +338,7 @@ class Digest::Class
338338
# any, are passed through to the constructor and the *string* is passed to
339339
# #digest().
340340
#
341-
def self.digest: (string, *untyped) -> String
341+
def self.digest: (string) -> String
342342

343343
# <!--
344344
# rdoc-file=ext/digest/lib/digest.rb
@@ -350,7 +350,7 @@ class Digest::Class
350350
# p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest
351351
# # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
352352
#
353-
def self.file: (string name, *untyped args) -> instance
353+
def self.file: (string name) -> instance
354354

355355
# <!--
356356
# rdoc-file=ext/digest/digest.c
@@ -359,7 +359,7 @@ class Digest::Class
359359
# Returns the hex-encoded hash value of a given *string*. This is almost
360360
# equivalent to Digest.hexencode(Digest::Class.new(*parameters).digest(string)).
361361
#
362-
def self.hexdigest: (string, *untyped) -> String
362+
def self.hexdigest: (string) -> String
363363

364364
private
365365

0 commit comments

Comments
 (0)