Class: Ive::Xcode

Inherits:
Object
  • Object
show all
Defined in:
lib/ive/xcode.rb

Instance Method Summary collapse

Instance Method Details

#configObject



5
6
7
8
9
10
11
12
# File 'lib/ive/xcode.rb', line 5

def config
  return nil unless Ive.config.valid?

  project.target(Ive.config.target).config(Ive.config.configuration)
rescue Exception => e
  puts "-- #{e.message}"
  nil
end

#initial_configObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ive/xcode.rb', line 14

def initial_config
  if project.targets.count > 0 && (target = project.targets.first)
    if target.configs.count > 0 && (config = target.configs.first)
      { target: target.name, configuration: config.name }
    else
      puts "-- No configurations found for target '#{target.name}' in the current project"
    end
  else
    puts "-- No targets found in the current project"
  end
end

#projectObject



26
27
28
# File 'lib/ive/xcode.rb', line 26

def project
  @project ||= ::Xcode.project self.project_path
end

#project_pathObject



30
31
32
# File 'lib/ive/xcode.rb', line 30

def project_path
  @project_path ||= Dir.glob("#{Ive.path}/*.xcodeproj").first
end