core/kernel.rbs in rbs-1.3.3 vs core/kernel.rbs in rbs-1.4.0

- old
+ new

@@ -111,10 +111,11 @@ # Array(1) #=> [1] # ``` def self?.Array: (NilClass x) -> [ ] | [T] (::Array[T] x) -> ::Array[T] | [T] (::Range[T] x) -> ::Array[T] + | [T] (_Each[T] x) -> ::Array[T] | [K, V] (::Hash[K, V] x) -> ::Array[[K, V]] | [T] (T x) -> ::Array[T] def self?.Complex: (Numeric | String x, ?Numeric | String y, ?exception: bool exception) -> Complex @@ -125,11 +126,19 @@ def self?.Integer: (Numeric | String arg, ?exception: bool exception) -> Integer | (String arg, ?Integer base, ?exception: bool exception) -> Integer def self?.Rational: (Numeric | String | Object x, ?Numeric | String y, ?exception: bool exception) -> Rational - def self?.String: (Object x) -> String + # Returns *arg* as a String. + # + # First tries to call its `to_str` method, then its `to_s` method. + # + # String(self) #=> "main" + # String(self.class) #=> "Object" + # String(123456) #=> "123456" + # + def self?.String: (_ToStr | _ToS x) -> String # Returns the called name of the current method as a # [Symbol](https://ruby-doc.org/core-2.6.3/Symbol.html). If called # outside of a method, it returns `nil` . def self?.__callee__: () -> Symbol? @@ -461,10 +470,23 @@ # exec "echo", "*" # echoes an asterisk # # never get here # ``` def self?.exec: (*String args) -> bot + type redirect_fd = Integer # redirect to the file descriptor in parent process + | :in | :out | :err # standard input / output / error + | IO # the file descriptor specified as io.fileno + | String # redirect to file with open(string, File::RDONLY) + | [String] # # redirect to file with open(string, File::RDONLY) + | [String, string | int] # redirect to file with open(string, open_mode, 0644) + | [String, string | int, int] # redirect to file with open(string, open_mode, perm) + | [:child, int] # redirect to the redirected file descriptor + | :close # close the file descriptor in child process + + def self?.spawn: (String command, *String args, ?unsetenv_others: boolish, ?pgroup?: (true | Integer), ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> Integer + | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup?: (true | Integer), ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> Integer + # Executes *command…* in a subshell. *command…* is one of following forms. # # commandline : command line string which is passed to the standard shell # cmdname, arg1, ... : command name and one or more arguments (no shell) # [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell) @@ -486,9 +508,10 @@ # # config.h main.rb # * # # See `Kernel.exec` for the standard shell. - def self?.system: (*String args) -> (NilClass | FalseClass | TrueClass) + def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup?: (true | Integer), ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass) + | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup?: (true | Integer), ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass) end Kernel::RUBYGEMS_ACTIVATION_MONITOR: untyped