Class: SimLauncher::SdkDetector
- Inherits:
-
Object
- Object
- SimLauncher::SdkDetector
- Defined in:
- lib/sim_launcher/sdk_detector.rb
Instance Method Summary collapse
- #available_sdk_versions ⇒ Object
-
#initialize(simulator = Simulator.new) ⇒ SdkDetector
constructor
A new instance of SdkDetector.
- #latest_sdk_version ⇒ Object
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_versions ⇒ Object
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_version ⇒ Object
14 15 16 |
# File 'lib/sim_launcher/sdk_detector.rb', line 14 def latest_sdk_version available_sdk_versions.sort.last end |