lib/run_loop/app.rb in run_loop-2.0.3 vs lib/run_loop/app.rb in run_loop-2.0.4
- old
+ new
@@ -65,9 +65,27 @@
raise "Expected key 'CFBundleExecutable' in '#{info_plist_path}'"
end
identifier
end
+ # Inspects the app's file for the server version
+ def calabash_server_version
+ if valid?
+ path_to_bin = File.join(path, executable_name)
+ xcrun ||= RunLoop::Xcrun.new
+ hash = xcrun.exec(["strings", path_to_bin])
+ unless hash.nil?
+ version_str = hash[:out][/CALABASH VERSION: \d+\.\d+\.\d+/, 0]
+ unless version_str.nil? || version_str == ""
+ server_ver = version_str.split(":")[1].delete(' ')
+ RunLoop::Version.new(server_ver)
+ end
+ end
+ else
+ raise 'Path is not valid'
+ end
+ end
+
# Returns the sha1 of the application.
def sha1
RunLoop::Directory.directory_digest(path)
end