-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Sorbet updates for compatibility with recent releases #16183
Changes from all commits
c889eb5
61691aa
0191af7
75179e9
ca90f98
3c0506e
bf33991
57baeb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# typed: strict | ||
|
||
module Predicable | ||
requires_ancestor { Class } | ||
include Kernel | ||
requires_ancestor { Module } | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,7 @@ def extract_nestedly(to: nil, basename: nil, verbose: false, prioritize_extensio | |
|
||
children = tmp_unpack_dir.children | ||
|
||
if children.count == 1 && !children.first.directory? | ||
if children.size == 1 && !children.fetch(0).directory? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of |
||
s = UnpackStrategy.detect(children.first, prioritize_extension: prioritize_extension) | ||
|
||
s.extract_nestedly(to: to, verbose: verbose, prioritize_extension: prioritize_extension) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,12 +65,14 @@ | |
receipt_file = file_from_bottle(bottle_file, receipt_file_path) | ||
tap = Tab.from_file_content(receipt_file, "#{bottle_file}/#{receipt_file_path}").tap | ||
"#{tap}/#{name}" if tap.present? && !tap.core_tap? | ||
elsif (bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json"))) && | ||
bottle_json_path.exist? && | ||
(bottle_json_path_contents = bottle_json_path.read.presence) && | ||
(bottle_json = JSON.parse(bottle_json_path_contents).presence) && | ||
bottle_json.is_a?(Hash) | ||
bottle_json.keys.first.presence | ||
else | ||
bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always true assignments in conditionals seem to be disallowed now: sorbet/sorbet#7463 (It's probably worth the reviewer's attention to check that the branching logic is unchanged.) |
||
if bottle_json_path.exist? && | ||
(bottle_json_path_contents = bottle_json_path.read.presence) && | ||
(bottle_json = JSON.parse(bottle_json_path_contents).presence) && | ||
bottle_json.is_a?(Hash) | ||
bottle_json.keys.first.presence | ||
end | ||
end | ||
full_name ||= name | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is disallowed as of sorbet/sorbet#6983