Class: Xctracker::DerivedData
- Inherits:
-
Object
- Object
- Xctracker::DerivedData
- Defined in:
- lib/xctracker/derived_data.rb
Class Method Summary collapse
Instance Method Summary collapse
- #executions ⇒ Object
- #flag_enabled? ⇒ Boolean
-
#initialize(path) ⇒ DerivedData
constructor
A new instance of DerivedData.
- #updated_at ⇒ Object
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
.all ⇒ Object
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
#executions ⇒ Object
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
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_at ⇒ Object
39 40 41 |
# File 'lib/xctracker/derived_data.rb', line 39 def updated_at File.mtime(@path) end |