Module: Xcodeproj::Project::XCProjHelper

Defined in:
lib/xcodeproj/project/xcproj_helper.rb

Class Method Summary collapse

Class Method Details

.available?Bool

Returns Whether the xcproj tool is available.

Returns:

  • (Bool)

    Whether the xcproj tool is available.


7
8
9
10
# File 'lib/xcodeproj/project/xcproj_helper.rb', line 7

def available?
  `which xcproj`
  $?.exitstatus.zero?
end

.touch(path) ⇒ void

This method returns an undefined value.

Touches the project at the given path if the xcproj tool is available.


17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/xcodeproj/project/xcproj_helper.rb', line 17

def touch(path)
  if available?
    command = "xcproj --project \"#{path}\" touch"
    success, output = execute(command)
    unless success
      message = 'The `xcproj` tool has failed to touch the project. ' \
                'Check whether your installation of `xcproj` is ' \
                "functional.\n\n"
      message << command << "\n"
      message << output
      UI.warn(message)
    end
  end
end