lib/percheron/validators/container.rb in percheron-0.2.3 vs lib/percheron/validators/container.rb in percheron-0.2.4
- old
+ new
@@ -31,10 +31,13 @@
def validate_name
'Name is invalid' if container.name.nil? || !container.name.to_s.match(/[\w\d]{3,}/)
end
def validate_version
- 'Version is invalid' if container.version.nil? || !container.version.to_s.match(/[\w\d]{1,}/)
+ container.version
+ nil
+ rescue ArgumentError
+ 'Version is invalid'
end
def validate_dockerfile
'Dockerfile is invalid' if container.dockerfile.nil? || !File.exist?(container.dockerfile)
end