| 55 | end |
| 56 | |
| 57 | def self.updated_version(current, desired = nil, nightly = nil) |
| 58 | if !desired.nil? && desired != 'nightly' |
| 59 | # If desired is present, return full 3 digit version |
| 60 | desired.split('.').tap { |v| v << 0 while v.size < 3 }.join('.') |
| 61 | elsif current.split(/\.|-/).size > 3 |
| 62 | # if current version is already nightly, just need to bump it; this will be noop for some languages |
| 63 | pattern = /-?\.?(nightly|SNAPSHOT|dev|\d{12})\d*$/ |
| 64 | current.gsub(pattern, nightly) |
| 65 | elsif current.split(/\.|-/).size == 3 |
| 66 | # if current version is not nightly, need to bump the version and make nightly |
| 67 | "#{current.split(/\.|-/).tap { |i| (i[1] = i[1].to_i + 1) && (i[2] = 0) }.join('.')}#{nightly}" |
| 68 | end |
| 69 | end |
| 70 | |
| 71 | def self.previous_tag(current_version, language = nil) |
| 72 | version = current_version.split(/\.|-/) |