Class: SimLauncher::SdkDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/sim_launcher/sdk_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(simulator = Simulator.new) ⇒ SdkDetector

Returns a new instance of SdkDetector.



4
5
6
# File 'lib/sim_launcher/sdk_detector.rb', line 4

def initialize(simulator = Simulator.new)
  @simulator = simulator
end

Instance Method Details

#available_sdk_versionsObject



8
9
10
11
12
# File 'lib/sim_launcher/sdk_detector.rb', line 8

def available_sdk_versions
  @simulator.showsdks.split("\n").map { |sdk_line|
    sdk_line[/\(([\d.]+)\)$/,1] # grab any "(x.x)" part at the end of the line
  }.compact
end

#latest_sdk_versionObject



14
15
16
# File 'lib/sim_launcher/sdk_detector.rb', line 14

def latest_sdk_version
  available_sdk_versions.sort.last
end