lib/lagunitas/app.rb in lagunitas-0.0.2 vs lib/lagunitas/app.rb in lagunitas-0.0.3
- old
+ new
@@ -1,9 +1,12 @@
+# frozen_string_literal: true
+
require 'cfpropertylist'
require 'pngdefry'
module Lagunitas
+ # Representation of an app inside an IPA
class App
def initialize(path)
@path = path
end
@@ -13,10 +16,14 @@
def identifier
info['CFBundleIdentifier']
end
+ def bundle_name
+ info['CFBundleName']
+ end
+
def display_name
info['CFBundleDisplayName']
end
def version
@@ -39,10 +46,12 @@
icons = []
info['CFBundleIcons']['CFBundlePrimaryIcon']['CFBundleIconFiles'].each do |name|
icons << get_image(name)
icons << get_image("#{name}@2x")
end
- icons.delete_if { |i| !i }
+ icons.delete_if(&:!)
+ rescue NoMethodError # fix a ipa without icons
+ []
end
end
private