lib/simctl/runtime.rb in simctl-1.5.6 vs lib/simctl/runtime.rb in simctl-1.5.7
- old
+ new
@@ -1,5 +1,6 @@
+require 'naturally'
require 'simctl/object'
module SimCtl
class Runtime < Object
attr_reader :availability, :buildversion, :identifier, :name, :version
@@ -13,9 +14,9 @@
# Returns the latest available runtime
#
# @param name [String] type (ios, watchos, tvos)
# @return [SimCtl::Runtime] the latest available runtime
def self.latest(type)
- SimCtl.list_runtimes.where(name: %r|#{type}|i).sort_by {|r| r.version}.reverse.first
+ Naturally.sort_by(SimCtl.list_runtimes.where(name: %r|#{type}|i), :version).last
end
end
end