Class: Convert2Ascii::CheckFFmpeg

Inherits:
CheckPackage show all
Defined in:
lib/convert2ascii/check_package.rb

Instance Method Summary collapse

Methods inherited from CheckPackage

#arch_installed?, #centos_installed?, #check, #debian_installed?, #detect_linux_distribution, #macos_installed?, #ms_check, #redhat_installed?, #unknow_check

Methods included from OS

#detect_os

Constructor Details

#initializeCheckFFmpeg

Returns a new instance of CheckFFmpeg.



114
115
116
117
118
119
# File 'lib/convert2ascii/check_package.rb', line 114

def initialize
  super
  @name = "ffmpeg"
  @need_error = Rainbow("[Error] `#{@name}` is need!").red
  @tips = Rainbow("[Tips ] For more details and install: https://www.ffmpeg.org/").green
end

Instance Method Details

#linux_checkObject



127
128
129
130
# File 'lib/convert2ascii/check_package.rb', line 127

def linux_check
  linux_platform_name = detect_linux_distribution
  __send__ "#{linux_platform_name}_installed?", @name
end

#macos_checkObject



121
122
123
124
125
# File 'lib/convert2ascii/check_package.rb', line 121

def macos_check
  if !macos_installed?(@name)
    raise CheckPackageError, "\n#{@need_error}\n#{@tips}\n"
  end
end