lib/headdesk/analyze.rb in headdesk-0.15.1 vs lib/headdesk/analyze.rb in headdesk-0.16.0

- old
+ new

@@ -1,14 +1,22 @@ # frozen_string_literal: true require 'headdesk/apk' +require 'headdesk/ipa' module Headdesk # # analyze an APK/IPA # class Analyze def self.at(path) - Headdesk::Apk.new(path).analyze + begin + return Headdesk::Apk.new(path).analyze + rescue + end + begin + return Headdesk::Ipa.new(path).analyze + end + throw CliError.new('Path did not contain an unpacked IPA or APK.') end end end