This mapping has 2 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

Before

…lines 1–9 unchanged (9 lines)
10 module DevCmd
11 class Bump < AbstractCommand
12 NEWER_THAN_UPSTREAM_MSG = " (newer than upstream)"
13
14 class VersionBumpInfo < T::Struct
15 const :type, Symbol
16 const :multiple_versions, T::Boolean
17 const :version_name, String
18 const :current_version, BumpVersionParser
19 const :repology_latest, T.any(String, Version)
20 const :new_version, BumpVersionParser
21 const :newer_than_upstream, T::Hash[Symbol, T::Boolean], default: {}
22 const :duplicate_pull_requests, T.nilable(T.any(T::Array[String], String))
…lines 23–315 unchanged (293 lines)
316 is_cask_with_blocks = formula_or_cask.is_a?(Cask::Cask) && formula_or_cask.on_system_blocks_exist?
317 type, version_name = if formula_or_cask.is_a?(Formula)
318 [:formula, "formula version:"]
319 else
320 [:cask, "cask version: "]
321 end
322
323 old_versions = {}
324 new_versions = {}
325
326 repology_latest = repositories.present? ? Repology.latest_version(repositories) : "not found"
327 repology_latest_is_a_version = repology_latest.is_a?(Version)
328
…lines 329–337 unchanged (9 lines)
338 loaded_formula_or_cask = formula_or_cask
339 current_version_value = T.must(loaded_formula_or_cask.stable).version
340 else
341 loaded_formula_or_cask = Cask::CaskLoader.load(formula_or_cask.sourcefile_path)
342 current_version_value = Version.new(loaded_formula_or_cask.version)
343 end
344 formula_or_cask_has_livecheck = loaded_formula_or_cask.livecheck_defined?
345
346 livecheck_latest = livecheck_result(loaded_formula_or_cask)
347 livecheck_latest_is_a_version = livecheck_latest.is_a?(Version)
348
349 new_version_value = if (livecheck_latest_is_a_version &&
350 Livecheck::LivecheckVersion.create(formula_or_cask, livecheck_latest) >=
…lines 351–379 unchanged (29 lines)
380 if new_versions[:arm].present? && new_versions[:arm] == new_versions[:intel]
381 new_versions = { general: new_versions[:arm] }
382 end
383
384 multiple_versions = old_versions.values_at(:arm, :intel).all?(&:present?) ||
385 new_versions.values_at(:arm, :intel).all?(&:present?)
386
387 current_version = BumpVersionParser.new(general: old_versions[:general],
388 arm: old_versions[:arm],
389 intel: old_versions[:intel])
390
391 begin
392 new_version = BumpVersionParser.new(general: new_versions[:general],
…lines 393–431 unchanged (39 lines)
432 retrieve_pull_requests(formula_or_cask, name)
433 end
434 end
435
436 VersionBumpInfo.new(
437 type:,
438 multiple_versions:,
439 version_name:,
440 current_version:,
441 repology_latest:,
442 new_version:,
443 newer_than_upstream:,
444 duplicate_pull_requests:,
…lines 445–454 unchanged (10 lines)
455 ).void
456 }
457 def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, ambiguous_cask: false)
458 version_info = retrieve_versions_by_arch(formula_or_cask:,
459 repositories:,
460 name:)
461
462 current_version = version_info.current_version
463 new_version = version_info.new_version
464 repology_latest = version_info.repology_latest
465
466 versions_equal = (new_version == current_version)
467 all_newer_than_upstream = version_info.newer_than_upstream.all? { |_k, v| v == true }
…lines 468–472 unchanged (5 lines)
473 title_name
474 end
475
476 # Conditionally format output based on type of formula_or_cask
477 current_versions = if version_info.multiple_versions
478 "arm: #{current_version.arm || current_version.general}" \
479 "#{NEWER_THAN_UPSTREAM_MSG if version_info.newer_than_upstream[:arm]}" \
480 "\n " \
481 "intel: #{current_version.intel || current_version.general}" \
482 "#{NEWER_THAN_UPSTREAM_MSG if version_info.newer_than_upstream[:intel]}"
483 else
484 newer_than_upstream_general = version_info.newer_than_upstream[:general]
485 "#{current_version.general}#{NEWER_THAN_UPSTREAM_MSG if newer_than_upstream_general}"
486 end
487 current_versions << " (deprecated)" if formula_or_cask.deprecated?
488
489 new_versions = if version_info.multiple_versions && new_version.arm && new_version.intel
490 "arm: #{new_version.arm}
491 intel: #{new_version.intel}"
492 else
493 new_version.general
…lines 494–624 unchanged (131 lines)

After

…lines 1–9 unchanged (9 lines)
10 module DevCmd
11 class Bump < AbstractCommand
12 NEWER_THAN_UPSTREAM_MSG = " (newer than upstream)"
13
14 class VersionBumpInfo < T::Struct
15 const :type, Symbol
16 const :deprecated, T::Hash[Symbol, T::Boolean], default: {}
17 const :multiple_versions, T::Boolean
18 const :version_name, String
19 const :current_version, BumpVersionParser
20 const :repology_latest, T.any(String, Version)
21 const :new_version, BumpVersionParser
22 const :newer_than_upstream, T::Hash[Symbol, T::Boolean], default: {}
…lines 23–317 unchanged (295 lines)
318 type, version_name = if formula_or_cask.is_a?(Formula)
319 [:formula, "formula version:"]
320 else
321 [:cask, "cask version: "]
322 end
323
324 deprecated = {}
325 old_versions = {}
326 new_versions = {}
327
328 repology_latest = repositories.present? ? Repology.latest_version(repositories) : "not found"
329 repology_latest_is_a_version = repology_latest.is_a?(Version)
330
…lines 331–340 unchanged (10 lines)
341 current_version_value = T.must(loaded_formula_or_cask.stable).version
342 else
343 loaded_formula_or_cask = Cask::CaskLoader.load(formula_or_cask.sourcefile_path)
344 current_version_value = Version.new(loaded_formula_or_cask.version)
345 end
346
347 deprecated[version_key] = loaded_formula_or_cask.deprecated?
348 formula_or_cask_has_livecheck = loaded_formula_or_cask.livecheck_defined?
349
350 livecheck_latest = livecheck_result(loaded_formula_or_cask)
351 livecheck_latest_is_a_version = livecheck_latest.is_a?(Version)
352
353 new_version_value = if (livecheck_latest_is_a_version &&
…lines 354–383 unchanged (30 lines)
384 if new_versions[:arm].present? && new_versions[:arm] == new_versions[:intel]
385 new_versions = { general: new_versions[:arm] }
386 end
387
388 multiple_versions = old_versions.values_at(:arm, :intel).all?(&:present?) ||
389 new_versions.values_at(:arm, :intel).all?(&:present?)
390 deprecated[:general] ||= deprecated[:arm] || deprecated[:intel] || false unless multiple_versions
391
392 current_version = BumpVersionParser.new(general: old_versions[:general],
393 arm: old_versions[:arm],
394 intel: old_versions[:intel])
395
396 begin
…lines 397–436 unchanged (40 lines)
437 retrieve_pull_requests(formula_or_cask, name)
438 end
439 end
440
441 VersionBumpInfo.new(
442 type:,
443 deprecated:,
444 multiple_versions:,
445 version_name:,
446 current_version:,
447 repology_latest:,
448 new_version:,
449 newer_than_upstream:,
…lines 450–461 unchanged (12 lines)
462 }
463 def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, ambiguous_cask: false)
464 version_info = retrieve_versions_by_arch(formula_or_cask:,
465 repositories:,
466 name:)
467
468 deprecated = version_info.deprecated
469 current_version = version_info.current_version
470 new_version = version_info.new_version
471 repology_latest = version_info.repology_latest
472
473 versions_equal = (new_version == current_version)
474 all_newer_than_upstream = version_info.newer_than_upstream.all? { |_k, v| v == true }
…lines 475–480 unchanged (6 lines)
481 end
482
483 # Conditionally format output based on type of formula_or_cask
484 current_versions = if version_info.multiple_versions
485 "arm: #{current_version.arm || current_version.general}" \
486 "#{NEWER_THAN_UPSTREAM_MSG if version_info.newer_than_upstream[:arm]}" \
487 "#{" (deprecated)" if deprecated[:arm]}" \
488 "\n " \
489 "intel: #{current_version.intel || current_version.general}" \
490 "#{NEWER_THAN_UPSTREAM_MSG if version_info.newer_than_upstream[:intel]}" \
491 "#{" (deprecated)" if deprecated[:intel]}"
492 else
493 newer_than_upstream_general = version_info.newer_than_upstream[:general]
494 "#{current_version.general}" \
495 "#{NEWER_THAN_UPSTREAM_MSG if newer_than_upstream_general}" \
496 "#{" (deprecated)" if deprecated[:general]}"
497 end
498
499 new_versions = if version_info.multiple_versions && new_version.arm && new_version.intel
500 "arm: #{new_version.arm}
501 intel: #{new_version.intel}"
502 else
503 new_version.general
504 end
…lines 505–634 unchanged (130 lines)

Before

program
comment "# typed: strict"
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "\""
string_content "abstract_command"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "bump_version_parser"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "livecheck/livecheck"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "utils/repology"
" "\""
module
module "module"
constant "Homebrew"
body_statement
module
module "module"
constant "DevCmd"
body_statement
class
class "class"
constant "Bump"
superclass
< "<"
constant "AbstractCommand"
body_statement
assignment
constant "NEWER_THAN_UPSTREAM_MSG"
= "="
string
" "\""
string_content " (newer than upstream)"
" "\""
class
class "class"
constant "VersionBumpInfo"
superclass
< "<"
scope_resolution
constant "T"
:: "::"
constant "Struct"
body_statement
call
identifier "const"
argument_list
simple_symbol ":type"
, ","
constant "Symbol"
call
identifier "const"
argument_list
simple_symbol ":multiple_versions"
, ","
scope_resolution
constant "T"
:: "::"
constant "Boolean"
call
identifier "const"
argument_list
simple_symbol ":version_name"
, ","
constant "String"
call
identifier "const"
argument_list
simple_symbol ":current_version"
, ","
constant "BumpVersionParser"
call
identifier "const"
argument_list
simple_symbol ":repology_latest"
, ","
call
constant "T"
. "."
identifier "any"
argument_list
( "("
constant "String"
, ","
constant "Version"
) ")"
call
identifier "const"
argument_list
simple_symbol ":new_version"
, ","
constant "BumpVersionParser"
call (+25 nodes collapsed)
call (+29 nodes collapsed)
call (+29 nodes collapsed)
end "end"
call (+329 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "override"
. "."
identifier "void"
} "}"
method (+742 nodes collapsed)
identifier "private"
call (+37 nodes collapsed)
method (+64 nodes collapsed)
call (+37 nodes collapsed)
method (+328 nodes collapsed)
call (+37 nodes collapsed)
method (+156 nodes collapsed)
call (+43 nodes collapsed)
method (+280 nodes collapsed)
call (+73 nodes collapsed)
method (+157 nodes collapsed)
call (+52 nodes collapsed)
method
def "def"
identifier "retrieve_versions_by_arch"
method_parameters
( "("
keyword_parameter
identifier "formula_or_cask"
: ":"
, ","
keyword_parameter
identifier "repositories"
: ":"
, ","
keyword_parameter
identifier "name"
: ":"
) ")"
body_statement
assignment
identifier "is_cask_with_blocks"
= "="
binary
call
identifier "formula_or_cask"
. "."
identifier "is_a?"
argument_list
( "("
scope_resolution
constant "Cask"
:: "::"
constant "Cask"
) ")"
&& "&&"
call
identifier "formula_or_cask"
. "."
identifier "on_system_blocks_exist?"
assignment (+38 nodes collapsed)
assignment
identifier "old_versions"
= "="
hash
{ "{"
} "}"
assignment
identifier "new_versions"
= "="
hash
{ "{"
} "}"
assignment (+22 nodes collapsed)
assignment
identifier "repology_latest_is_a_version"
= "="
call
identifier "repology_latest"
. "."
identifier "is_a?"
argument_list
( "("
constant "Version"
) ")"
comment "# When blocks are absent, arch is not relevant. For consiste"...
assignment
identifier "arch_options"
= "="
conditional
identifier "is_cask_with_blocks"
? "?"
scope_resolution
constant "OnSystem"
:: "::"
constant "ARCH_OPTIONS"
: ":"
array
[ "["
simple_symbol ":arm"
] "]"
call
identifier "arch_options"
. "."
identifier "each"
do_block
do "do"
block_parameters
| "|"
identifier "arch"
| "|"
body_statement
call
constant "SimulateSystem"
. "."
identifier "with"
argument_list
( "("
pair
hash_key_symbol "arch"
: ":"
) ")"
do_block
do "do"
body_statement
assignment
identifier "version_key"
= "="
conditional
identifier "is_cask_with_blocks"
? "?"
identifier "arch"
: ":"
simple_symbol ":general"
comment "# We reload the formula/cask here to ensure we're getting th"...
if (+66 nodes collapsed)
assignment
identifier "formula_or_cask_has_livecheck"
= "="
call
identifier "loaded_formula_or_cask"
. "."
identifier "livecheck_defined?"
assignment
identifier "livecheck_latest"
= "="
call
identifier "livecheck_result"
argument_list
( "("
identifier "loaded_formula_or_cask"
) ")"
assignment
identifier "livecheck_latest_is_a_version"
= "="
call
identifier "livecheck_latest"
. "."
identifier "is_a?"
argument_list
( "("
constant "Version"
) ")"
assignment (+107 nodes collapsed)
comment "# Fall back to the upstream version if there isn't a new ver"...
comment "# value at this point, as this will allow us to surface an u"...
comment "# version that's lower than the current version."
if_modifier
operator_assignment
identifier "new_version_value"
||= "||="
identifier "livecheck_latest"
if "if"
identifier "livecheck_latest_is_a_version"
if_modifier
operator_assignment
identifier "new_version_value"
||= "||="
identifier "repology_latest"
if "if"
binary
identifier "repology_latest_is_a_version"
&& "&&"
unary
! "!"
identifier "formula_or_cask_has_livecheck"
comment "# Store old and new versions"
assignment
element_reference
identifier "old_versions"
[ "["
identifier "version_key"
] "]"
= "="
identifier "current_version_value"
assignment
element_reference
identifier "new_versions"
[ "["
identifier "version_key"
] "]"
= "="
identifier "new_version_value"
end "end"
end "end"
comment "# If arm and intel versions are identical, as it happens wit"...
comment "# we consolidate them into a single version."
if (+40 nodes collapsed)
if (+40 nodes collapsed)
assignment (+43 nodes collapsed)
assignment (+36 nodes collapsed)
begin (+61 nodes collapsed)
assignment
identifier "newer_than_upstream"
= "="
hash
{ "{"
} "}"
call (+99 nodes collapsed)
if (+133 nodes collapsed)
call
constant "VersionBumpInfo"
. "."
identifier "new"
argument_list
( "("
pair
hash_key_symbol "type"
: ":"
, ","
pair
hash_key_symbol "multiple_versions"
: ":"
, ","
pair
hash_key_symbol "version_name"
: ":"
, ","
pair
hash_key_symbol "current_version"
: ":"
, ","
pair
hash_key_symbol "repology_latest"
: ":"
, ","
pair
hash_key_symbol "new_version"
: ":"
, ","
pair
hash_key_symbol "newer_than_upstream"
: ":"
, ","
pair
hash_key_symbol "duplicate_pull_requests"
: ":"
, ","
pair
hash_key_symbol "maybe_duplicate_pull_requests"
: ":"
, ","
) ")"
end "end"
call (+56 nodes collapsed)
method
def "def"
identifier "retrieve_and_display_info_and_open_pr"
method_parameters
( "("
identifier "formula_or_cask"
, ","
identifier "name"
, ","
identifier "repositories"
, ","
keyword_parameter
identifier "ambiguous_cask"
: ":"
false "false"
) ")"
body_statement
assignment
identifier "version_info"
= "="
call
identifier "retrieve_versions_by_arch"
argument_list
( "("
pair
hash_key_symbol "formula_or_cask"
: ":"
, ","
pair
hash_key_symbol "repositories"
: ":"
, ","
pair
hash_key_symbol "name"
: ":"
) ")"
assignment
identifier "current_version"
= "="
call
identifier "version_info"
. "."
identifier "current_version"
assignment
identifier "new_version"
= "="
call
identifier "version_info"
. "."
identifier "new_version"
assignment
identifier "repology_latest"
= "="
call
identifier "version_info"
. "."
identifier "repology_latest"
assignment
identifier "versions_equal"
= "="
parenthesized_statements
( "("
binary
identifier "new_version"
== "=="
identifier "current_version"
) ")"
assignment (+24 nodes collapsed)
assignment
identifier "title_name"
= "="
conditional
identifier "ambiguous_cask"
? "?"
string
" "\""
interpolation
#{ "#{"
identifier "name"
} "}"
string_content " (cask)"
" "\""
: ":"
identifier "name"
assignment (+58 nodes collapsed)
comment "# Conditionally format output based on type of formula_or_ca"...
assignment
identifier "current_versions"
= "="
if
if "if"
call
identifier "version_info"
. "."
identifier "multiple_versions"
then
chained_string
string
" "\""
string_content "arm: "
interpolation
#{ "#{"
binary
call
identifier "current_version"
. "."
identifier "arm"
|| "||"
call
identifier "current_version"
. "."
identifier "general"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":arm"
] "]"
} "}"
" "\""
string
" "\""
escape_sequence "\\n"
string_content " "
" "\""
string
" "\""
string_content "intel: "
interpolation
#{ "#{"
binary
call
identifier "current_version"
. "."
identifier "intel"
|| "||"
call
identifier "current_version"
. "."
identifier "general"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":intel"
] "]"
} "}"
" "\""
else
else "else"
assignment
identifier "newer_than_upstream_general"
= "="
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":general"
] "]"
string any 1:2
" "\"" any 2:4
interpolation
#{ "#{"
call
identifier "current_version"
. "."
identifier "general"
} "}"
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
identifier "newer_than_upstream_general"
} "}"
" "\"" any 2:4
end "end"
if_modifier
binary
identifier "current_versions"
<< "<<"
string
" "\""
string_content " (deprecated)"
" "\""
if "if"
call
identifier "formula_or_cask"
. "."
identifier "deprecated?"
assignment (+48 nodes collapsed)
assignment
identifier "version_label"
= "="
call
identifier "version_info"
. "."
identifier "version_name"
assignment
identifier "duplicate_pull_requests"
= "="
call
identifier "version_info"
. "."
identifier "duplicate_pull_requests"
assignment
identifier "maybe_duplicate_pull_requests"
= "="
call
identifier "version_info"
. "."
identifier "maybe_duplicate_pull_requests"
call
identifier "ohai"
argument_list
identifier "title"
call
identifier "puts"
argument_list
heredoc_beginning "<<~EOS"
heredoc_body (+34 nodes collapsed)
unless_modifier
call
identifier "puts"
argument_list
heredoc_beginning "<<~EOS"
unless "unless"
call
identifier "skip_repology?"
argument_list
( "("
identifier "formula_or_cask"
) ")"
heredoc_body
heredoc_content "\n Latest Repology version: "
interpolation
#{ "#{"
identifier "repology_latest"
} "}"
heredoc_content "\n "
heredoc_end "EOS"
if (+75 nodes collapsed)
if (+117 nodes collapsed)
if (+45 nodes collapsed)
if (+22 nodes collapsed)
if (+47 nodes collapsed)
if (+39 nodes collapsed)
if_modifier
return
return "return"
if "if"
call
identifier "duplicate_pull_requests"
. "."
identifier "present?"
assignment (+45 nodes collapsed)
assignment (+35 nodes collapsed)
if_modifier
binary
identifier "bump_pr_args"
<< "<<"
string
" "\""
string_content "--no-fork"
" "\""
if "if"
call
identifier "args"
. "."
identifier "no_fork?"
if (+35 nodes collapsed)
assignment
identifier "result"
= "="
call
identifier "system"
argument_list
constant "HOMEBREW_BREW_FILE"
, ","
splat_argument
* "*"
identifier "bump_pr_args"
unless_modifier
assignment
call
constant "Homebrew"
. "."
identifier "failed"
= "="
true "true"
unless "unless"
identifier "result"
end "end"
call (+57 nodes collapsed)
method (+101 nodes collapsed)
call (+49 nodes collapsed)
method (+77 nodes collapsed)
end "end"
end "end"
end "end"

After

program
comment "# typed: strict"
comment "# frozen_string_literal: true"
call
identifier "require"
argument_list
string
" "\""
string_content "abstract_command"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "bump_version_parser"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "livecheck/livecheck"
" "\""
call
identifier "require"
argument_list
string
" "\""
string_content "utils/repology"
" "\""
module
module "module"
constant "Homebrew"
body_statement
module
module "module"
constant "DevCmd"
body_statement
class
class "class"
constant "Bump"
superclass
< "<"
constant "AbstractCommand"
body_statement
assignment
constant "NEWER_THAN_UPSTREAM_MSG"
= "="
string
" "\""
string_content " (newer than upstream)"
" "\""
class
class "class"
constant "VersionBumpInfo"
superclass
< "<"
scope_resolution
constant "T"
:: "::"
constant "Struct"
body_statement
call
identifier "const"
argument_list
simple_symbol ":type"
, ","
constant "Symbol"
call
identifier "const"
argument_list
simple_symbol ":deprecated"
, ","
element_reference
scope_resolution
constant "T"
:: "::"
constant "Hash"
[ "["
constant "Symbol"
, ","
scope_resolution
constant "T"
:: "::"
constant "Boolean"
] "]"
, ","
pair
hash_key_symbol "default"
: ":"
hash
{ "{"
} "}"
call
identifier "const"
argument_list
simple_symbol ":multiple_versions"
, ","
scope_resolution
constant "T"
:: "::"
constant "Boolean"
call
identifier "const"
argument_list
simple_symbol ":version_name"
, ","
constant "String"
call
identifier "const"
argument_list
simple_symbol ":current_version"
, ","
constant "BumpVersionParser"
call
identifier "const"
argument_list
simple_symbol ":repology_latest"
, ","
call
constant "T"
. "."
identifier "any"
argument_list
( "("
constant "String"
, ","
constant "Version"
) ")"
call
identifier "const"
argument_list
simple_symbol ":new_version"
, ","
constant "BumpVersionParser"
call (+25 nodes collapsed)
call (+29 nodes collapsed)
call (+29 nodes collapsed)
end "end"
call (+329 nodes collapsed)
call
identifier "sig"
block
{ "{"
block_body
call
identifier "override"
. "."
identifier "void"
} "}"
method (+742 nodes collapsed)
identifier "private"
call (+37 nodes collapsed)
method (+64 nodes collapsed)
call (+37 nodes collapsed)
method (+328 nodes collapsed)
call (+37 nodes collapsed)
method (+156 nodes collapsed)
call (+43 nodes collapsed)
method (+280 nodes collapsed)
call (+73 nodes collapsed)
method (+157 nodes collapsed)
call (+52 nodes collapsed)
method
def "def"
identifier "retrieve_versions_by_arch"
method_parameters
( "("
keyword_parameter
identifier "formula_or_cask"
: ":"
, ","
keyword_parameter
identifier "repositories"
: ":"
, ","
keyword_parameter
identifier "name"
: ":"
) ")"
body_statement
assignment
identifier "is_cask_with_blocks"
= "="
binary
call
identifier "formula_or_cask"
. "."
identifier "is_a?"
argument_list
( "("
scope_resolution
constant "Cask"
:: "::"
constant "Cask"
) ")"
&& "&&"
call
identifier "formula_or_cask"
. "."
identifier "on_system_blocks_exist?"
assignment (+38 nodes collapsed)
assignment
identifier "deprecated"
= "="
hash
{ "{"
} "}"
assignment
identifier "old_versions"
= "="
hash
{ "{"
} "}"
assignment
identifier "new_versions"
= "="
hash
{ "{"
} "}"
assignment (+22 nodes collapsed)
assignment
identifier "repology_latest_is_a_version"
= "="
call
identifier "repology_latest"
. "."
identifier "is_a?"
argument_list
( "("
constant "Version"
) ")"
comment "# When blocks are absent, arch is not relevant. For consiste"...
assignment
identifier "arch_options"
= "="
conditional
identifier "is_cask_with_blocks"
? "?"
scope_resolution
constant "OnSystem"
:: "::"
constant "ARCH_OPTIONS"
: ":"
array
[ "["
simple_symbol ":arm"
] "]"
call
identifier "arch_options"
. "."
identifier "each"
do_block
do "do"
block_parameters
| "|"
identifier "arch"
| "|"
body_statement
call
constant "SimulateSystem"
. "."
identifier "with"
argument_list
( "("
pair
hash_key_symbol "arch"
: ":"
) ")"
do_block
do "do"
body_statement
assignment
identifier "version_key"
= "="
conditional
identifier "is_cask_with_blocks"
? "?"
identifier "arch"
: ":"
simple_symbol ":general"
comment "# We reload the formula/cask here to ensure we're getting th"...
if (+66 nodes collapsed)
assignment
element_reference
identifier "deprecated"
[ "["
identifier "version_key"
] "]"
= "="
call
identifier "loaded_formula_or_cask"
. "."
identifier "deprecated?"
assignment
identifier "formula_or_cask_has_livecheck"
= "="
call
identifier "loaded_formula_or_cask"
. "."
identifier "livecheck_defined?"
assignment
identifier "livecheck_latest"
= "="
call
identifier "livecheck_result"
argument_list
( "("
identifier "loaded_formula_or_cask"
) ")"
assignment
identifier "livecheck_latest_is_a_version"
= "="
call
identifier "livecheck_latest"
. "."
identifier "is_a?"
argument_list
( "("
constant "Version"
) ")"
assignment (+107 nodes collapsed)
comment "# Fall back to the upstream version if there isn't a new ver"...
comment "# value at this point, as this will allow us to surface an u"...
comment "# version that's lower than the current version."
if_modifier
operator_assignment
identifier "new_version_value"
||= "||="
identifier "livecheck_latest"
if "if"
identifier "livecheck_latest_is_a_version"
if_modifier
operator_assignment
identifier "new_version_value"
||= "||="
identifier "repology_latest"
if "if"
binary
identifier "repology_latest_is_a_version"
&& "&&"
unary
! "!"
identifier "formula_or_cask_has_livecheck"
comment "# Store old and new versions"
assignment
element_reference
identifier "old_versions"
[ "["
identifier "version_key"
] "]"
= "="
identifier "current_version_value"
assignment
element_reference
identifier "new_versions"
[ "["
identifier "version_key"
] "]"
= "="
identifier "new_version_value"
end "end"
end "end"
comment "# If arm and intel versions are identical, as it happens wit"...
comment "# we consolidate them into a single version."
if (+40 nodes collapsed)
if (+40 nodes collapsed)
assignment (+43 nodes collapsed)
unless_modifier
operator_assignment
element_reference
identifier "deprecated"
[ "["
simple_symbol ":general"
] "]"
||= "||="
binary
binary
element_reference
identifier "deprecated"
[ "["
simple_symbol ":arm"
] "]"
|| "||"
element_reference
identifier "deprecated"
[ "["
simple_symbol ":intel"
] "]"
|| "||"
false "false"
unless "unless"
identifier "multiple_versions"
assignment (+36 nodes collapsed)
begin (+61 nodes collapsed)
assignment
identifier "newer_than_upstream"
= "="
hash
{ "{"
} "}"
call (+99 nodes collapsed)
if (+133 nodes collapsed)
call
constant "VersionBumpInfo"
. "."
identifier "new"
argument_list
( "("
pair
hash_key_symbol "type"
: ":"
, ","
pair
hash_key_symbol "deprecated"
: ":"
, ","
pair
hash_key_symbol "multiple_versions"
: ":"
, ","
pair
hash_key_symbol "version_name"
: ":"
, ","
pair
hash_key_symbol "current_version"
: ":"
, ","
pair
hash_key_symbol "repology_latest"
: ":"
, ","
pair
hash_key_symbol "new_version"
: ":"
, ","
pair
hash_key_symbol "newer_than_upstream"
: ":"
, ","
pair
hash_key_symbol "duplicate_pull_requests"
: ":"
, ","
pair
hash_key_symbol "maybe_duplicate_pull_requests"
: ":"
, ","
) ")"
end "end"
call (+56 nodes collapsed)
method
def "def"
identifier "retrieve_and_display_info_and_open_pr"
method_parameters
( "("
identifier "formula_or_cask"
, ","
identifier "name"
, ","
identifier "repositories"
, ","
keyword_parameter
identifier "ambiguous_cask"
: ":"
false "false"
) ")"
body_statement
assignment
identifier "version_info"
= "="
call
identifier "retrieve_versions_by_arch"
argument_list
( "("
pair
hash_key_symbol "formula_or_cask"
: ":"
, ","
pair
hash_key_symbol "repositories"
: ":"
, ","
pair
hash_key_symbol "name"
: ":"
) ")"
assignment
identifier "deprecated"
= "="
call
identifier "version_info"
. "."
identifier "deprecated"
assignment
identifier "current_version"
= "="
call
identifier "version_info"
. "."
identifier "current_version"
assignment
identifier "new_version"
= "="
call
identifier "version_info"
. "."
identifier "new_version"
assignment
identifier "repology_latest"
= "="
call
identifier "version_info"
. "."
identifier "repology_latest"
assignment
identifier "versions_equal"
= "="
parenthesized_statements
( "("
binary
identifier "new_version"
== "=="
identifier "current_version"
) ")"
assignment (+24 nodes collapsed)
assignment
identifier "title_name"
= "="
conditional
identifier "ambiguous_cask"
? "?"
string
" "\""
interpolation
#{ "#{"
identifier "name"
} "}"
string_content " (cask)"
" "\""
: ":"
identifier "name"
assignment (+58 nodes collapsed)
comment "# Conditionally format output based on type of formula_or_ca"...
assignment
identifier "current_versions"
= "="
if
if "if"
call
identifier "version_info"
. "."
identifier "multiple_versions"
then
chained_string
string
" "\""
string_content "arm: "
interpolation
#{ "#{"
binary
call
identifier "current_version"
. "."
identifier "arm"
|| "||"
call
identifier "current_version"
. "."
identifier "general"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":arm"
] "]"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
string
" "\""
string_content " (deprecated)"
" "\""
if "if"
element_reference
identifier "deprecated"
[ "["
simple_symbol ":arm"
] "]"
} "}"
" "\""
string
" "\""
escape_sequence "\\n"
string_content " "
" "\""
string
" "\""
string_content "intel: "
interpolation
#{ "#{"
binary
call
identifier "current_version"
. "."
identifier "intel"
|| "||"
call
identifier "current_version"
. "."
identifier "general"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":intel"
] "]"
} "}"
" "\""
string
" "\""
interpolation
#{ "#{"
if_modifier
string
" "\""
string_content " (deprecated)"
" "\""
if "if"
element_reference
identifier "deprecated"
[ "["
simple_symbol ":intel"
] "]"
} "}"
" "\""
else
else "else"
assignment
identifier "newer_than_upstream_general"
= "="
element_reference
call
identifier "version_info"
. "."
identifier "newer_than_upstream"
[ "["
simple_symbol ":general"
] "]"
chained_string
string any 1:2
" "\"" any 2:4
interpolation
#{ "#{"
call
identifier "current_version"
. "."
identifier "general"
} "}"
" "\"" any 2:4
string any 1:2
" "\"" any 2:4
interpolation
#{ "#{"
if_modifier
constant "NEWER_THAN_UPSTREAM_MSG"
if "if"
identifier "newer_than_upstream_general"
} "}"
" "\"" any 2:4
string
" "\""
interpolation
#{ "#{"
if_modifier
string
" "\""
string_content " (deprecated)"
" "\""
if "if"
element_reference
identifier "deprecated"
[ "["
simple_symbol ":general"
] "]"
} "}"
" "\""
end "end"
assignment (+48 nodes collapsed)
assignment
identifier "version_label"
= "="
call
identifier "version_info"
. "."
identifier "version_name"
assignment
identifier "duplicate_pull_requests"
= "="
call
identifier "version_info"
. "."
identifier "duplicate_pull_requests"
assignment
identifier "maybe_duplicate_pull_requests"
= "="
call
identifier "version_info"
. "."
identifier "maybe_duplicate_pull_requests"
call
identifier "ohai"
argument_list
identifier "title"
call
identifier "puts"
argument_list
heredoc_beginning "<<~EOS"
heredoc_body (+34 nodes collapsed)
unless_modifier
call
identifier "puts"
argument_list
heredoc_beginning "<<~EOS"
unless "unless"
call
identifier "skip_repology?"
argument_list
( "("
identifier "formula_or_cask"
) ")"
heredoc_body
heredoc_content "\n Latest Repology version: "
interpolation
#{ "#{"
identifier "repology_latest"
} "}"
heredoc_content "\n "
heredoc_end "EOS"
if (+75 nodes collapsed)
if (+117 nodes collapsed)
if (+45 nodes collapsed)
if (+22 nodes collapsed)
if (+47 nodes collapsed)
if (+39 nodes collapsed)
if_modifier
return
return "return"
if "if"
call
identifier "duplicate_pull_requests"
. "."
identifier "present?"
assignment (+45 nodes collapsed)
assignment (+35 nodes collapsed)
if_modifier
binary
identifier "bump_pr_args"
<< "<<"
string
" "\""
string_content "--no-fork"
" "\""
if "if"
call
identifier "args"
. "."
identifier "no_fork?"
if (+35 nodes collapsed)
assignment
identifier "result"
= "="
call
identifier "system"
argument_list
constant "HOMEBREW_BREW_FILE"
, ","
splat_argument
* "*"
identifier "bump_pr_args"
unless_modifier
assignment
call
constant "Homebrew"
. "."
identifier "failed"
= "="
true "true"
unless "unless"
identifier "result"
end "end"
call (+57 nodes collapsed)
method (+101 nodes collapsed)
call (+49 nodes collapsed)
method (+77 nodes collapsed)
end "end"
end "end"
end "end"