diff --git a/core/io.rbs b/core/io.rbs index 96f82c1aff..1b6f79bb95 100644 --- a/core/io.rbs +++ b/core/io.rbs @@ -1230,6 +1230,24 @@ class IO < Object # def ioctl: (Integer integer_cmd, String | Integer argument) -> Integer + # + # Returns pathname configuration variable using fpathconf(). + # + # *name* should be a constant under `Etc` which begins with `PC_`. + # + # The return value is an integer or nil. nil means indefinite limit. + # (fpathconf() returns -1 but errno is not set.) + # + # require 'etc' + # IO.pipe {|r, w| + # p w.pathconf(Etc::PC_PIPE_BUF) #=> 4096 + # } + # + def pathconf: (Integer name) -> Integer? + # @@ -319,7 +319,7 @@ class Digest::Class # Returns the base64 encoded hash value of a given *string*. The return value # is properly padded with '=' and contains no line feeds. # - def self.base64digest: (string str) -> String + def self.base64digest: (string str, *untyped args) -> String # # Returns the BubbleBabble encoded hash value of a given *string*. # - def self.bubblebabble: (string) -> String + def self.bubblebabble: (string, *untyped) -> String # # Returns system temporary directory; typically "/tmp". # - def self?.systmpdir: () -> ::String + def self?.systmpdir: () -> ::String? # # Raises NotImplementedError. # - def fcntl: (Integer integer_cmd, String | Integer arg) -> Integer + def fcntl: (*untyped) -> bot # # Returns 0; for compatibility with IO. # - def fsync: () -> Integer? + def fsync: () -> Integer # # Returns `nil`; for compatibility with IO. # - def internal_encoding: () -> Encoding + def internal_encoding: () -> nil # + # See IO#pread. + # + def pread: (Integer maxlen, Integer offset, ?String outbuf) -> String + + def read_nonblock: (int len, ?string buf, ?exception: bool) -> String? def readbyte: () -> Integer @@ -1358,6 +1368,16 @@ class StringIO def set_encoding: (?String | Encoding ext_or_ext_int_enc) -> self | (?String | Encoding ext_or_ext_int_enc, ?String | Encoding int_enc) -> self + # + # Sets the encoding according to the BOM (Byte Order Mark) in the string. + # + # Returns `self` if the BOM is found, otherwise +nil. + # + def set_encoding_by_bom: () -> Encoding? + #