Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–201 unchanged (201 lines)
202 hash["disable_args"] = disable_args
203 end
204
205 hash["head_dependency_hash"] = hash["head_dependencies"]
206
207 hash["head_url_args"] = begin
208 url = hash.dig("urls", "head", "url")
209 specs = {
210 branch: hash.dig("urls", "head", "branch"),
211 using: hash.dig("urls", "head", "using")&.to_sym,
212 }.compact_blank
213 [url, specs]
214 end
215
…lines 216–300 unchanged (85 lines)

After

…lines 1–201 unchanged (201 lines)
202 hash["disable_args"] = disable_args
203 end
204
205 hash["head_dependency_hash"] = hash["head_dependencies"]
206
207 hash["head_url_args"] = begin
208 # Fall back to "" to satisfy the type checker. If the head URL is missing, head_present will be false.
209 url = hash.dig("urls", "head", "url") || ""
210 specs = {
211 branch: hash.dig("urls", "head", "branch"),
212 using: hash.dig("urls", "head", "using")&.to_sym,
213 }.compact_blank
214 [url, specs]
215 end
…lines 216–301 unchanged (86 lines)

Before

program
comment "# typed: strict"
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "\""
string_content "cachable"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "api"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "api/source_download"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "download_queue"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "autobump_constants"
" "\""
module
module "module"
constant "Homebrew"
body_statement
module
module "module"
constant "API"
comment "# Helper functions for using the formula JSON API."
body_statement
module
module "module"
constant "Formula"
body_statement
call
identifier "extend"
argument_list
constant "Cachable"
assignment
constant "DEFAULT_API_FILENAME"
= "="
string
" "\""
string_content "formula.jws.json"
" "\""
call
identifier "private_class_method"
argument_list
simple_symbol ":cache"
call (+34 nodes collapsed)
singleton_method (+70 nodes collapsed)
call (+30 nodes collapsed)
singleton_method (+105 nodes collapsed)
call (+45 nodes collapsed)
singleton_method (+157 nodes collapsed)
call (+26 nodes collapsed)
singleton_method (+71 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "returns"
argument_list
( "("
constant "Pathname"
) ")"
} "}"
singleton_method
def "def"
self "self"
. "."
identifier "cached_json_file_path"
body_statement
binary
constant "HOMEBREW_CACHE_API"
/ "/"
constant "DEFAULT_API_FILENAME"
end "end"
call (+83 nodes collapsed)
singleton_method (+38 nodes collapsed)
call (+83 nodes collapsed)
singleton_method (+41 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "returns"
argument_list
( "("
scope_resolution
constant "T"
:: "::"
constant "Boolean"
) ")"
} "}"
singleton_method (+188 nodes collapsed)
call
identifier "private_class_method"
argument_list
simple_symbol ":download_and_cache_data!"
call (+24 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+24 nodes collapsed)
singleton_method (+51 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+72 nodes collapsed)
call (+34 nodes collapsed)
singleton_method
def "def"
self "self"
. "."
identifier "generate_formula_struct_hash"
method_parameters
( "("
identifier "hash"
) ")"
body_statement
assignment
identifier "hash"
= "="
call
call
scope_resolution
constant "Homebrew"
:: "::"
constant "API"
. "."
identifier "merge_variations"
argument_list
( "("
identifier "hash"
) ")"
. "."
identifier "dup"
if (+36 nodes collapsed)
assignment (+99 nodes collapsed)
assignment (+31 nodes collapsed)
assignment
identifier "conflicts_with"
= "="
binary
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "conflicts_with"
" "\""
] "]"
|| "||"
array
[ "["
] "]"
assignment
identifier "conflicts_with_reasons"
= "="
binary
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "conflicts_with_reasons"
" "\""
] "]"
|| "||"
array
[ "["
] "]"
assignment (+61 nodes collapsed)
if (+69 nodes collapsed)
if (+69 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_dependency_hash"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_dependencies"
" "\""
] "]"
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_url_args"
" "\""
] "]"
= "="
begin
begin "begin"
assignment
identifier "url"
= "="
call (+21 nodes collapsed)
assignment (+62 nodes collapsed)
array
[ "["
identifier "url"
, ","
identifier "specs"
] "]"
end "end"
if (+69 nodes collapsed)
assignment (+25 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "link_overwrite_paths"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "link_overwrite"
" "\""
] "]"
if (+55 nodes collapsed)
if (+38 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "requirements_array"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "requirements"
" "\""
] "]"
assignment (+26 nodes collapsed)
if (+170 nodes collapsed)
assignment (+31 nodes collapsed)
assignment (+153 nodes collapsed)
assignment (+130 nodes collapsed)
assignment (+26 nodes collapsed)
comment "# Should match FormulaStruct::PREDICATES"
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+29 nodes collapsed)
call
constant "FormulaStruct"
. "."
identifier "from_hash"
argument_list
( "("
identifier "hash"
) ")"
end "end"
end "end"
end "end"
end "end"

After

program
comment "# typed: strict"
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "\""
string_content "cachable"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "api"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "api/source_download"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "download_queue"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "autobump_constants"
" "\""
module
module "module"
constant "Homebrew"
body_statement
module
module "module"
constant "API"
comment "# Helper functions for using the formula JSON API."
body_statement
module
module "module"
constant "Formula"
body_statement
call
identifier "extend"
argument_list
constant "Cachable"
assignment
constant "DEFAULT_API_FILENAME"
= "="
string
" "\""
string_content "formula.jws.json"
" "\""
call
identifier "private_class_method"
argument_list
simple_symbol ":cache"
call (+34 nodes collapsed)
singleton_method (+70 nodes collapsed)
call (+30 nodes collapsed)
singleton_method (+105 nodes collapsed)
call (+45 nodes collapsed)
singleton_method (+157 nodes collapsed)
call (+26 nodes collapsed)
singleton_method (+71 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "returns"
argument_list
( "("
constant "Pathname"
) ")"
} "}"
singleton_method
def "def"
self "self"
. "."
identifier "cached_json_file_path"
body_statement
binary
constant "HOMEBREW_CACHE_API"
/ "/"
constant "DEFAULT_API_FILENAME"
end "end"
call (+83 nodes collapsed)
singleton_method (+38 nodes collapsed)
call (+83 nodes collapsed)
singleton_method (+41 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "returns"
argument_list
( "("
scope_resolution
constant "T"
:: "::"
constant "Boolean"
) ")"
} "}"
singleton_method (+188 nodes collapsed)
call
identifier "private_class_method"
argument_list
simple_symbol ":download_and_cache_data!"
call (+24 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+47 nodes collapsed)
call (+24 nodes collapsed)
singleton_method (+51 nodes collapsed)
call (+21 nodes collapsed)
singleton_method (+72 nodes collapsed)
call (+34 nodes collapsed)
singleton_method
def "def"
self "self"
. "."
identifier "generate_formula_struct_hash"
method_parameters
( "("
identifier "hash"
) ")"
body_statement
assignment
identifier "hash"
= "="
call
call
scope_resolution
constant "Homebrew"
:: "::"
constant "API"
. "."
identifier "merge_variations"
argument_list
( "("
identifier "hash"
) ")"
. "."
identifier "dup"
if (+36 nodes collapsed)
assignment (+99 nodes collapsed)
assignment (+31 nodes collapsed)
assignment
identifier "conflicts_with"
= "="
binary
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "conflicts_with"
" "\""
] "]"
|| "||"
array
[ "["
] "]"
assignment
identifier "conflicts_with_reasons"
= "="
binary
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "conflicts_with_reasons"
" "\""
] "]"
|| "||"
array
[ "["
] "]"
assignment (+61 nodes collapsed)
if (+69 nodes collapsed)
if (+69 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_dependency_hash"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_dependencies"
" "\""
] "]"
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "head_url_args"
" "\""
] "]"
= "="
begin
begin "begin"
comment "# Fall back to \"\" to satisfy the type checker. If the head U"...
assignment
identifier "url"
= "="
binary
call (+21 nodes collapsed)
|| "||"
string
" "\""
" "\""
assignment (+62 nodes collapsed)
array
[ "["
identifier "url"
, ","
identifier "specs"
] "]"
end "end"
if (+69 nodes collapsed)
assignment (+25 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "link_overwrite_paths"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "link_overwrite"
" "\""
] "]"
if (+55 nodes collapsed)
if (+38 nodes collapsed)
assignment
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "requirements_array"
" "\""
] "]"
= "="
element_reference
identifier "hash"
[ "["
string
" "\""
string_content "requirements"
" "\""
] "]"
assignment (+26 nodes collapsed)
if (+170 nodes collapsed)
assignment (+31 nodes collapsed)
assignment (+153 nodes collapsed)
assignment (+130 nodes collapsed)
assignment (+26 nodes collapsed)
comment "# Should match FormulaStruct::PREDICATES"
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+21 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+29 nodes collapsed)
assignment (+29 nodes collapsed)
call
constant "FormulaStruct"
. "."
identifier "from_hash"
argument_list
( "("
identifier "hash"
) ")"
end "end"
end "end"
end "end"
end "end"