Class: Xctracker::DerivedData

Inherits:
Object
  • Object
show all
Defined in:
lib/xctracker/derived_data.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DerivedData

Returns a new instance of DerivedData.



35
36
37
# File 'lib/xctracker/derived_data.rb', line 35

def initialize(path)
  @path = path
end

Class Method Details

.allObject



6
7
8
9
# File 'lib/xctracker/derived_data.rb', line 6

def all
  pattern = File.join(derived_data_root, "**", "Logs", "Build", "*.xcactivitylog")
  by_pattern(pattern)
end

.by_product_name(product_name) ⇒ Object



11
12
13
14
# File 'lib/xctracker/derived_data.rb', line 11

def by_product_name(product_name)
  pattern = File.join(derived_data_root, "#{product_name}-*", "Logs", "Build", "*.xcactivitylog")
  by_pattern(pattern)
end

Instance Method Details

#executionsObject



43
44
45
46
47
48
49
50
# File 'lib/xctracker/derived_data.rb', line 43

def executions
  @executions ||= lines.map { |line|
    if line =~ /^\d*\.?\dms\t/
      time, file, method_name = line.split(/\t/)
      Execution.new(time, file, method_name)
    end
  }.compact
end

#flag_enabled?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/xctracker/derived_data.rb', line 52

def flag_enabled?
  lines.any? { |l| l.include?('-Xfrontend -debug-time-function-bodies') }
end

#updated_atObject



39
40
41
# File 'lib/xctracker/derived_data.rb', line 39

def updated_at
  File.mtime(@path)
end