clean-architecture 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +52 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -2
- data/clean-architecture.gemspec +3 -3
- data/lib/clean_architecture/queries/http_failure_code.rb +2 -1
- data/lib/clean_architecture/version.rb +1 -1
- data/sorbet/rbi/gems/activemodel.rbi +2 -1
- data/sorbet/rbi/gems/activesupport.rbi +3 -3
- data/sorbet/rbi/gems/ast.rbi +1 -0
- data/sorbet/rbi/gems/byebug.rbi +3 -2
- data/sorbet/rbi/gems/coderay.rbi +1 -0
- data/sorbet/rbi/gems/concurrent-ruby.rbi +22 -23
- data/sorbet/rbi/gems/docile.rbi +1 -0
- data/sorbet/rbi/gems/dry-configurable.rbi +107 -57
- data/sorbet/rbi/gems/dry-container.rbi +1 -0
- data/sorbet/rbi/gems/dry-core.rbi +1 -0
- data/sorbet/rbi/gems/dry-equalizer.rbi +5 -4
- data/sorbet/rbi/gems/dry-inflector.rbi +1 -0
- data/sorbet/rbi/gems/dry-initializer.rbi +4 -4
- data/sorbet/rbi/gems/dry-logic.rbi +12 -11
- data/sorbet/rbi/gems/dry-matcher.rbi +2 -1
- data/sorbet/rbi/gems/dry-monads.rbi +8 -6
- data/sorbet/rbi/gems/dry-schema.rbi +92 -96
- data/sorbet/rbi/gems/dry-struct.rbi +32 -60
- data/sorbet/rbi/gems/dry-types.rbi +76 -55
- data/sorbet/rbi/gems/dry-validation.rbi +34 -30
- data/sorbet/rbi/gems/duckface-interfaces.rbi +1 -0
- data/sorbet/rbi/gems/i18n.rbi +2 -1
- data/sorbet/rbi/gems/jaro_winkler.rbi +2 -1
- data/sorbet/rbi/gems/method_source.rbi +1 -0
- data/sorbet/rbi/gems/parallel.rbi +2 -1
- data/sorbet/rbi/gems/parser.rbi +80 -452
- data/sorbet/rbi/gems/pry-byebug.rbi +10 -4
- data/sorbet/rbi/gems/pry.rbi +1 -0
- data/sorbet/rbi/gems/rainbow.rbi +1 -0
- data/sorbet/rbi/gems/rake.rbi +77 -67
- data/sorbet/rbi/gems/rb-readline.rbi +1 -0
- data/sorbet/rbi/gems/rexml.rbi +589 -0
- data/sorbet/rbi/gems/rspec-core.rbi +14 -1
- data/sorbet/rbi/gems/rspec-expectations.rbi +2 -34
- data/sorbet/rbi/gems/rspec-mocks.rbi +133 -1
- data/sorbet/rbi/gems/rspec-support.rbi +4 -1
- data/sorbet/rbi/gems/rspec.rbi +1 -0
- data/sorbet/rbi/gems/rubocop-rspec.rbi +51 -4
- data/sorbet/rbi/gems/rubocop.rbi +746 -442
- data/sorbet/rbi/gems/ruby-progressbar.rbi +1 -0
- data/sorbet/rbi/gems/simplecov-html.rbi +6 -1
- data/sorbet/rbi/gems/simplecov.rbi +144 -17
- data/sorbet/rbi/gems/stackprof.rbi +2 -1
- data/sorbet/rbi/gems/unicode-display_width.rbi +2 -1
- data/sorbet/rbi/hidden-definitions/errors.txt +2040 -890
- data/sorbet/rbi/hidden-definitions/hidden.rbi +1431 -2092
- data/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +325 -295
- data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +357 -3
- data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +9 -0
- data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +37 -15
- data/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +8 -8
- data/sorbet/rbi/todo.rbi +1 -4
- metadata +11 -23
- data/.github/workflows/rspec.yml +0 -21
- data/sorbet/rbi/gems/axiom-types.rbi +0 -159
- data/sorbet/rbi/gems/codeclimate-engine-rb.rbi +0 -123
- data/sorbet/rbi/gems/coercible.rbi +0 -156
- data/sorbet/rbi/gems/descendants_tracker.rbi +0 -17
- data/sorbet/rbi/gems/equalizer.rbi +0 -22
- data/sorbet/rbi/gems/ice_nine.rbi +0 -66
- data/sorbet/rbi/gems/kwalify.rbi +0 -339
- data/sorbet/rbi/gems/psych.rbi +0 -462
- data/sorbet/rbi/gems/reek.rbi +0 -1066
- data/sorbet/rbi/gems/thread_safe.rbi +0 -81
- data/sorbet/rbi/gems/timecop.rbi +0 -97
- data/sorbet/rbi/gems/virtus.rbi +0 -421
@@ -160,7 +160,8 @@ class String
|
|
160
160
|
sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) }
|
161
161
|
def humanize(capitalize: true, keep_id_suffix: false); end
|
162
162
|
|
163
|
-
|
163
|
+
# returns Time in the case zone is passed nil and ActiveSupport::TimeWithZone otherwise
|
164
|
+
sig { params(zone: T.nilable(T.any(String, ActiveSupport::TimeZone))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
|
164
165
|
def in_time_zone(zone = ::Time.zone); end
|
165
166
|
|
166
167
|
sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) }
|
@@ -196,7 +197,7 @@ class String
|
|
196
197
|
sig { returns(T.untyped) }
|
197
198
|
def safe_constantize; end
|
198
199
|
|
199
|
-
sig { params(locale: Symbol).returns(
|
200
|
+
sig { params(locale: Symbol).returns(String) }
|
200
201
|
def singularize(locale = :en); end
|
201
202
|
|
202
203
|
sig { returns(T.untyped) }
|
@@ -544,6 +545,29 @@ class ActiveSupport::TimeWithZone
|
|
544
545
|
|
545
546
|
sig { returns(ActiveSupport::TimeWithZone) }
|
546
547
|
def at_middle_of_day; end
|
548
|
+
|
549
|
+
sig { returns(ActiveSupport::TimeWithZone) }
|
550
|
+
def end_of_day; end
|
551
|
+
|
552
|
+
sig { returns(ActiveSupport::TimeWithZone) }
|
553
|
+
def at_end_of_day; end
|
554
|
+
end
|
555
|
+
|
556
|
+
# defines some of the methods at https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/date
|
557
|
+
# this is not a complete definition!
|
558
|
+
class Date
|
559
|
+
sig { params(options: T::Hash[Symbol, Integer]).returns(Date) }
|
560
|
+
def advance(options); end
|
561
|
+
|
562
|
+
# these are the sigs for Date- in the stdlib
|
563
|
+
# https://github.com/sorbet/sorbet/blob/3910f6cfd9935c9b42e2135e32e15ab8a6e5b9be/rbi/stdlib/date.rbi#L373
|
564
|
+
# note that if more sigs are added to sorbet you should replicate them here
|
565
|
+
# check sorbet master: https://github.com/sorbet/sorbet/blob/master/rbi/stdlib/date.rbi
|
566
|
+
sig {params(arg0: Numeric).returns(T.self_type)}
|
567
|
+
sig {params(arg0: Date).returns(Rational)}
|
568
|
+
# these sigs are added for activesupport users
|
569
|
+
sig {params(arg0: ActiveSupport::Duration).returns(T.self_type)}
|
570
|
+
def -(arg0); end
|
547
571
|
end
|
548
572
|
|
549
573
|
# defines some of the methods at https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/time
|
@@ -555,6 +579,9 @@ class Time
|
|
555
579
|
sig { returns(Time) }
|
556
580
|
def beginning_of_day; end
|
557
581
|
|
582
|
+
sig { params(options: T::Hash[Symbol, Integer]).returns(Time) }
|
583
|
+
def advance(options); end
|
584
|
+
|
558
585
|
sig { returns(Time) }
|
559
586
|
def at_midnight; end
|
560
587
|
|
@@ -580,8 +607,29 @@ class Time
|
|
580
607
|
def at_middle_of_day; end
|
581
608
|
|
582
609
|
# https://github.com/rails/rails/blob/v6.0.0/activesupport/lib/active_support/core_ext/date_and_time/zones.rb
|
583
|
-
|
610
|
+
# returns Time in the case zone is passed nil and ActiveSupport::TimeWithZone otherwise
|
611
|
+
sig { params(zone: T.nilable(T.any(String, ActiveSupport::TimeZone))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
|
584
612
|
def in_time_zone(zone = ::Time.zone); end
|
613
|
+
|
614
|
+
# these are the sigs for Time- in the stdlib
|
615
|
+
# https://github.com/sorbet/sorbet/blob/c3691753e4ce545e1eb66cbd3e55de67d8879b98/rbi/core/time.rbi#L347
|
616
|
+
# note that if more sigs are added to sorbet you should replicate them here
|
617
|
+
# check sorbet master: https://github.com/sorbet/sorbet/blob/master/rbi/core/time.rbi#L347
|
618
|
+
sig do
|
619
|
+
params(
|
620
|
+
arg0: Time,
|
621
|
+
)
|
622
|
+
.returns(Float)
|
623
|
+
end
|
624
|
+
sig do
|
625
|
+
params(
|
626
|
+
arg0: Numeric,
|
627
|
+
)
|
628
|
+
.returns(Time)
|
629
|
+
end
|
630
|
+
# these sigs are added for activesupport users
|
631
|
+
sig {params(arg0: ActiveSupport::Duration).returns(Time)}
|
632
|
+
def -(arg0); end
|
585
633
|
end
|
586
634
|
|
587
635
|
# defines some of the methods at https://github.com/rails/rails/tree/v6.0.0/activesupport/lib/active_support/core_ext/hash
|
@@ -623,3 +671,309 @@ class Hash
|
|
623
671
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
624
672
|
def to_options; end
|
625
673
|
end
|
674
|
+
|
675
|
+
class Integer
|
676
|
+
# Returns a Duration instance matching the number of months provided.
|
677
|
+
#
|
678
|
+
# ```ruby
|
679
|
+
# 2.months # => 2 months
|
680
|
+
# ```
|
681
|
+
sig { returns(ActiveSupport::Duration) }
|
682
|
+
def months; end
|
683
|
+
|
684
|
+
sig { returns(ActiveSupport::Duration) }
|
685
|
+
def month; end
|
686
|
+
|
687
|
+
# Returns a Duration instance matching the number of years provided.
|
688
|
+
#
|
689
|
+
# ```ruby
|
690
|
+
# 2.years # => 2 years
|
691
|
+
# ```
|
692
|
+
sig { returns(ActiveSupport::Duration) }
|
693
|
+
def years; end
|
694
|
+
|
695
|
+
sig { returns(ActiveSupport::Duration) }
|
696
|
+
def year; end
|
697
|
+
end
|
698
|
+
|
699
|
+
class Numeric
|
700
|
+
sig { returns(ActiveSupport::Duration) }
|
701
|
+
def second; end
|
702
|
+
|
703
|
+
sig { returns(ActiveSupport::Duration) }
|
704
|
+
def seconds; end
|
705
|
+
|
706
|
+
sig { returns(ActiveSupport::Duration) }
|
707
|
+
def minute; end
|
708
|
+
|
709
|
+
sig { returns(ActiveSupport::Duration) }
|
710
|
+
def minutes; end
|
711
|
+
|
712
|
+
sig { returns(ActiveSupport::Duration) }
|
713
|
+
def hour; end
|
714
|
+
|
715
|
+
sig { returns(ActiveSupport::Duration) }
|
716
|
+
def hours; end
|
717
|
+
|
718
|
+
sig { returns(ActiveSupport::Duration) }
|
719
|
+
def day; end
|
720
|
+
|
721
|
+
sig { returns(ActiveSupport::Duration) }
|
722
|
+
def days; end
|
723
|
+
|
724
|
+
sig { returns(ActiveSupport::Duration) }
|
725
|
+
def week; end
|
726
|
+
|
727
|
+
sig { returns(ActiveSupport::Duration) }
|
728
|
+
def weeks; end
|
729
|
+
|
730
|
+
sig { returns(ActiveSupport::Duration) }
|
731
|
+
def fortnight; end
|
732
|
+
|
733
|
+
sig { returns(ActiveSupport::Duration) }
|
734
|
+
def fortnights; end
|
735
|
+
|
736
|
+
sig { returns(T.self_type) }
|
737
|
+
def in_milliseconds; end
|
738
|
+
|
739
|
+
KILOBYTE = T.let(1024, Integer)
|
740
|
+
MEGABYTE = T.let(KILOBYTE * 1024, Integer)
|
741
|
+
GIGABYTE = T.let(MEGABYTE * 1024, Integer)
|
742
|
+
TERABYTE = T.let(GIGABYTE * 1024, Integer)
|
743
|
+
PETABYTE = T.let(TERABYTE * 1024, Integer)
|
744
|
+
EXABYTE = T.let(PETABYTE * 1024, Integer)
|
745
|
+
|
746
|
+
# Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
|
747
|
+
#
|
748
|
+
# ```ruby
|
749
|
+
# 2.bytes # => 2
|
750
|
+
# ```
|
751
|
+
sig { returns(T.self_type) }
|
752
|
+
def byte; end
|
753
|
+
|
754
|
+
# Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
|
755
|
+
#
|
756
|
+
# ```ruby
|
757
|
+
# 2.bytes # => 2
|
758
|
+
# ```
|
759
|
+
sig { returns(T.self_type) }
|
760
|
+
def bytes; end
|
761
|
+
|
762
|
+
# Returns the number of bytes equivalent to the kilobytes provided.
|
763
|
+
#
|
764
|
+
# ```ruby
|
765
|
+
# 2.kilobytes # => 2048
|
766
|
+
# ```
|
767
|
+
sig { returns(T.self_type) }
|
768
|
+
def kilobyte; end
|
769
|
+
|
770
|
+
# Returns the number of bytes equivalent to the kilobytes provided.
|
771
|
+
#
|
772
|
+
# ```ruby
|
773
|
+
# 2.kilobytes # => 2048
|
774
|
+
# ```
|
775
|
+
sig { returns(T.self_type) }
|
776
|
+
def kilobytes; end
|
777
|
+
|
778
|
+
# Returns the number of bytes equivalent to the megabytes provided.
|
779
|
+
#
|
780
|
+
# ```ruby
|
781
|
+
# 2.megabytes # => 2_097_152
|
782
|
+
# ```
|
783
|
+
sig { returns(T.self_type) }
|
784
|
+
def megabyte; end
|
785
|
+
|
786
|
+
# Returns the number of bytes equivalent to the megabytes provided.
|
787
|
+
#
|
788
|
+
# ```ruby
|
789
|
+
# 2.megabytes # => 2_097_152
|
790
|
+
# ```
|
791
|
+
sig { returns(T.self_type) }
|
792
|
+
def megabytes; end
|
793
|
+
|
794
|
+
# Returns the number of bytes equivalent to the gigabytes provided.
|
795
|
+
#
|
796
|
+
# ```ruby
|
797
|
+
# 2.gigabytes # => 2_147_483_648
|
798
|
+
# ```
|
799
|
+
sig { returns(T.self_type) }
|
800
|
+
def gigabyte; end
|
801
|
+
|
802
|
+
# Returns the number of bytes equivalent to the gigabytes provided.
|
803
|
+
#
|
804
|
+
# ```ruby
|
805
|
+
# 2.gigabytes # => 2_147_483_648
|
806
|
+
# ```
|
807
|
+
sig { returns(T.self_type) }
|
808
|
+
def gigabytes; end
|
809
|
+
|
810
|
+
# Returns the number of bytes equivalent to the terabytes provided.
|
811
|
+
#
|
812
|
+
# ```ruby
|
813
|
+
# 2.terabytes # => 2_199_023_255_552
|
814
|
+
# ```
|
815
|
+
sig { returns(T.self_type) }
|
816
|
+
def terabyte; end
|
817
|
+
|
818
|
+
# Returns the number of bytes equivalent to the terabytes provided.
|
819
|
+
#
|
820
|
+
# ```ruby
|
821
|
+
# 2.terabytes # => 2_199_023_255_552
|
822
|
+
# ```
|
823
|
+
sig { returns(T.self_type) }
|
824
|
+
def terabytes; end
|
825
|
+
|
826
|
+
# Returns the number of bytes equivalent to the petabytes provided.
|
827
|
+
#
|
828
|
+
# ```ruby
|
829
|
+
# 2.petabytes # => 2_251_799_813_685_248
|
830
|
+
# ```
|
831
|
+
sig { returns(T.self_type) }
|
832
|
+
def petabyte; end
|
833
|
+
|
834
|
+
# Returns the number of bytes equivalent to the petabytes provided.
|
835
|
+
#
|
836
|
+
# ```ruby
|
837
|
+
# 2.petabytes # => 2_251_799_813_685_248
|
838
|
+
# ```
|
839
|
+
sig { returns(T.self_type) }
|
840
|
+
def petabytes; end
|
841
|
+
|
842
|
+
# Returns the number of bytes equivalent to the exabytes provided.
|
843
|
+
#
|
844
|
+
# ```ruby
|
845
|
+
# 2.exabytes # => 2_305_843_009_213_693_952
|
846
|
+
# ```
|
847
|
+
sig { returns(T.self_type) }
|
848
|
+
def exabyte; end
|
849
|
+
|
850
|
+
# Returns the number of bytes equivalent to the exabytes provided.
|
851
|
+
#
|
852
|
+
# ```ruby
|
853
|
+
# 2.exabytes # => 2_305_843_009_213_693_952
|
854
|
+
# ```
|
855
|
+
sig { returns(T.self_type) }
|
856
|
+
def exabytes; end
|
857
|
+
end
|
858
|
+
|
859
|
+
module Enumerable
|
860
|
+
# https://github.com/rails/rails/blob/v5.2.3/activesupport/lib/active_support/core_ext/enumerable.rb#L64..L72
|
861
|
+
# the case where a block isn't given isn't handled - that seems like an unlikely case
|
862
|
+
sig do
|
863
|
+
type_parameters(:key).params(
|
864
|
+
block: T.proc.params(o: Enumerable::Elem).returns(T.type_parameter(:key))
|
865
|
+
).returns(
|
866
|
+
T::Hash[T.type_parameter(:key), Enumerable::Elem]
|
867
|
+
)
|
868
|
+
end
|
869
|
+
def index_by(&block); end
|
870
|
+
end
|
871
|
+
|
872
|
+
class ActiveSupport::Duration
|
873
|
+
# Returns the number of seconds that this Duration represents.
|
874
|
+
#
|
875
|
+
# ```ruby
|
876
|
+
# 1.minute.to_i # => 60
|
877
|
+
# 1.hour.to_i # => 3600
|
878
|
+
# 1.day.to_i # => 86400
|
879
|
+
# ```
|
880
|
+
#
|
881
|
+
# Note that this conversion makes some assumptions about the
|
882
|
+
# duration of some periods, e.g. months are always 1/12 of year
|
883
|
+
# and years are 365.2425 days:
|
884
|
+
#
|
885
|
+
# ```ruby
|
886
|
+
# # equivalent to (1.year / 12).to_i
|
887
|
+
# 1.month.to_i # => 2629746
|
888
|
+
#
|
889
|
+
# # equivalent to 365.2425.days.to_i
|
890
|
+
# 1.year.to_i # => 31556952
|
891
|
+
# ```
|
892
|
+
#
|
893
|
+
# In such cases, Ruby's core
|
894
|
+
# [Date](https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html) and
|
895
|
+
# [Time](https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html) should be used for precision
|
896
|
+
# date and time arithmetic.
|
897
|
+
sig { returns(Integer) }
|
898
|
+
def to_i; end
|
899
|
+
|
900
|
+
sig { returns(Float) }
|
901
|
+
def to_f; end
|
902
|
+
|
903
|
+
# Returns the amount of seconds a duration covers as a string.
|
904
|
+
# For more information check to_i method.
|
905
|
+
#
|
906
|
+
# ```ruby
|
907
|
+
# 1.day.to_s # => "86400"
|
908
|
+
# ```
|
909
|
+
sig { returns(String) }
|
910
|
+
def to_s; end
|
911
|
+
|
912
|
+
# Creates a new Duration from string formatted according to ISO 8601 Duration.
|
913
|
+
#
|
914
|
+
# See [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) for more information.
|
915
|
+
# This method allows negative parts to be present in pattern.
|
916
|
+
# If invalid string is provided, it will raise `ActiveSupport::Duration::ISO8601Parser::ParsingError`.
|
917
|
+
sig { params(iso8601duration: String).returns(ActiveSupport::Duration) }
|
918
|
+
def self.parse(iso8601duration); end
|
919
|
+
|
920
|
+
# Creates a new Duration from a seconds value that is converted
|
921
|
+
# to the individual parts:
|
922
|
+
#
|
923
|
+
# ```ruby
|
924
|
+
# ActiveSupport::Duration.build(31556952).parts # => {:years=>1}
|
925
|
+
# ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1}
|
926
|
+
# ```
|
927
|
+
sig { params(value: Numeric).returns(ActiveSupport::Duration) }
|
928
|
+
def self.build(value); end
|
929
|
+
|
930
|
+
# Returns `true` if `other` is also a Duration instance, which has the
|
931
|
+
# same parts as this one.
|
932
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
933
|
+
def eql?(other); end
|
934
|
+
|
935
|
+
# Compares one Duration with another or a Numeric to this Duration.
|
936
|
+
# Numeric values are treated as seconds.
|
937
|
+
sig { params(other: T.any(ActiveSupport::Duration, Numeric)).returns(Integer) }
|
938
|
+
def <=>(other); end
|
939
|
+
|
940
|
+
# Adds another Duration or a Numeric to this Duration. Numeric values
|
941
|
+
# are treated as seconds.
|
942
|
+
sig { params(other: T.any(ActiveSupport::Duration, Numeric)).returns(ActiveSupport::Duration) }
|
943
|
+
def +(other); end
|
944
|
+
|
945
|
+
# Subtracts another Duration or a Numeric from this Duration. Numeric
|
946
|
+
# values are treated as seconds.
|
947
|
+
sig { params(other: T.any(ActiveSupport::Duration, Numeric)).returns(ActiveSupport::Duration) }
|
948
|
+
def -(other); end
|
949
|
+
|
950
|
+
# Multiplies this Duration by a Numeric and returns a new Duration.
|
951
|
+
sig { params(other: Numeric).returns(ActiveSupport::Duration) }
|
952
|
+
def *(other); end
|
953
|
+
|
954
|
+
# Divides this Duration by a Numeric and returns a new Duration.
|
955
|
+
sig { params(other: Numeric).returns(ActiveSupport::Duration) }
|
956
|
+
def /(other); end
|
957
|
+
|
958
|
+
# Returns the modulo of this Duration by another Duration or Numeric.
|
959
|
+
# Numeric values are treated as seconds.
|
960
|
+
sig { params(other: T.any(ActiveSupport::Duration, Numeric)).returns(ActiveSupport::Duration) }
|
961
|
+
def %(other); end
|
962
|
+
|
963
|
+
# Returns `true` if `other` is also a Duration instance with the
|
964
|
+
# same `value`, or if `other == value`.
|
965
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
966
|
+
def ==(other); end
|
967
|
+
|
968
|
+
# Build ISO 8601 Duration string for this duration.
|
969
|
+
# The `precision` parameter can be used to limit seconds' precision of duration.
|
970
|
+
sig { params(precision: T.nilable(Integer)).returns(String) }
|
971
|
+
def iso8601(precision: nil); end
|
972
|
+
end
|
973
|
+
|
974
|
+
module Benchmark
|
975
|
+
extend T::Sig
|
976
|
+
|
977
|
+
sig { params(block: T.proc.void).returns(Float) }
|
978
|
+
def self.ms(&block); end
|
979
|
+
end
|
@@ -8,9 +8,18 @@
|
|
8
8
|
# typed: strong
|
9
9
|
|
10
10
|
module Minitest
|
11
|
+
class Runnable
|
12
|
+
end
|
13
|
+
|
11
14
|
class Test < Runnable
|
12
15
|
include Minitest::Assertions
|
13
16
|
end
|
17
|
+
|
18
|
+
sig { void }
|
19
|
+
def self.autorun; end
|
20
|
+
|
21
|
+
sig { params(args: T::Array[String]).returns(T::Boolean) }
|
22
|
+
def self.run(args = []); end
|
14
23
|
end
|
15
24
|
|
16
25
|
module Minitest::Assertions
|
@@ -5,7 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# https://github.com/sorbet/sorbet-typed/edit/master/lib/rainbow/all/rainbow.rbi
|
7
7
|
#
|
8
|
-
# typed:
|
8
|
+
# typed: strong
|
9
9
|
|
10
10
|
module Rainbow
|
11
11
|
sig { returns(T::Boolean) }
|
@@ -57,7 +57,7 @@ module Rainbow
|
|
57
57
|
sig { params(value: Numeric).returns(Integer) }
|
58
58
|
def to_ansi_domain(value); end
|
59
59
|
|
60
|
-
sig { params(ground: Symbol, values: Integer).returns(RGB) }
|
60
|
+
sig { params(ground: Symbol, values: Integer).returns(RGB) }
|
61
61
|
def initialize(ground, *values); end
|
62
62
|
|
63
63
|
sig { returns(T::Array[Integer]) }
|
@@ -94,9 +94,18 @@ module Rainbow
|
|
94
94
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
95
95
|
def color(*values); end
|
96
96
|
|
97
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
98
|
+
def foreground(*values); end
|
99
|
+
|
100
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
101
|
+
def fg(*values); end
|
102
|
+
|
97
103
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
98
104
|
def background(*values); end
|
99
105
|
|
106
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
|
107
|
+
def bg(*values); end
|
108
|
+
|
100
109
|
sig { returns(NullPresenter) }
|
101
110
|
def reset; end
|
102
111
|
|
@@ -148,12 +157,14 @@ module Rainbow
|
|
148
157
|
sig { returns(NullPresenter) }
|
149
158
|
def white; end
|
150
159
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
160
|
+
sig { returns(NullPresenter) }
|
161
|
+
def bold; end
|
162
|
+
|
163
|
+
sig { returns(NullPresenter) }
|
164
|
+
def dark; end
|
165
|
+
|
166
|
+
sig { returns(NullPresenter) }
|
167
|
+
def strike; end
|
157
168
|
end
|
158
169
|
|
159
170
|
class Presenter < String
|
@@ -162,9 +173,18 @@ module Rainbow
|
|
162
173
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
163
174
|
def color(*values); end
|
164
175
|
|
176
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
177
|
+
def foreground(*values); end
|
178
|
+
|
179
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
180
|
+
def fg(*values); end
|
181
|
+
|
165
182
|
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
166
183
|
def background(*values); end
|
167
184
|
|
185
|
+
sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
|
186
|
+
def bg(*values); end
|
187
|
+
|
168
188
|
sig { returns(Presenter) }
|
169
189
|
def reset; end
|
170
190
|
|
@@ -216,12 +236,14 @@ module Rainbow
|
|
216
236
|
sig { returns(Presenter) }
|
217
237
|
def white; end
|
218
238
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
239
|
+
sig { returns(Presenter) }
|
240
|
+
def bold; end
|
241
|
+
|
242
|
+
sig { returns(Presenter) }
|
243
|
+
def dark; end
|
244
|
+
|
245
|
+
sig { returns(Presenter) }
|
246
|
+
def strike; end
|
225
247
|
end
|
226
248
|
|
227
249
|
class StringUtils
|
@@ -240,7 +262,7 @@ module Rainbow
|
|
240
262
|
|
241
263
|
sig { params(enabled: T::Boolean).returns(Wrapper) }
|
242
264
|
def initialize(enabled = true); end
|
243
|
-
|
265
|
+
|
244
266
|
sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) }
|
245
267
|
def wrap(string); end
|
246
268
|
end
|