Sha256: 1f4691d0d620c4721b2c8089597ca9ad1ff012c57f9d05ba726cd025e2fd9604

Contents?: true

Size: 1005 Bytes

Versions: 3

Compression:

Stored size: 1005 Bytes

Contents

module HighFive
  module IosHelper
    def IosHelper.uuid_from_mobileprovision(path)
      uuid_found = false
      File.open(path, 'r', :encoding => 'iso-8859-1').each do |line|
        if uuid_found
          line =~ /<string>(.*)<\/string>/
          return $1
        end
        uuid_found = true if line =~ /UUID/
      end
      nil
    end

    def info_plist_path
      root_dir = File.dirname(xcodeproj_path)
      info =  Dir["#{root_dir}/**/*-Info.plist"].first
      raise "Couldn't find infoplist" if info.nil?
      return info
    end

    def xcodeproj_path
      platform_config = base_config.build_platform_config(:ios)
      destination_dir = platform_config.destination
      root_dir = destination_dir
      while true
        glob = Dir[File.join(root_dir, "*.xcodeproj")]
        return glob.first if (glob.length > 0)
        root_dir = File.expand_path("..", root_dir)
        raise "Couldn't find xcodeproj near #{destination_dir}" if root_dir == '/'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
high_five-0.2.2 lib/high_five/ios_helper.rb
high_five-0.2.1 lib/high_five/ios_helper.rb
high_five-0.2.0 lib/high_five/ios_helper.rb