lib/roku_builder/plugins/rokuapi.rb in roku_builder-4.29.1 vs lib/roku_builder/plugins/rokuapi.rb in roku_builder-4.29.2
- old
+ new
@@ -84,13 +84,10 @@
sorted_versions(JSON.parse(response.body))
end
def sorted_versions(versions)
sorted = versions.sort do |a, b|
- aa, ab = a["version"].split(".").map{|i| i.to_i}
- ba, bb = b["version"].split(".").map{|i| i.to_i}
- value = (aa == ba ? bb <=> ab : ba <=> aa)
- value
+ DateTime.parse(b["createdDate"]) <=> DateTime.parse(a["createdDate"])
end
sorted
end
def create_channel_version(channel, package)