Class: Snapshot::DependencyChecker
- Inherits:
-
Object
- Object
- Snapshot::DependencyChecker
- Defined in:
- lib/snapshot/dependency_checker.rb
Class Method Summary collapse
- .check_dependencies ⇒ Object
- .check_simulators ⇒ Object
- .check_xcode_select ⇒ Object
- .check_xctool ⇒ Object
- .xctool_installed? ⇒ Boolean
Class Method Details
.check_dependencies ⇒ Object
3 4 5 6 7 |
# File 'lib/snapshot/dependency_checker.rb', line 3 def self.check_dependencies self.check_xcode_select self.check_simulators self.check_xctool end |
.check_simulators ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/snapshot/dependency_checker.rb', line 20 def self.check_simulators Helper.log.debug "Found #{SnapshotFile.available_devices.count} simulators." if SnapshotFile.available_devices.count < 1 Helper.log.fatal '#############################################################' Helper.log.fatal "# You have to add new simulators using Xcode" Helper.log.fatal "# Xcode => Window => Devices" Helper.log.fatal '#############################################################' raise "Create the new simulators and run this script again" end end |
.check_xcode_select ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/snapshot/dependency_checker.rb', line 9 def self.check_xcode_select unless `xcode-select -v`.include?"xcode-select version " Helper.log.fatal '#############################################################' Helper.log.fatal "# You have to install the Xcode commdand line tools to use deliver" Helper.log.fatal "# Install the latest version of Xcode from the AppStore" Helper.log.fatal "# Run xcode-select --install to install the developer tools" Helper.log.fatal '#############################################################' raise "Run 'xcode-select --install' and start deliver again" end end |
.check_xctool ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/snapshot/dependency_checker.rb', line 35 def self.check_xctool if not self.xctool_installed? Helper.log.error '#############################################################' Helper.log.error "# xctool is recommended to build the apps" Helper.log.error "# Install it using 'brew install xctool'" Helper.log.error "# Falling back to xcode build instead " Helper.log.error '#############################################################' end end |
.xctool_installed? ⇒ Boolean
31 32 33 |
# File 'lib/snapshot/dependency_checker.rb', line 31 def self.xctool_installed? return `which xctool`.length > 1 end |