Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate brew cask --version. #4834

Merged
merged 1 commit into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Library/Homebrew/cask/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
require "cask/topological_hash"
require "cask/utils"
require "cask/verify"
require "cask/version"
1 change: 0 additions & 1 deletion Library/Homebrew/cask/cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
require "cask/cmd/style"
require "cask/cmd/uninstall"
require "cask/cmd/upgrade"
require "cask/cmd/--version"
require "cask/cmd/zap"

require "cask/cmd/abstract_internal_command"
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd/doctor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run
end

def check_software_versions
ohai "Homebrew Cask Version", Hbc.full_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to HOMEBREW_VERSION?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

ohai "Homebrew Version", HOMEBREW_VERSION
ohai "macOS", MacOS.full_version
ohai "SIP", self.class.check_sip
ohai "Java", SystemConfig.describe_java
Expand Down
10 changes: 0 additions & 10 deletions Library/Homebrew/cask/version.rb

This file was deleted.

3 changes: 2 additions & 1 deletion Library/Homebrew/cmd/--version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def __version
odie "This command does not take arguments." if ARGV.any?

puts "Homebrew #{HOMEBREW_VERSION}"
puts "Homebrew/homebrew-core #{CoreTap.instance.version_string}"
puts "#{CoreTap.instance.full_name} #{CoreTap.instance.version_string}"
puts "#{Tap.default_cask_tap.full_name} #{Tap.default_cask_tap.version_string}" if Tap.default_cask_tap.installed?
end
end
1 change: 1 addition & 0 deletions Library/Homebrew/compat/cask.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "compat/cask/cask_loader"
require "compat/cask/cmd/--version"
require "compat/cask/cmd/cleanup"
require "compat/cask/cmd/search"
require "compat/cask/cache"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require "cask/cmd/abstract_command"
require "cmd/--version"

module Hbc
class Cmd
class Version < AbstractCommand
Expand All @@ -12,12 +15,18 @@ def initialize(*)
end

def run
puts Hbc.full_version
odeprecated "`brew cask --version`", "`brew --version`", disable_on: Time.new(2018, 10, 31)
ARGV.clear
Homebrew.__version
end

def self.help
"displays the Homebrew Cask version"
end

def self.visible
false
end
end
end
end
13 changes: 0 additions & 13 deletions Library/Homebrew/test/cask/cli/--version_spec.rb

This file was deleted.

6 changes: 3 additions & 3 deletions Library/Homebrew/test/cask/cli/doctor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

it "displays some nice info about the environment" do
expect {
Hbc::Cmd::Doctor.run
}.to output(/\A==> Homebrew Cask Version/).to_stdout
described_class.run
}.to output(/^==> Homebrew Version/).to_stdout
end

it "raises an exception when arguments are given" do
expect {
Hbc::Cmd::Doctor.run("argument")
described_class.run("argument")
}.to raise_error(ArgumentError)
end
end