Sha256: 6ee79cef79b98eaade0cdaaa970223b5b6d2c5d6730c01453115105f1f96dfb2

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

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(target=nil)
      root_dir = File.dirname(xcodeproj_path)
      target = "*" if target.nil?
      info =  Dir["#{root_dir}/**/#{target}-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

4 entries across 4 versions & 1 rubygems

Version Path
high_five-0.2.6 lib/high_five/ios_helper.rb
high_five-0.2.5 lib/high_five/ios_helper.rb
high_five-0.2.4 lib/high_five/ios_helper.rb
high_five-0.2.3 lib/high_five/ios_helper.rb