move notfound_string to method

This commit is contained in:
Roland Walker 2014-06-06 10:51:32 -04:00
parent fc9e7299ed
commit 9f2c773ed6
1 changed files with 9 additions and 6 deletions

View File

@ -1,11 +1,10 @@
class Cask::CLI::Doctor
def self.run
notfound_msg = "#{Tty.red}Not Found - Unknown Error#{Tty.reset}"
fq_default_tap = notfound_msg
alt_taps = notfound_msg
default_cask_count = notfound_msg
privileged_uid = notfound_msg
homebrew_origin = notfound_msg
fq_default_tap = notfound_string
alt_taps = notfound_string
default_cask_count = notfound_string
privileged_uid = notfound_string
homebrew_origin = notfound_string
begin
privileged_uid = Process.euid == 0 ? "Yes #{error_string 'warning: not recommended'}" : 'No'
@ -75,6 +74,10 @@ class Cask::CLI::Doctor
'<NONE>'
end
def self.notfound_string
"#{Tty.red}Not Found - Unknown Error#{Tty.reset}"
end
def self.error_string(string='Error')
"#{Tty.red}(#{string})#{Tty.reset}"
end