From 987c179ee40641b4bcabd1d22624dfc80c107740 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Tue, 12 Jan 2016 16:13:50 +0500 Subject: [PATCH] fix(validation): do not validate version for 0.1.0 New gems should be released with version 0.1.0 More info see there https://github.com/rails/rails/pull/21258 --- lib/apress/gems/cli.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/apress/gems/cli.rb b/lib/apress/gems/cli.rb index 286dc0a..718b6df 100644 --- a/lib/apress/gems/cli.rb +++ b/lib/apress/gems/cli.rb @@ -107,9 +107,12 @@ def commit end def validate_version - return if version == '0.0.1' + fail "New gems should be released with version 0.1.0" if Gem::Version.new(version) < Gem::Version.new("0.1.0") + + return if version == '0.1.0' return if Gem::Version.new(version) > Gem::Version.new(find_version) - raise 'New version less then current version' + + fail 'New version less then current version' end # run +cmd+ in subprocess, redirect its stdout to parent's stdout