Sha256: ad62a004f9abc174a9cbdd0caf16fde3a5e5addae743d13bd05d2b4a3658a40a

Contents?: true

Size: 588 Bytes

Versions: 4

Compression:

Stored size: 588 Bytes

Contents

module Snapshot
  class LatestIosVersion
    @version = nil
    def self.version
      return ENV["SNAPSHOT_IOS_VERSION"] if ENV["SNAPSHOT_IOS_VERSION"]
      return @version if @version

      output = `xcodebuild -version -sdk`.split("Mac").last # don't care about the Mac Part
      matched = output.match(/iPhoneSimulator([\d\.]+)\.sdk/)
      
      if matched.length > 1
        return @version ||= matched[1]
      else
        raise "Could not determine installed iOS SDK version. Please pass it via the environment variable 'SNAPSHOT_IOS_VERSION'".red
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
snapshot-0.10.2 lib/snapshot/latest_ios_version.rb
snapshot-0.10.1 lib/snapshot/latest_ios_version.rb
snapshot-0.10.0 lib/snapshot/latest_ios_version.rb
snapshot-0.9.3 lib/snapshot/latest_ios_version.rb