Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update activesupport.rbi #288

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Update activesupport.rbi #288

merged 1 commit into from
Nov 3, 2020

Conversation

jeffcarbs
Copy link
Contributor

Merge our (Gusto's) hand-maintained activesupport.rbi with the upstream.

@jeffcarbs jeffcarbs requested a review from a team as a code owner November 3, 2020 05:24
@jeffcarbs jeffcarbs requested review from jez and removed request for a team November 3, 2020 05:24
sig do
params(
number: T.any(Integer, Float, String),
number: T.any(Numeric, String),
Copy link
Contributor Author

@jeffcarbs jeffcarbs Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These (and many other sigs) were typed as T.any(Integer, Float) but any Numeric (BigDecimal, Rational) would work.

sig { params(keys: T.untyped).returns(T.self_type) }
def except(*keys); end

sig { returns(T::Hash[String, V]) }
Copy link
Contributor Author

@jeffcarbs jeffcarbs Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symbolize_keys and stringify_keys only operate on the keys so whatever the V is should be unchanged. The other sigs were losing that type information by making them T.untyped.

@@ -1422,3 +1713,996 @@ module Benchmark
sig { params(block: T.proc.void).returns(Float) }
def self.ms(&block); end
end

class ActiveSupport::Cache::Store
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of this file was pulled out of the RBI file generated by tapioca.

@jez jez merged commit bd41ac9 into sorbet:master Nov 3, 2020
@jeffcarbs jeffcarbs deleted the update-active-support branch November 3, 2020 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants