begin
begin "begin"
call
identifier "oh1"
argument_list
heredoc_beginning "<<~EOS"
heredoc_body
heredoc_content "\n Upgrading "
interpolation
#{ "#{"
call
constant "Formatter"
. "."
identifier "identifier"
argument_list
( "("
identifier "old_cask"
) ")"
} "}"
heredoc_content "\n "
interpolation
#{ "#{"
call
identifier "old_cask"
. "."
identifier "version"
} "}"
heredoc_content " -> "
interpolation
#{ "#{"
call
identifier "new_cask"
. "."
identifier "version"
} "}"
heredoc_content "\n "
heredoc_end "EOS"
comment "# Start new cask's installation steps"
call
identifier "new_cask_installer"
. "."
identifier "check_conflicts"
if
if "if"
parenthesized_statements
( "("
assignment
identifier "caveats"
= "="
call
identifier "new_cask_installer"
. "."
identifier "caveats"
) ")"
then
call
identifier "puts"
argument_list
identifier "caveats"
end "end"
call
identifier "new_cask_installer"
. "."
identifier "fetch"
comment "# Move the old cask's artifacts back to staging"
call
identifier "old_cask_installer"
. "."
identifier "start_upgrade"
argument_list
( "("
pair
hash_key_symbol "successor"
: ":"
identifier "new_cask"
) ")"
comment "# And flag it so in case of error"
assignment
identifier "started_upgrade"
= "="
true "true"
comment "# Install the new cask"
call
identifier "new_cask_installer"
. "."
identifier "stage"
call
identifier "new_cask_installer"
. "."
identifier "install_artifacts"
argument_list
( "("
pair
hash_key_symbol "predecessor"
: ":"
identifier "old_cask"
) ")"
assignment
identifier "new_artifacts_installed"
= "="
true "true"
comment "# If successful, wipe the old cask from staging."
call
identifier "old_cask_installer"
. "."
identifier "finalize_upgrade"
rescue (+42 nodes collapsed)
end "end"