Sha256: 81054d5043981b80249c774a96b04a9b452eef3b5e959572617c37983deab820

Contents?: true

Size: 906 Bytes

Versions: 25

Compression:

Stored size: 906 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

      # We do all this, because we would get all kind of crap output generated by xcodebuild
      # so we need to ignore stderror
      output = ''
      Open3.popen3('xcodebuild -version -sdk') do |stdin, stdout, stderr, wait_thr|
        output = stdout.read
      end

      matched = output.match(/iOS ([\d\.]+) \(.*/)
      if matched.nil?
        raise "Could not determine installed iOS SDK version. Try running the _xcodebuild_ command manually to ensure it works."
      elsif 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

25 entries across 25 versions & 1 rubygems

Version Path
snapshot-1.12.1 lib/snapshot/latest_ios_version.rb
snapshot-1.12.0 lib/snapshot/latest_ios_version.rb
snapshot-1.11.1 lib/snapshot/latest_ios_version.rb
snapshot-1.11.0 lib/snapshot/latest_ios_version.rb
snapshot-1.10.0 lib/snapshot/latest_ios_version.rb
snapshot-1.9.0 lib/snapshot/latest_ios_version.rb
snapshot-1.8.0 lib/snapshot/latest_ios_version.rb
snapshot-1.7.0 lib/snapshot/latest_ios_version.rb
snapshot-1.6.0 lib/snapshot/latest_ios_version.rb
snapshot-1.5.0 lib/snapshot/latest_ios_version.rb
snapshot-1.4.4 lib/snapshot/latest_ios_version.rb
snapshot-1.4.3 lib/snapshot/latest_ios_version.rb
snapshot-1.4.2 lib/snapshot/latest_ios_version.rb
snapshot-1.4.1 lib/snapshot/latest_ios_version.rb
snapshot-1.4.0 lib/snapshot/latest_ios_version.rb
snapshot-1.3.0 lib/snapshot/latest_ios_version.rb
snapshot-1.2.2 lib/snapshot/latest_ios_version.rb
snapshot-1.2.1 lib/snapshot/latest_ios_version.rb
snapshot-1.2.0 lib/snapshot/latest_ios_version.rb
snapshot-1.1.1 lib/snapshot/latest_ios_version.rb