lib/vvm/validator.rb in vvm-rb-1.0.4 vs lib/vvm/validator.rb in vvm-rb-1.0.5

- old
+ new

@@ -4,11 +4,11 @@ module Validator module_function def validate_before_invoke(command) version? if %w(install rebuild use uninstall).include?(command) - hg? if %w(install reinstall rebuild list).include?(command) + hg? if %w(install reinstall rebuild list update).include?(command) new_version? if command == 'install' installed_version? if %w(reinstall rebuild use uninstall).include?(command) end def hg? @@ -19,10 +19,12 @@ def version? abort 'undefined vim version. please run [ vvm list ].' if find_version.nil? true end - def new_version?(ver = version) + def new_version?(ver = nil) + Installer.pull + ver = version if ver.nil? abort "#{ver} is already installed." if version_include?(ver) true end def installed_version?(ver = version)