class Xcodeproj::Command

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/xcodeproj/command.rb, line 18
def initialize(argv)
  super
  unless self.ansi_output?
    Colored2.disable!
    String.send(:define_method, :colorize) { |string, _| string }
  end
end

Private Instance Methods

open_project!(*paths) click to toggle source
# File lib/xcodeproj/command.rb, line 50
def open_project!(*paths)
  if paths.empty?
    [xcodeproj]
  else
    paths.map { |path| Project.open(path) }
  end
end
xcodeproj() click to toggle source
# File lib/xcodeproj/command.rb, line 62
def xcodeproj
  @xcodeproj ||= Project.open(xcodeproj_path)
end
xcodeproj_path() click to toggle source
# File lib/xcodeproj/command.rb, line 28
def xcodeproj_path
  unless @xcodeproj_path
    projects = Dir.glob('*.xcodeproj')
    if projects.size == 1
      xcodeproj_path = projects.first
    elsif projects.size > 1
      raise Informative, 'There are more than one Xcode project documents ' \
                         'in the current working directory. Please specify ' \
                         'the project as the first argument, or specify ' \
                         'which to use with the --project option if using ' \
                         'target-diff.'
    else
      raise Informative, 'No Xcode project document found in the current ' \
                         'working directory. Please specify the project ' \
                         'as the first argument, or specify which to use ' \
                         'with the --project option if using target-diff.' \
    end
    @xcodeproj_path = Pathname.new(xcodeproj_path).expand_path
  end
  @xcodeproj_path
end
xcodeproj_path=(path) click to toggle source
# File lib/xcodeproj/command.rb, line 58
def xcodeproj_path=(path)
  @xcodeproj_path = path && Pathname.new(path).expand_path
end