Class: CarthageCacheRes::BuildCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/carthage_cache_res/build_collector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(terminal, build_directory, required_frameworks, command_executor = ShellCommandExecutor.new) ⇒ BuildCollector

Returns a new instance of BuildCollector.



12
13
14
15
16
17
# File 'lib/carthage_cache_res/build_collector.rb', line 12

def initialize(terminal, build_directory, required_frameworks, command_executor = ShellCommandExecutor.new)
  @terminal = terminal
  @build_directory = build_directory
  @required_frameworks = Set.new(required_frameworks)
  @command_executor = command_executor
end

Instance Attribute Details

#build_directoryObject (readonly)

Returns the value of attribute build_directory.



8
9
10
# File 'lib/carthage_cache_res/build_collector.rb', line 8

def build_directory
  @build_directory
end

#command_executorObject (readonly)

Returns the value of attribute command_executor.



10
11
12
# File 'lib/carthage_cache_res/build_collector.rb', line 10

def command_executor
  @command_executor
end

#required_frameworksObject (readonly)

Returns the value of attribute required_frameworks.



9
10
11
# File 'lib/carthage_cache_res/build_collector.rb', line 9

def required_frameworks
  @required_frameworks
end

#terminalObject (readonly)

Returns the value of attribute terminal.



7
8
9
# File 'lib/carthage_cache_res/build_collector.rb', line 7

def terminal
  @terminal
end

Instance Method Details

#delete_unused_frameworks(white_list = {}) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/carthage_cache_res/build_collector.rb', line 19

def delete_unused_frameworks(white_list = {})
  terminal.vputs "Deleting unused frameworks from '#{build_directory}' ..."
  list_built_frameworks.each do |framework_path|
    if delete_framework?(framework_path, white_list)
      delete_framework_files(framework_path)
    end
  end
end