Permalink
Browse files

Prevent tagging and pushing when version number override is used

  • Loading branch information...
1 parent cc3100d commit 26f4dbba326235f5811b0cf2f46bf1f203aeb226 @kpaulisse kpaulisse committed Dec 30, 2016
Showing with 3 additions and 0 deletions.
  1. +3 −0 rake/gem.rb
View
@@ -43,12 +43,15 @@ def self.build(target = GEMFILE)
# Push the gem to rubygems
def self.push
+ raise 'Cannot push version that does not match .version file' unless version == OctocatalogDiff::Version::VERSION
raise "The gem file doesn't exist: #{FINAL_GEMFILE}" unless File.file?(FINAL_GEMFILE)
exec_command("gem push #{Shellwords.escape(FINAL_GEMFILE)}")
end
# Tag the release on GitHub
def self.tag
+ raise 'Cannot tag version that does not match .version file' unless version == OctocatalogDiff::Version::VERSION
+
# Make sure we have not released this version before
exec_command('git fetch -t origin')
tags = exec_command('git tag -l').split(/\n/)

0 comments on commit 26f4dbb

Please sign in to comment.