Class: AppInfo::Framework
- Inherits:
-
Object
- Object
- AppInfo::Framework
- Extended by:
- Forwardable
- Defined in:
- lib/app_info/ipa/framework.rb
Overview
iOS Framework parser
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Class Method Summary collapse
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(file) ⇒ Framework
constructor
A new instance of Framework.
- #lib? ⇒ Boolean
- #macho ⇒ Object
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file) ⇒ Framework
Returns a new instance of Framework.
24 25 26 |
# File 'lib/app_info/ipa/framework.rb', line 24 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
19 20 21 |
# File 'lib/app_info/ipa/framework.rb', line 19 def file @file end |
Class Method Details
.parse(path, name = 'Frameworks') ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/app_info/ipa/framework.rb', line 10 def self.parse(path, name = 'Frameworks') files = Dir.glob(::File.join(path, name.to_s, '*')) return [] if files.empty? files.sort.each_with_object([]) do |file, obj| obj << new(file) end end |
Instance Method Details
#info ⇒ Object
43 44 45 |
# File 'lib/app_info/ipa/framework.rb', line 43 def info @info ||= InfoPlist.new(::File.join(file, 'Info.plist')) end |
#lib? ⇒ Boolean
39 40 41 |
# File 'lib/app_info/ipa/framework.rb', line 39 def lib? ::File.file?(file) end |
#macho ⇒ Object
32 33 34 35 36 37 |
# File 'lib/app_info/ipa/framework.rb', line 32 def macho return unless lib? require 'macho' MachO.open(file) end |
#name ⇒ Object
28 29 30 |
# File 'lib/app_info/ipa/framework.rb', line 28 def name ::File.basename(file) end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/app_info/ipa/framework.rb', line 47 def to_s "<#{self.class}:#{object_id} @name=#{name}>" end |