Class: Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/spinjector/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path, configuration_file_path, logger) ⇒ Runner

Returns a new instance of Runner.



14
15
16
17
18
19
# File 'lib/spinjector/runner.rb', line 14

def initialize(project_path, configuration_file_path, logger)
  raise "[Error] No xcodeproj found at #{project_path}" unless File.exist?(project_path)
  @project = Xcodeproj::Project.open(project_path)
  @configuration_file_path = configuration_file_path
  @logger = logger
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



12
13
14
# File 'lib/spinjector/runner.rb', line 12

def project
  @project
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
28
29
# File 'lib/spinjector/runner.rb', line 21

def run
  configuration = YAMLParser.new(@configuration_file_path, @logger).configuration

  project_service = ProjectService.new(project, @logger)
  project_service.update_scripts_in_targets(configuration)

  @project.save()
  @logger.log "Success."
end