Browse files

(#4) Add semantic version support

This change replaces the validation of the version string using with a regular expression matching the
description of versions.

The reason for this change is that is too restrictive
and does not allow semantic version strings to be used.  We're trying to
use semantic versions for modules and for development releases these may
be in the form of 0.0.2git-8-g3d316d1

Also changed the error message to indicate we support semantic versions and
provide the end user a link to for more information.
  • Loading branch information...
1 parent 69a43b8 commit fadc5b30d56031b421228eaf007dd7ab34647a97 @jeffmccune jeffmccune committed Jun 16, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/puppet/module/tool/applications/application.rb
6 lib/puppet/module/tool/applications/application.rb
@@ -70,10 +70,8 @@ def parse_filename!
unless @username && @module_name
abort "Username and Module name not provided"
- begin
- rescue ArgumentError => e
- abort "Invalid version format: #{@version}"
+ if @version !~ /^(\d+)\.(\d+)\.(\d+)$|^(\d)+\.(\d)+\.(\d+)([a-zA-Z][a-zA-Z0-9-]*)$/ then
+ abort "Invalid version format: #{@version} (Semantic Versions are acceptable:"

0 comments on commit fadc5b3

Please sign in to comment.