Skip to content

Commit

Permalink
Updates regex to accept X.Y.Z-beta.W versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrovereza committed Jan 31, 2017
1 parent 7de7f79 commit 1fa474c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Expand Up @@ -157,12 +157,12 @@ desc 'Release a version, specified as an argument.'
task :release, :version do |task, args|
version = args[:version]
# Needs a X.Y.Z-text format.
abort "You must specify a version in semver format." if version.nil? || version.scan(/\d+\.\d+\.\d+/).length == 0
abort "You must specify a version in semver format." if version.nil? || version.scan(/\d+\.\d+\.\d+(-\w+\.\d+)?/).length == 0

puts "Updating podspec."
filename = "Moya.podspec"
contents = File.read(filename)
contents.gsub!(/s\.version\s*=\s"\d+\.\d+\.\d+"/, "s.version = \"#{version}\"")
contents.gsub!(/s\.version\s*=\s"\d+\.\d+\.\d+(-\w+\.\d)?"/, "s.version = \"#{version}\"")
File.open(filename, 'w') { |file| file.puts contents }

puts "Updating Demo project."
Expand Down

0 comments on commit 1fa474c

Please sign in to comment.