class Instrumentality::Finder

Public Class Methods

find_project() click to toggle source
# File lib/instrumentality/finder.rb, line 7
def self.find_project
  find('*.xcodeproj', 2).first
end
find_workspace() click to toggle source
# File lib/instrumentality/finder.rb, line 3
def self.find_workspace
  find('*.xcworkspace', 2).first
end
find_xctestrun(location) click to toggle source
# File lib/instrumentality/finder.rb, line 11
def self.find_xctestrun(location)
  find('*.xctestrun', 0, location).first
end
path_for_header(name) click to toggle source
# File lib/instrumentality/finder.rb, line 20
def self.path_for_header(name)
  File.expand_path("../headers/#{name}", __FILE__)
end
path_for_script(name) click to toggle source
# File lib/instrumentality/finder.rb, line 15
def self.path_for_script(name)
  return name if File.exist?(name)
  File.expand_path("../scripts/#{name}", __FILE__)
end

Private Class Methods

find(name, depth = 0, location = '.') click to toggle source
# File lib/instrumentality/finder.rb, line 24
def self.find(name, depth = 0, location = '.')
  cmd = %W[find #{location} -name '#{name}']
  cmd += %W[-maxdepth #{depth}] if depth > 0
  `#{cmd.join(' ')}`.split("\n")
end