mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
Merge pull request #2418 from rolandwalker/doctor_version
Numerous additions to "brew cask doctor"
This commit is contained in:
+31
-5
@@ -1,11 +1,37 @@
|
||||
class Cask::CLI::Doctor
|
||||
def self.run(*_ignored)
|
||||
ohai "Ruby Version:"
|
||||
def self.run
|
||||
ohai 'OS X Version:'
|
||||
puts MACOS_FULL_VERSION
|
||||
ohai 'Ruby Version:'
|
||||
puts "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
||||
ohai "Contents of $LOAD_PATH:"
|
||||
ohai 'Ruby Path:'
|
||||
puts RUBY_PATH
|
||||
ohai 'Homebrew Version:'
|
||||
puts HOMEBREW_VERSION
|
||||
ohai 'Homebrew Executable Path:'
|
||||
puts HOMEBREW_BREW_FILE
|
||||
ohai 'Homebrew Cellar Path:'
|
||||
puts HOMEBREW_CELLAR
|
||||
ohai 'Homebrew-cask Version:'
|
||||
puts Cask::VERSION
|
||||
ohai 'Contents of $LOAD_PATH:'
|
||||
puts $LOAD_PATH
|
||||
ohai "Running As Privileged User:"
|
||||
puts Process.euid == 0 ? 'Yes' : 'No'
|
||||
ohai 'Contents of $RUBYLIB Environment Variable:'
|
||||
puts ENV['RUBYLIB']
|
||||
ohai 'Contents of $RUBYOPT Environment Variable:'
|
||||
puts ENV['RUBYOPT']
|
||||
ohai 'Contents of $RUBYPATH Environment Variable:'
|
||||
puts ENV['RUBYPATH']
|
||||
ohai 'Contents of $RBENV_VERSION Environment Variable:'
|
||||
puts ENV['RBENV_VERSION']
|
||||
ohai 'Contents of $GEM_HOME Environment Variable:'
|
||||
puts ENV['GEM_HOME']
|
||||
ohai 'Contents of $GEM_PATH Environment Variable:'
|
||||
puts ENV['GEM_PATH']
|
||||
ohai 'Contents of $BUNDLE_PATH Environment Variable:'
|
||||
puts ENV['BUNDLE_PATH']
|
||||
ohai 'Running As Privileged User:'
|
||||
puts Process.euid == 0 ? "Yes #{Tty.red}(warning: not recommended)#{Tty.reset}" : 'No'
|
||||
end
|
||||
|
||||
def self.help
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
require 'test_helper'
|
||||
require 'cask/version'
|
||||
|
||||
HOMEBREW_BREW_FILE ||= '/usr/local/bin/brew'
|
||||
|
||||
describe Cask::CLI::Doctor do
|
||||
it 'displays some nice info about the environment' do
|
||||
out, err = capture_io do
|
||||
Cask::CLI::Doctor.run
|
||||
end
|
||||
# no point in trying to match more of this environment-specific info
|
||||
out.must_match /\A==> OS X Version:/
|
||||
end
|
||||
|
||||
it "raises an exception when arguments are given" do
|
||||
lambda {
|
||||
Cask::CLI::Doctor.run('argument')
|
||||
}.must_raise ArgumentError
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user