Sha256: 51b14b47dcd33139a11331b9b7852120e0d9e3d58e89855995c3694f739c4194

Contents?: true

Size: 1.93 KB

Versions: 12

Compression:

Stored size: 1.93 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 ios_path
      if options[:platform_path]
        ios_path = File.expand_path options[:platform_path]
      else
        ios_path = File.dirname xcodeproj_path
      end

      if !ios_path
        raise "Couldn't find the path of the xcodeproj."
      end

      ios_path
    end

    def info_plist_path(target=nil)
      root_dir = ios_path
      target = "*" if target.nil?
      Dir["#{root_dir}/**/#{target}-Info.plist", "#{root_dir}/**/Info.plist"].each do |path|
        next if path =~ /\/build\//
        next if path =~ /\.xcarchive/
        return path
      end
      raise "Couldn't find infoplist in #{root_dir}"
    end

    def xcodeproj_path
      platform_config = base_config.build_platform_config(:ios)
      destination_dir = platform_config.destination
      if platform_config.cordova_path
        destination_dir ||= "#{platform_config.cordova_path}/platforms/ios"
      end
      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

    def ios_icon_sizes
      {
        old_iphone: 57,
        old_iphone_retina: 114,
        iphone_retina: 120,
        old_ipad: 72,
        old_ipad_retina: 177,
        ipad: 76,
        ipad_retina: 152,
        old_spotlight: 29,
        old_spotlight_retina: 58,
        spotlight: 40,
        spotlight_retina: 80,
        spotlight_ipad: 50,
        spotlight_ipad_retina: 100
      }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
high_five-0.3.23 lib/high_five/ios_helper.rb
high_five-0.3.22 lib/high_five/ios_helper.rb
high_five-0.3.21 lib/high_five/ios_helper.rb
high_five-0.3.20 lib/high_five/ios_helper.rb
high_five-0.3.19 lib/high_five/ios_helper.rb
high_five-0.3.18 lib/high_five/ios_helper.rb
high_five-0.3.17 lib/high_five/ios_helper.rb
high_five-0.3.16 lib/high_five/ios_helper.rb
high_five-0.3.15 lib/high_five/ios_helper.rb
high_five-0.3.14 lib/high_five/ios_helper.rb
high_five-0.3.13 lib/high_five/ios_helper.rb
high_five-0.3.12 lib/high_five/ios_helper.rb