diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 8272d9e8a6..30de50eb5f 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -31,7 +31,7 @@ require "cask/cmd/internal_help" require "cask/cmd/internal_stanza" module Hbc - class CLI + class Cmd ALIASES = { "ls" => "list", "homepage" => "home", @@ -232,10 +232,10 @@ module Hbc end def usage - max_command_len = CLI.commands.map(&:length).max + max_command_len = Cmd.commands.map(&:length).max puts "Commands:\n\n" - CLI.command_classes.each do |klass| + Cmd.command_classes.each do |klass| next unless klass.visible puts " #{klass.command_name.ljust(max_command_len)} #{_help_for(klass)}" end diff --git a/Library/Homebrew/cask/cmd/--version.rb b/Library/Homebrew/cask/cmd/--version.rb index e903ae429f..75fff8d2a9 100644 --- a/Library/Homebrew/cask/cmd/--version.rb +++ b/Library/Homebrew/cask/cmd/--version.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Version < AbstractCommand def self.command_name "--#{super}" diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index 59e7de6f4e..60ada8e7eb 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -2,7 +2,7 @@ require_relative "options" require "search" module Hbc - class CLI + class Cmd class AbstractCommand include Options include Homebrew::Search diff --git a/Library/Homebrew/cask/cmd/abstract_internal_command.rb b/Library/Homebrew/cask/cmd/abstract_internal_command.rb index 8af71e5895..cc0032fc7d 100644 --- a/Library/Homebrew/cask/cmd/abstract_internal_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_internal_command.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class AbstractInternalCommand < AbstractCommand def self.command_name super.sub(/^internal_/i, "_") diff --git a/Library/Homebrew/cask/cmd/audit.rb b/Library/Homebrew/cask/cmd/audit.rb index 4f215826d2..0d8ce73783 100644 --- a/Library/Homebrew/cask/cmd/audit.rb +++ b/Library/Homebrew/cask/cmd/audit.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Audit < AbstractCommand option "--download", :download, false option "--token-conflicts", :token_conflicts, false diff --git a/Library/Homebrew/cask/cmd/cat.rb b/Library/Homebrew/cask/cmd/cat.rb index 0430805561..67d6dc280d 100644 --- a/Library/Homebrew/cask/cmd/cat.rb +++ b/Library/Homebrew/cask/cmd/cat.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Cat < AbstractCommand def initialize(*) super diff --git a/Library/Homebrew/cask/cmd/create.rb b/Library/Homebrew/cask/cmd/create.rb index 0f5034a54f..1de142edfc 100644 --- a/Library/Homebrew/cask/cmd/create.rb +++ b/Library/Homebrew/cask/cmd/create.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Create < AbstractCommand def initialize(*) super diff --git a/Library/Homebrew/cask/cmd/doctor.rb b/Library/Homebrew/cask/cmd/doctor.rb index e35a325667..8772712282 100644 --- a/Library/Homebrew/cask/cmd/doctor.rb +++ b/Library/Homebrew/cask/cmd/doctor.rb @@ -2,7 +2,7 @@ require "system_config" require "cask/checkable" module Hbc - class CLI + class Cmd class Doctor < AbstractCommand include Checkable diff --git a/Library/Homebrew/cask/cmd/edit.rb b/Library/Homebrew/cask/cmd/edit.rb index 693edcd515..0a22dadc69 100644 --- a/Library/Homebrew/cask/cmd/edit.rb +++ b/Library/Homebrew/cask/cmd/edit.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Edit < AbstractCommand def initialize(*) super diff --git a/Library/Homebrew/cask/cmd/fetch.rb b/Library/Homebrew/cask/cmd/fetch.rb index 5346d33dab..5131b6761b 100644 --- a/Library/Homebrew/cask/cmd/fetch.rb +++ b/Library/Homebrew/cask/cmd/fetch.rb @@ -1,7 +1,7 @@ require "cask/download" module Hbc - class CLI + class Cmd class Fetch < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/cmd/home.rb b/Library/Homebrew/cask/cmd/home.rb index d496e309ea..0d36b821ec 100644 --- a/Library/Homebrew/cask/cmd/home.rb +++ b/Library/Homebrew/cask/cmd/home.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Home < AbstractCommand def run if casks.none? diff --git a/Library/Homebrew/cask/cmd/info.rb b/Library/Homebrew/cask/cmd/info.rb index ecf30ff5dd..afef9da708 100644 --- a/Library/Homebrew/cask/cmd/info.rb +++ b/Library/Homebrew/cask/cmd/info.rb @@ -1,7 +1,7 @@ require "json" module Hbc - class CLI + class Cmd class Info < AbstractCommand option "--json=VERSION", :json diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb index f8a8929367..4a6c925ab6 100644 --- a/Library/Homebrew/cask/cmd/install.rb +++ b/Library/Homebrew/cask/cmd/install.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Install < AbstractCommand option "--force", :force, false option "--skip-cask-deps", :skip_cask_deps, false diff --git a/Library/Homebrew/cask/cmd/internal_help.rb b/Library/Homebrew/cask/cmd/internal_help.rb index beac77b293..ccde3f0d02 100644 --- a/Library/Homebrew/cask/cmd/internal_help.rb +++ b/Library/Homebrew/cask/cmd/internal_help.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class InternalHelp < AbstractInternalCommand def initialize(*) super @@ -8,9 +8,9 @@ module Hbc end def run - max_command_len = CLI.commands.map(&:length).max + max_command_len = Cmd.commands.map(&:length).max puts "Unstable Internal-use Commands:\n\n" - CLI.command_classes.each do |klass| + Cmd.command_classes.each do |klass| next if klass.visible puts " #{klass.command_name.ljust(max_command_len)} #{self.class.help_for(klass)}" end diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index 779f29b068..fbb321110b 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class InternalStanza < AbstractInternalCommand # Syntax # diff --git a/Library/Homebrew/cask/cmd/list.rb b/Library/Homebrew/cask/cmd/list.rb index 916860e7e2..ab09207392 100644 --- a/Library/Homebrew/cask/cmd/list.rb +++ b/Library/Homebrew/cask/cmd/list.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class List < AbstractCommand option "-1", :one, false option "--versions", :versions, false diff --git a/Library/Homebrew/cask/cmd/options.rb b/Library/Homebrew/cask/cmd/options.rb index 75dd772120..8ccd0a89eb 100644 --- a/Library/Homebrew/cask/cmd/options.rb +++ b/Library/Homebrew/cask/cmd/options.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd module Options def self.included(klass) klass.extend(ClassMethods) diff --git a/Library/Homebrew/cask/cmd/outdated.rb b/Library/Homebrew/cask/cmd/outdated.rb index 593fea19da..f61f4ade52 100644 --- a/Library/Homebrew/cask/cmd/outdated.rb +++ b/Library/Homebrew/cask/cmd/outdated.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Outdated < AbstractCommand option "--greedy", :greedy, false option "--quiet", :quiet, false diff --git a/Library/Homebrew/cask/cmd/reinstall.rb b/Library/Homebrew/cask/cmd/reinstall.rb index 95d419991c..f5c3af8850 100644 --- a/Library/Homebrew/cask/cmd/reinstall.rb +++ b/Library/Homebrew/cask/cmd/reinstall.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Reinstall < Install def run casks.each do |cask| diff --git a/Library/Homebrew/cask/cmd/style.rb b/Library/Homebrew/cask/cmd/style.rb index cb2e5e0537..2aea7e2a1a 100644 --- a/Library/Homebrew/cask/cmd/style.rb +++ b/Library/Homebrew/cask/cmd/style.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Style < AbstractCommand def self.help "checks Cask style using RuboCop" diff --git a/Library/Homebrew/cask/cmd/uninstall.rb b/Library/Homebrew/cask/cmd/uninstall.rb index c962632bca..4a06824ea0 100644 --- a/Library/Homebrew/cask/cmd/uninstall.rb +++ b/Library/Homebrew/cask/cmd/uninstall.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Uninstall < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 01ff0d36fc..7218a8d199 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Upgrade < AbstractCommand option "--greedy", :greedy, false option "--quiet", :quiet, false diff --git a/Library/Homebrew/cask/cmd/zap.rb b/Library/Homebrew/cask/cmd/zap.rb index 7148bdf10c..8ce8df0a1a 100644 --- a/Library/Homebrew/cask/cmd/zap.rb +++ b/Library/Homebrew/cask/cmd/zap.rb @@ -1,5 +1,5 @@ module Hbc - class CLI + class Cmd class Zap < AbstractCommand option "--force", :force, false diff --git a/Library/Homebrew/cmd/cask.rb b/Library/Homebrew/cmd/cask.rb index 9291241595..ac37399e2b 100644 --- a/Library/Homebrew/cmd/cask.rb +++ b/Library/Homebrew/cmd/cask.rb @@ -4,6 +4,6 @@ module Homebrew module_function def cask - Hbc::CLI.run(*ARGV) + Hbc::Cmd.run(*ARGV) end end diff --git a/Library/Homebrew/compat/cask/cmd/cleanup.rb b/Library/Homebrew/compat/cask/cmd/cleanup.rb index cc9ac24abd..878d9fe432 100644 --- a/Library/Homebrew/compat/cask/cmd/cleanup.rb +++ b/Library/Homebrew/compat/cask/cmd/cleanup.rb @@ -4,7 +4,7 @@ require "cleanup" using CleanupRefinement module Hbc - class CLI + class Cmd class Cleanup < AbstractCommand OUTDATED_DAYS = 10 OUTDATED_TIMESTAMP = Time.now - (60 * 60 * 24 * OUTDATED_DAYS) diff --git a/Library/Homebrew/compat/cask/cmd/search.rb b/Library/Homebrew/compat/cask/cmd/search.rb index 142b9e8922..fca45f77bf 100644 --- a/Library/Homebrew/compat/cask/cmd/search.rb +++ b/Library/Homebrew/compat/cask/cmd/search.rb @@ -2,7 +2,7 @@ require "cask/cmd/abstract_command" require "cmd/search" module Hbc - class CLI + class Cmd module Compat class Search < AbstractCommand def run diff --git a/Library/Homebrew/test/cask/cli/--version_spec.rb b/Library/Homebrew/test/cask/cli/--version_spec.rb index dc1a95805c..b1fefeaa14 100644 --- a/Library/Homebrew/test/cask/cli/--version_spec.rb +++ b/Library/Homebrew/test/cask/cli/--version_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CLI::Version, :cask do +describe Hbc::Cmd::Version, :cask do describe "::run" do it "outputs the current Homebrew Cask version" do expect { described_class.run } diff --git a/Library/Homebrew/test/cask/cli/audit_spec.rb b/Library/Homebrew/test/cask/cli/audit_spec.rb index 4619e38a67..5fc7156d44 100644 --- a/Library/Homebrew/test/cask/cli/audit_spec.rb +++ b/Library/Homebrew/test/cask/cli/audit_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Audit, :cask do +describe Hbc::Cmd::Audit, :cask do let(:cask) { Hbc::Cask.new(nil) } it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cli/cat_spec.rb b/Library/Homebrew/test/cask/cli/cat_spec.rb index 086f1879dc..293000c93a 100644 --- a/Library/Homebrew/test/cask/cli/cat_spec.rb +++ b/Library/Homebrew/test/cask/cli/cat_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Cat, :cask do +describe Hbc::Cmd::Cat, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cli/create_spec.rb b/Library/Homebrew/test/cask/cli/create_spec.rb index bc9d28bdec..06a25f54fb 100644 --- a/Library/Homebrew/test/cask/cli/create_spec.rb +++ b/Library/Homebrew/test/cask/cli/create_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Create, :cask do +describe Hbc::Cmd::Create, :cask do around do |example| begin example.run diff --git a/Library/Homebrew/test/cask/cli/doctor_spec.rb b/Library/Homebrew/test/cask/cli/doctor_spec.rb index d6a3a27157..e49eae51af 100644 --- a/Library/Homebrew/test/cask/cli/doctor_spec.rb +++ b/Library/Homebrew/test/cask/cli/doctor_spec.rb @@ -1,17 +1,17 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Doctor, :cask do +describe Hbc::Cmd::Doctor, :cask do it_behaves_like "a command that handles invalid options" it "displays some nice info about the environment" do expect { - Hbc::CLI::Doctor.run + Hbc::Cmd::Doctor.run }.to output(/\A==> Homebrew Cask Version/).to_stdout end it "raises an exception when arguments are given" do expect { - Hbc::CLI::Doctor.run("argument") + Hbc::Cmd::Doctor.run("argument") }.to raise_error(ArgumentError) end end diff --git a/Library/Homebrew/test/cask/cli/edit_spec.rb b/Library/Homebrew/test/cask/cli/edit_spec.rb index 90e6ad3c50..91c67fb9b2 100644 --- a/Library/Homebrew/test/cask/cli/edit_spec.rb +++ b/Library/Homebrew/test/cask/cli/edit_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Edit, :cask do +describe Hbc::Cmd::Edit, :cask do before do allow_any_instance_of(described_class).to receive(:exec_editor) end diff --git a/Library/Homebrew/test/cask/cli/fetch_spec.rb b/Library/Homebrew/test/cask/cli/fetch_spec.rb index ea83d48084..51ba3329b7 100644 --- a/Library/Homebrew/test/cask/cli/fetch_spec.rb +++ b/Library/Homebrew/test/cask/cli/fetch_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Fetch, :cask do +describe Hbc::Cmd::Fetch, :cask do let(:local_transmission) { Hbc::CaskLoader.load(cask_path("local-transmission")) } diff --git a/Library/Homebrew/test/cask/cli/home_spec.rb b/Library/Homebrew/test/cask/cli/home_spec.rb index eefdfbc849..719b73ae75 100644 --- a/Library/Homebrew/test/cask/cli/home_spec.rb +++ b/Library/Homebrew/test/cask/cli/home_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Home, :cask do +describe Hbc::Cmd::Home, :cask do before do allow(described_class).to receive(:open_url) end diff --git a/Library/Homebrew/test/cask/cli/info_spec.rb b/Library/Homebrew/test/cask/cli/info_spec.rb index 0fb5efe804..14110f34ee 100644 --- a/Library/Homebrew/test/cask/cli/info_spec.rb +++ b/Library/Homebrew/test/cask/cli/info_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Info, :cask do +describe Hbc::Cmd::Info, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cli/install_spec.rb b/Library/Homebrew/test/cask/cli/install_spec.rb index 8522e72640..fb0153ebcb 100644 --- a/Library/Homebrew/test/cask/cli/install_spec.rb +++ b/Library/Homebrew/test/cask/cli/install_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Install, :cask do +describe Hbc::Cmd::Install, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb index 9869b7e9f2..04c3ceb7b2 100644 --- a/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb +++ b/Library/Homebrew/test/cask/cli/internal_stanza_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CLI::InternalStanza, :cask do +describe Hbc::Cmd::InternalStanza, :cask do it "shows stanza of the Specified Cask" do command = described_class.new("homepage", "local-caffeine") expect { diff --git a/Library/Homebrew/test/cask/cli/list_spec.rb b/Library/Homebrew/test/cask/cli/list_spec.rb index 968afcca26..28dbd59bee 100644 --- a/Library/Homebrew/test/cask/cli/list_spec.rb +++ b/Library/Homebrew/test/cask/cli/list_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::List, :cask do +describe Hbc::Cmd::List, :cask do it_behaves_like "a command that handles invalid options" it "lists the installed Casks in a pretty fashion" do diff --git a/Library/Homebrew/test/cask/cli/options_spec.rb b/Library/Homebrew/test/cask/cli/options_spec.rb index 8b084113c9..da686cc073 100644 --- a/Library/Homebrew/test/cask/cli/options_spec.rb +++ b/Library/Homebrew/test/cask/cli/options_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CLI, :cask do +describe Hbc::Cmd, :cask do it "supports setting the appdir" do allow(Hbc::Config.global).to receive(:appdir).and_call_original diff --git a/Library/Homebrew/test/cask/cli/outdated_spec.rb b/Library/Homebrew/test/cask/cli/outdated_spec.rb index 1ee6a6d7da..328dbb7048 100644 --- a/Library/Homebrew/test/cask/cli/outdated_spec.rb +++ b/Library/Homebrew/test/cask/cli/outdated_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Outdated, :cask do +describe Hbc::Cmd::Outdated, :cask do let(:installed) do [ Hbc::CaskLoader.load(cask_path("basic-cask")), diff --git a/Library/Homebrew/test/cask/cli/quarantine_spec.rb b/Library/Homebrew/test/cask/cli/quarantine_spec.rb index 21c1754221..cd4a9a3795 100644 --- a/Library/Homebrew/test/cask/cli/quarantine_spec.rb +++ b/Library/Homebrew/test/cask/cli/quarantine_spec.rb @@ -9,7 +9,7 @@ describe Hbc::Quarantine, :cask do describe "by default" do it "quarantines a nice fresh Cask" do - Hbc::CLI::Install.run("local-transmission") + Hbc::Cmd::Install.run("local-transmission") expect( Hbc::CaskLoader.load(cask_path("local-transmission")), @@ -21,7 +21,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines Cask fetches" do - Hbc::CLI::Fetch.run("local-transmission") + Hbc::Cmd::Fetch.run("local-transmission") local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform @@ -29,7 +29,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines Cask audits" do - Hbc::CLI::Audit.run("local-transmission", "--download") + Hbc::Cmd::Audit.run("local-transmission", "--download") local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform @@ -38,7 +38,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines dmg-based Casks" do - Hbc::CLI::Install.run("container-dmg") + Hbc::Cmd::Install.run("container-dmg") expect( Hbc::CaskLoader.load(cask_path("container-dmg")), @@ -48,7 +48,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines tar-gz-based Casks" do - Hbc::CLI::Install.run("container-tar-gz") + Hbc::Cmd::Install.run("container-tar-gz") expect( Hbc::CaskLoader.load(cask_path("container-tar-gz")), @@ -58,7 +58,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines xar-based Casks" do - Hbc::CLI::Install.run("container-xar") + Hbc::Cmd::Install.run("container-xar") expect( Hbc::CaskLoader.load(cask_path("container-xar")), @@ -68,7 +68,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines pure bzip2-based Casks" do - Hbc::CLI::Install.run("container-bzip2") + Hbc::Cmd::Install.run("container-bzip2") expect( Hbc::CaskLoader.load(cask_path("container-bzip2")), @@ -78,7 +78,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines pure gzip-based Casks" do - Hbc::CLI::Install.run("container-gzip") + Hbc::Cmd::Install.run("container-gzip") expect( Hbc::CaskLoader.load(cask_path("container-gzip")), @@ -88,7 +88,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines the pkg in naked-pkg-based Casks" do - Hbc::CLI::Install.run("container-pkg") + Hbc::Cmd::Install.run("container-pkg") naked_pkg = Hbc::CaskLoader.load(cask_path("container-pkg")) @@ -100,7 +100,7 @@ describe Hbc::Quarantine, :cask do end it "quarantines a nested container" do - Hbc::CLI::Install.run("nested-app") + Hbc::Cmd::Install.run("nested-app") expect( Hbc::CaskLoader.load(cask_path("nested-app")), @@ -112,7 +112,7 @@ describe Hbc::Quarantine, :cask do describe "when disabled" do it "does not quarantine even a nice, fresh Cask" do - Hbc::CLI::Install.run("local-transmission", "--no-quarantine") + Hbc::Cmd::Install.run("local-transmission", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("local-transmission")), @@ -122,7 +122,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine Cask fetches" do - Hbc::CLI::Fetch.run("local-transmission", "--no-quarantine") + Hbc::Cmd::Fetch.run("local-transmission", "--no-quarantine") local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform @@ -130,7 +130,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine dmg-based Casks" do - Hbc::CLI::Install.run("container-dmg", "--no-quarantine") + Hbc::Cmd::Install.run("container-dmg", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("container-dmg")), @@ -140,7 +140,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine tar-gz-based Casks" do - Hbc::CLI::Install.run("container-tar-gz", "--no-quarantine") + Hbc::Cmd::Install.run("container-tar-gz", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("container-tar-gz")), @@ -150,7 +150,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine xar-based Casks" do - Hbc::CLI::Install.run("container-xar", "--no-quarantine") + Hbc::Cmd::Install.run("container-xar", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("container-xar")), @@ -160,7 +160,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine pure bzip2-based Casks" do - Hbc::CLI::Install.run("container-bzip2", "--no-quarantine") + Hbc::Cmd::Install.run("container-bzip2", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("container-bzip2")), @@ -170,7 +170,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine pure gzip-based Casks" do - Hbc::CLI::Install.run("container-gzip", "--no-quarantine") + Hbc::Cmd::Install.run("container-gzip", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("container-gzip")), @@ -180,7 +180,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine the pkg in naked-pkg-based Casks" do - Hbc::CLI::Install.run("container-pkg", "--no-quarantine") + Hbc::Cmd::Install.run("container-pkg", "--no-quarantine") naked_pkg = Hbc::CaskLoader.load(cask_path("container-pkg")) @@ -192,7 +192,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine a nested container" do - Hbc::CLI::Install.run("nested-app", "--no-quarantine") + Hbc::Cmd::Install.run("nested-app", "--no-quarantine") expect( Hbc::CaskLoader.load(cask_path("nested-app")), @@ -202,7 +202,7 @@ describe Hbc::Quarantine, :cask do end it "does not quarantine Cask audits" do - Hbc::CLI::Audit.run("local-transmission", "--download", "--no-quarantine") + Hbc::Cmd::Audit.run("local-transmission", "--download", "--no-quarantine") local_transmission = Hbc::CaskLoader.load(cask_path("local-transmission")) cached_location = Hbc::Download.new(local_transmission, force: false, quarantine: false).perform diff --git a/Library/Homebrew/test/cask/cli/reinstall_spec.rb b/Library/Homebrew/test/cask/cli/reinstall_spec.rb index 41a0ca92ea..6bac52021e 100644 --- a/Library/Homebrew/test/cask/cli/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/reinstall_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Reinstall, :cask do +describe Hbc::Cmd::Reinstall, :cask do it_behaves_like "a command that handles invalid options" it "displays the reinstallation progress" do @@ -22,23 +22,23 @@ describe Hbc::CLI::Reinstall, :cask do EOS expect { - Hbc::CLI::Reinstall.run("local-caffeine") + Hbc::Cmd::Reinstall.run("local-caffeine") }.to output(output).to_stdout end it "allows reinstalling a Cask" do - Hbc::CLI::Install.run("local-transmission") + Hbc::Cmd::Install.run("local-transmission") expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed - Hbc::CLI::Reinstall.run("local-transmission") + Hbc::Cmd::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed end it "allows reinstalling a non installed Cask" do expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed - Hbc::CLI::Reinstall.run("local-transmission") + Hbc::Cmd::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load(cask_path("local-transmission"))).to be_installed end end diff --git a/Library/Homebrew/test/cask/cli/style_spec.rb b/Library/Homebrew/test/cask/cli/style_spec.rb index b04886bd9b..8194ff4ebb 100644 --- a/Library/Homebrew/test/cask/cli/style_spec.rb +++ b/Library/Homebrew/test/cask/cli/style_spec.rb @@ -3,7 +3,7 @@ require "rubygems" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Style, :cask do +describe Hbc::Cmd::Style, :cask do let(:args) { [] } let(:cli) { described_class.new(*args) } diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index 45fb600c3c..5fea31a2d5 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Uninstall, :cask do +describe Hbc::Cmd::Uninstall, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cli/upgrade_spec.rb b/Library/Homebrew/test/cask/cli/upgrade_spec.rb index 912bb8541f..f1afd54718 100644 --- a/Library/Homebrew/test/cask/cli/upgrade_spec.rb +++ b/Library/Homebrew/test/cask/cli/upgrade_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Upgrade, :cask do +describe Hbc::Cmd::Upgrade, :cask do it_behaves_like "a command that handles invalid options" context "successful upgrade" do @@ -14,7 +14,7 @@ describe Hbc::CLI::Upgrade, :cask do } before do - installed.each { |cask| Hbc::CLI::Install.run(cask) } + installed.each { |cask| Hbc::Cmd::Install.run(cask) } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end @@ -177,7 +177,7 @@ describe Hbc::CLI::Upgrade, :cask do } before do - installed.each { |cask| Hbc::CLI::Install.run(cask) } + installed.each { |cask| Hbc::Cmd::Install.run(cask) } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end diff --git a/Library/Homebrew/test/cask/cli/zap_spec.rb b/Library/Homebrew/test/cask/cli/zap_spec.rb index 0440f04b3c..3c5fc41fc3 100644 --- a/Library/Homebrew/test/cask/cli/zap_spec.rb +++ b/Library/Homebrew/test/cask/cli/zap_spec.rb @@ -1,7 +1,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" -describe Hbc::CLI::Zap, :cask do +describe Hbc::Cmd::Zap, :cask do it_behaves_like "a command that requires a Cask token" it_behaves_like "a command that handles invalid options" diff --git a/Library/Homebrew/test/cask/cmd_spec.rb b/Library/Homebrew/test/cask/cmd_spec.rb index cd4f79583a..6d2b030e8f 100644 --- a/Library/Homebrew/test/cask/cmd_spec.rb +++ b/Library/Homebrew/test/cask/cmd_spec.rb @@ -1,4 +1,4 @@ -describe Hbc::CLI, :cask do +describe Hbc::Cmd, :cask do it "lists the taps for Casks that show up in two taps" do listing = described_class.nice_listing(%w[ homebrew/cask/adium @@ -28,13 +28,13 @@ describe Hbc::CLI, :cask do context "when no option is specified" do it "--binaries is true by default" do - command = Hbc::CLI::Install.new("some-cask") + command = Hbc::Cmd::Install.new("some-cask") expect(command.binaries?).to be true end end context "::run" do - let(:noop_command) { double("CLI::Noop") } + let(:noop_command) { double("Cmd::Noop") } before do allow(described_class).to receive(:lookup_command).with("noop").and_return(noop_command) @@ -42,7 +42,7 @@ describe Hbc::CLI, :cask do end it "passes `--version` along to the subcommand" do - version_command = double("CLI::Version") + version_command = double("Cmd::Version") allow(described_class).to receive(:lookup_command).with("--version").and_return(version_command) expect(described_class).to receive(:run_command).with(version_command) described_class.run("--version")