Sha256: 54c950a4eed6972458ee6ffac7b8072e74c302b11adca2d66ba05d56c52df2ba

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

require 'cfpropertylist'
require 'lagunitas'
module Lagunitas
  class App
    def initialize(path, root)
      @path = path
      @root = root
    end
    def name
      @info['CFBundleName']
    end
    def mobileprovision
      return if !mobileprovision?
      @mobileprovision ||= CFPropertyList.native_types CFPropertyList::List.new(:data => `security cms -D -i #{File.join @path, 'embedded.mobileprovision'}`).value
    end
    def mobileprovision?
      return true if @mobileprovision
      File.exists? File.join @path, 'embedded.mobileprovision'
    end
    def devices
      mobileprovision['ProvisionedDevices'] if mobileprovision
    end
    def distribution_name
      # mobileprovision['DeveloperCertificates'] if mobileprovision
      "#{mobileprovision['Name']}: #{mobileprovision['TeamName']}" if mobileprovision
    end
    def metadata
      return if !metadata?
      @metadata ||= CFPropertyList.native_types(CFPropertyList::List.new(file: File.join(@root, 'iTunesMetadata.plist')).value)
    end
    def metadata?
      return true if @metadata
      File.exists? File.join @root, 'iTunesMetadata.plist'
    end
    def release_type
      @release_type ||= begin
        if mobileprovision?
          if devices
            'adhoc'
          else
            'inhouse'
          end
        elsif metadata?
          'store'
        else
          'adhoc'
        end
      end
    end
  end
  class IPA
    def root_path
      contents
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fir-cli-0.2.0 lib/lagunitas.ext.rb
fir-cli-0.1.9 lib/lagunitas.ext.rb
fir-cli-0.1.8 lib/lagunitas.ext.rb