frameit/lib/frameit/device.rb in fastlane-2.210.1 vs frameit/lib/frameit/device.rb in fastlane-2.211.0

- old
+ new

@@ -49,10 +49,10 @@ UI.user_error!("Could not find or parse file at path '#{path}'") if size.nil? || size.count == 0 found_device = nil filename_device = nil filename = Pathname.new(path).basename.to_s - Devices.constants.each do |c| + Devices.constants.sort_by(&:length).reverse_each do |c| device = Devices.const_get(c) next unless device.resolutions.include?(size) # assign to filename_device if the filename contains the formatted name / id and its priority is higher than the current filename_device filename_device = device if (filename.include?(device.formatted_name_without_apple) || filename.include?(device.id)) && (filename_device.nil? || filename_device.priority < device.priority) next unless device.is_chosen_platform?(platform) && (found_device.nil? || device.priority > found_device.priority)