Sha256: 4db7bae1b38fd90a9e638ce0aeb28b20efcc4c1d501abfd2c4c5367d298d7d30
Contents?: true
Size: 1.02 KB
Versions: 34
Compression:
Stored size: 1.02 KB
Contents
require 'open3' module LearnTest module PythonUnittest class RequirementsChecker def self.check_installation new.check_installation end def check_installation PythonChecker.check PipChecker.check end end class PythonChecker def self.check new.check end def check if !python_installed? || !correct_python_version? puts "Please install python 2.7.x or 3.x.x" exit end end def python_installed? !`which python`.empty? end def correct_python_version? output = Open3.popen2e('python', '--version') version = output[1].read.strip !!version.match(/ 2.7.*| 3.*/) end end class PipChecker def self.check new.check end def check if !pip_installed? puts "Please ensure pip is installed" exit end end def pip_installed? !`which pip`.empty? end end end end
Version data entries
34 entries across 34 versions & 1 rubygems