lib/snapshot/snapshot_file.rb in snapshot-0.3.0 vs lib/snapshot/snapshot_file.rb in snapshot-0.3.1
- old
+ new
@@ -69,12 +69,12 @@
raise "Devices has to be an array".red unless value.kind_of?Array
@config.devices = []
value.each do |current|
current += " (#{@config.ios_version} Simulator)" unless current.include?"Simulator"
- unless SnapshotFile.available_devices.include?current
- raise "Device '#{current}' not found. Available device types: #{SnapshotFile.available_devices}".red
+ unless Simulators.available_devices.include?current
+ raise "Device '#{current}' not found. Available device types: #{Simulators.available_devices}".red
else
@config.devices << current
end
end
end
@@ -85,19 +85,8 @@
unless Languages::ALL_LANGUAGES.include?current
raise "Language '#{current}' not found. Available languages: #{Languages::ALL_LANGUAGES}".red
end
end
@config.languages = value
- end
-
- def self.available_devices
- if not @result
- @result = []
- `instruments -s`.split("\n").each do |current|
- # Example: "iPhone 5 (8.1 Simulator) [C49ECC4A-5A3D-44B6-B9BF-4E25BC326400]"
- @result << current.split(' [').first if current.include?"Simulator"
- end
- end
- return @result
end
end
end
\ No newline at end of file