rbs 1.7.0.beta.3 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -885,3 +885,47 @@ BigDecimal::SIGN_POSITIVE_ZERO: Integer
885
885
  # The version of bigdecimal library
886
886
  #
887
887
  BigDecimal::VERSION: String
888
+
889
+ module Kernel
890
+ private
891
+
892
+ # Create a new BigDecimal object.
893
+ #
894
+ # initial
895
+ # : The initial value, as an Integer, a Float, a Rational, a BigDecimal, or a
896
+ # String.
897
+ #
898
+ # If it is a String, spaces are ignored and unrecognized characters
899
+ # terminate the value.
900
+ #
901
+ # digits
902
+ # : The number of significant digits, as an Integer. If omitted or 0, the
903
+ # number of significant digits is determined from the initial value.
904
+ #
905
+ # The actual number of significant digits used in computation is usually
906
+ # larger than the specified number.
907
+ #
908
+ # exception
909
+ # : Whether an exception should be raised on invalid arguments. `true` by
910
+ # default, if passed `false`, just returns `nil` for invalid.
911
+ #
912
+ #
913
+ # #### Exceptions
914
+ #
915
+ # TypeError
916
+ # : If the `initial` type is neither Integer, Float, Rational, nor BigDecimal,
917
+ # this exception is raised.
918
+ #
919
+ # TypeError
920
+ # : If the `digits` is not an Integer, this exception is raised.
921
+ #
922
+ # ArgumentError
923
+ # : If `initial` is a Float, and the `digits` is larger than Float::DIG + 1,
924
+ # this exception is raised.
925
+ #
926
+ # ArgumentError
927
+ # : If the `initial` is a Float or Rational, and the `digits` value is
928
+ # omitted, this exception is raised.
929
+ #
930
+ def self?.BigDecimal: ((real | string | BigDecimal) initial, ?int digits, ?exception: bool) -> BigDecimal
931
+ end
data/stdlib/csv/0/csv.rbs CHANGED
@@ -360,6 +360,49 @@ class CSV < Object
360
360
  # output non-ASCII compatible data.
361
361
  #
362
362
  def self.generate: (?String str, **untyped options) { (CSV csv) -> void } -> String
363
+
364
+ # :call-seq:
365
+ # csv.each -> enumerator
366
+ # csv.each {|row| ...}
367
+ #
368
+ # Calls the block with each successive row.
369
+ # The data source must be opened for reading.
370
+ #
371
+ # Without headers:
372
+ # string = "foo,0\nbar,1\nbaz,2\n"
373
+ # csv = CSV.new(string)
374
+ # csv.each do |row|
375
+ # p row
376
+ # end
377
+ # Output:
378
+ # ["foo", "0"]
379
+ # ["bar", "1"]
380
+ # ["baz", "2"]
381
+ #
382
+ # With headers:
383
+ # string = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
384
+ # csv = CSV.new(string, headers: true)
385
+ # csv.each do |row|
386
+ # p row
387
+ # end
388
+ # Output:
389
+ # <CSV::Row "Name":"foo" "Value":"0">
390
+ # <CSV::Row "Name":"bar" "Value":"1">
391
+ # <CSV::Row "Name":"baz" "Value":"2">
392
+ #
393
+ # ---
394
+ #
395
+ # Raises an exception if the source is not opened for reading:
396
+ # string = "foo,0\nbar,1\nbaz,2\n"
397
+ # csv = CSV.new(string)
398
+ # csv.close
399
+ # # Raises IOError (not opened for reading)
400
+ # csv.each do |row|
401
+ # p row
402
+ # end
403
+ def each: () -> Enumerator[untyped, Integer]
404
+ | () { (untyped) -> void } -> Integer
405
+
363
406
  end
364
407
 
365
408
  # The options used when no overrides are given by calling code. They are:
@@ -408,7 +451,7 @@ CSV::VERSION: String
408
451
  # processing is activated.
409
452
  #
410
453
  class CSV::Row < Object
411
- include Enumerable[untyped]
454
+ include Enumerable[Array[String]]
412
455
  extend Forwardable
413
456
 
414
457
  # If a two-element Array is provided, it is assumed to be a header and field and
@@ -464,7 +507,8 @@ class CSV::Row < Object
464
507
  #
465
508
  # Support for Enumerable.
466
509
  #
467
- def each: () { (*untyped) -> untyped } -> untyped
510
+ def each: () -> Enumerator[Array[String], self]
511
+ | () { (Array[String]) -> void } -> self
468
512
 
469
513
  alias each_pair each
470
514
 
@@ -717,7 +761,9 @@ class CSV::Table[out Elem] < Object
717
761
  #
718
762
  # If no block is given, an Enumerator is returned.
719
763
  #
720
- def each: () { (*untyped) -> untyped } -> untyped
764
+ def each: () -> Enumerator[untyped, self]
765
+ | () { (untyped) -> void } -> self
766
+ | () { (*untyped) -> void } -> self
721
767
 
722
768
  def empty?: (*untyped args) { (*untyped) -> untyped } -> untyped
723
769
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0.beta.3
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-19 00:00:00.000000000 Z
11
+ date: 2021-11-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.
@@ -44,6 +44,7 @@ files:
44
44
  - core/encoding.rbs
45
45
  - core/enumerable.rbs
46
46
  - core/enumerator.rbs
47
+ - core/env.rbs
47
48
  - core/errno.rbs
48
49
  - core/errors.rbs
49
50
  - core/exception.rbs
@@ -152,12 +153,12 @@ files:
152
153
  - lib/rbs/locator.rb
153
154
  - lib/rbs/method_type.rb
154
155
  - lib/rbs/namespace.rb
155
- - lib/rbs/parser.y
156
156
  - lib/rbs/parser_aux.rb
157
157
  - lib/rbs/parser_compat/lexer_error.rb
158
158
  - lib/rbs/parser_compat/located_value.rb
159
159
  - lib/rbs/parser_compat/semantics_error.rb
160
160
  - lib/rbs/parser_compat/syntax_error.rb
161
+ - lib/rbs/prototype/helpers.rb
161
162
  - lib/rbs/prototype/rb.rb
162
163
  - lib/rbs/prototype/rbi.rb
163
164
  - lib/rbs/prototype/runtime.rb
@@ -181,7 +182,6 @@ files:
181
182
  - lib/rbs/vendorer.rb
182
183
  - lib/rbs/version.rb
183
184
  - lib/rbs/writer.rb
184
- - lib/ruby/signature.rb
185
185
  - rbs.gemspec
186
186
  - schema/annotation.json
187
187
  - schema/comment.json
@@ -340,9 +340,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
340
340
  version: '2.6'
341
341
  required_rubygems_version: !ruby/object:Gem::Requirement
342
342
  requirements:
343
- - - ">"
343
+ - - ">="
344
344
  - !ruby/object:Gem::Version
345
- version: 1.3.1
345
+ version: '0'
346
346
  requirements: []
347
347
  rubygems_version: 3.2.22
348
348
  signing_key: