fix rake task

pull/1198/head
gabrielburnworth 2019-05-16 12:35:42 -07:00
parent 8cc17a8955
commit 3db5014b11
1 changed files with 3 additions and 1 deletions

View File

@ -88,6 +88,7 @@ namespace :api do
VERSION = "tag_name"
TIMESTAMP = "created_at"
PRERELEASE = "prerelease"
desc "Update GlobalConfig to deprecate old FBOS versions"
task deprecate: :environment do
@ -102,8 +103,9 @@ namespace :api do
string = stringio.read
data = JSON
.parse(string)
.map { |x| x.slice(VERSION, TIMESTAMP) } # Only grab keys that matter
.map { |x| x.slice(VERSION, TIMESTAMP, PRERELEASE) } # Only grab keys that matter
.reject { |x| x.fetch(VERSION).include?("-") } # Remove RC/Beta releases
.reject { |x| x.fetch(PRERELEASE) } # Remove pre-releases
.map do |x|
# Convert string-y version/timestamps to Real ObjectsTM
version = Gem::Version::new(x.fetch(VERSION).gsub("v", ""))