lib/vagrant-parallels/driver/meta.rb in vagrant-parallels-1.7.8 vs lib/vagrant-parallels/driver/meta.rb in vagrant-parallels-2.0.0

- old
+ new

@@ -35,30 +35,27 @@ # Read and assign the version of Parallels Desktop we know which # specific driver to instantiate. @@version_lock.synchronize do @@version = read_version end - + # Instantiate the proper version driver for Parallels Desktop @logger.debug("Finding driver for Parallels Desktop version: #{@@version}") major_ver = @@version.split('.').first.to_i driver_klass = case major_ver - when 1..9 then raise Errors::ParallelsUnsupportedVersion - when 10 then PD_10 + when 1..10 then raise Errors::ParallelsUnsupportedVersion when 11 then PD_11 else PD_12 end # Starting since PD 11 only Pro and Business editions have CLI # functionality and can be used with Vagrant. - if major_ver >= 11 - edition = read_edition - if !edition || !%w(any pro business).include?(edition) - raise Errors::ParallelsUnsupportedEdition - end + edition = read_edition + if !edition || !%w(any pro business).include?(edition) + raise Errors::ParallelsUnsupportedEdition end @logger.info("Using Parallels driver: #{driver_klass}") @driver = driver_klass.new(@uuid) @version = @@version @@ -141,9 +138,10 @@ # The version string is usually in one of the following formats: # # * prlctl version 8.0.12345.123456 # * prlctl version 9.0.12345.123456 # * prlctl version 10.0.0 (12345) rev 123456 + # * prlctl version 14.0.1 (45154) # # But we need exactly the first 3 numbers: "x.x.x" output = execute(@prlctl_path, '--version') if output =~ /prlctl version (\d+\.\d+.\d+)/