lib/faastruby/server.rb in faastruby-0.5.28 vs lib/faastruby/server.rb in faastruby-0.5.29

- old
+ new

@@ -2,11 +2,16 @@ module FaaStRuby require 'faastruby/version' require 'faastruby/supported_runtimes' def self.get_crystal_version - ver = `crystal -v|head -n1|cut -f2 -d' ' 2>/dev/null`&.chomp - ver == '' ? CRYSTAL_LATEST : ver + major, minor, patch = `crystal -v|head -n1|cut -f2 -d' ' 2>/dev/null`&.chomp&.split('.') + ver = "#{major}.#{minor}" + if ver == '.' || ver == '' + CRYSTAL_LATEST + else + ver + end end def self.crystal_present_and_supported? system("which crystal >/dev/null") && version_match?(SUPPORTED_CRYSTAL, get_crystal_version) end