Module: GitCli::OS::Linux::Utils
- Defined in:
- lib/git_cli/os/linux/utils.rb
Class Method Summary collapse
Class Method Details
.is_installed?(binary) ⇒ Boolean
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/git_cli/os/linux/utils.rb', line 27 def Utils.is_installed?(binary) if is_which_installed? begin GitCli::Global.instance.logger.debug "Checking if '#{binary}' is installed..." res = Antrapol::ToolRack::ProcessUtilsEngine.exec("which #{binary}") GitCli::Global.instance.logger.debug "Yes, '#{binary}' is found in system" [true, res.strip] rescue Exception => ex GitCli::Global.instance.logger.debug "No, '#{binary}' is not found in system" [false, ex.] end else raise GitCliException, "Utility 'which' is not installed" end end |
.is_which_installed? ⇒ Boolean
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/git_cli/os/linux/utils.rb', line 47 def Utils.is_which_installed? begin GitCli::Global.instance.logger.debug "Checking if 'which' is installed..." Antrapol::ToolRack::ProcessUtilsEngine.exec("which") GitCli::Global.instance.logger.debug "'which' utility is installed..." true rescue Exception => ex GitCli::Global.instance.logger.debug "'which' utility is NOT installed..." false end end |