Class: RunLoop::Ipa
- Inherits:
-
Object
- Object
- RunLoop::Ipa
- Defined in:
- lib/run_loop/ipa.rb
Overview
A model of the an .ipa - a application binary for iOS devices.
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
The path to this .ipa.
Class Method Summary collapse
-
.is_ipa?(path_to_ipa) ⇒ Boolean
Return true if the path_to_ipa is probably an .ipa.
-
.is_zip_archive?(path_to_ipa) ⇒ Boolean
Return true if the path_to_ipa to a zip archive.
Instance Method Summary collapse
-
#arches ⇒ Object
Returns the arches for the binary.
-
#bundle_identifier ⇒ String
The bundle identifier of this ipa.
-
#calabash_server_version ⇒ Object
Inspects the app’s executables for the server version @return a version instance.
-
#executable_name ⇒ String
Inspects the app’s Info.plist for the executable name.
-
#initialize(path_to_ipa) ⇒ Calabash::Ipa
constructor
Create a new ipa instance.
Constructor Details
#initialize(path_to_ipa) ⇒ Calabash::Ipa
Create a new ipa instance.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/run_loop/ipa.rb', line 29 def initialize(path_to_ipa) if !File.exist? path_to_ipa raise "Expected an ipa at '#{path_to_ipa}'" end if !RunLoop::Ipa.is_ipa?(path_to_ipa) raise "Expected '#{path_to_ipa}' have extension .ipa or be a zip archive" end @path = path_to_ipa end |
Instance Attribute Details
#path ⇒ String (readonly)
The path to this .ipa.
22 23 24 |
# File 'lib/run_loop/ipa.rb', line 22 def path @path end |
Class Method Details
.is_ipa?(path_to_ipa) ⇒ Boolean
Return true if the path_to_ipa is probably an .ipa
15 16 17 |
# File 'lib/run_loop/ipa.rb', line 15 def self.is_ipa?(path_to_ipa) path_to_ipa.end_with?('.ipa') || RunLoop::Ipa.is_zip_archive?(path_to_ipa) end |
.is_zip_archive?(path_to_ipa) ⇒ Boolean
Return true if the path_to_ipa to a zip archive
8 9 10 11 12 |
# File 'lib/run_loop/ipa.rb', line 8 def self.is_zip_archive?(path_to_ipa) hash = RunLoop::Shell.run_shell_command(["file", path_to_ipa], {log_cmd: true}) hash[:out][/Zip archive data/] end |
Instance Method Details
#arches ⇒ Object
Returns the arches for the binary.
76 77 78 |
# File 'lib/run_loop/ipa.rb', line 76 def arches app.arches end |
#bundle_identifier ⇒ String
The bundle identifier of this ipa.
65 66 67 |
# File 'lib/run_loop/ipa.rb', line 65 def bundle_identifier app.bundle_identifier end |
#calabash_server_version ⇒ Object
Inspects the app’s executables for the server version @return a version instance
82 83 84 |
# File 'lib/run_loop/ipa.rb', line 82 def calabash_server_version app.calabash_server_version end |
#executable_name ⇒ String
Inspects the app’s Info.plist for the executable name.
71 72 73 |
# File 'lib/run_loop/ipa.rb', line 71 def executable_name app.executable_name end |