cozy/cozy-dev — pull request #45 by dheles (2014-10-25 06:10:04+00:00)
Title: fix issue #44 - vagrant minimum version fails version check

Adjusts vagrant version check so installed versions equal to or greater than the minimum will pass.

When the installed version of vagrant exactly matches the minimum version (currently 1.5.0), the version check fails and vm:init exits with the error, "cozy-dev requires Vagrant 1.5.0 or later." This is because mozilla-version-comparator returns 0 when the compared versions are exactly equal (versions greater than the minimum return -1, while lesser versions return 1). Truth checking the bitwise NOT of 0 (which is -1) returns true and enters the error condition. Instead, just enter the error condition if the result of the comparison is greater than zero.

(BTW, shortening @minimumVagrantVersion to @minimumVagrant was only necessary to stay within the 80 character line length, while still keeping the relevant code together.)