diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index b75d5e63de..975f8a7dfd 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -27,7 +27,6 @@ require "hbc/cli/zap" require "hbc/cli/abstract_internal_command" require "hbc/cli/internal_audit_modified_casks" -require "hbc/cli/internal_appcast_checkpoint" require "hbc/cli/internal_dump" require "hbc/cli/internal_help" require "hbc/cli/internal_stanza" diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb deleted file mode 100644 index a88d1fc170..0000000000 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_appcast_checkpoint.rb +++ /dev/null @@ -1,54 +0,0 @@ -module Hbc - class CLI - class InternalAppcastCheckpoint < AbstractInternalCommand - option "--calculate", :calculate, false - - def initialize(*) - super - raise CaskUnspecifiedError if args.empty? - end - - def run - if args.all? { |t| t =~ %r{^https?://} && t !~ /\.rb$/ } - self.class.appcask_checkpoint_for_url(args) - else - self.class.appcask_checkpoint(casks, calculate?) - end - end - - def self.appcask_checkpoint_for_url(urls) - urls.each do |url| - appcast = DSL::Appcast.new(url) - puts appcast.calculate_checkpoint[:checkpoint] - end - end - - def self.appcask_checkpoint(casks, calculate) - casks.each do |cask| - if cask.appcast.nil? - opoo "Cask '#{cask}' is missing an `appcast` stanza." - else - checkpoint = if calculate - result = cask.appcast.calculate_checkpoint - result[:checkpoint] - else - cask.appcast.checkpoint - end - - if calculate && checkpoint.nil? - onoe "Could not retrieve `appcast` checkpoint for cask '#{cask}': #{result[:command_result].stderr}" - elsif casks.count > 1 - puts "#{checkpoint} #{cask}" - else - puts checkpoint - end - end - end - end - - def self.help - "prints or calculates a given Cask's or URL's appcast checkpoint" - end - end - end -end