Class: Xcprofiler::DerivedData
- Inherits:
-
Object
- Object
- Xcprofiler::DerivedData
- Defined in:
- lib/xcprofiler/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
- #zero? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ DerivedData
Returns a new instance of DerivedData.
37 38 39 |
# File 'lib/xcprofiler/derived_data.rb', line 37 def initialize(path) @path = path end |
Class Method Details
.all(root = nil) ⇒ Object
6 7 8 9 10 |
# File 'lib/xcprofiler/derived_data.rb', line 6 def all(root = nil) root ||= default_derived_data_root pattern = File.join(root, "**", "Logs", "Build", "*.xcactivitylog") by_pattern(pattern) end |
.by_product_name(product_name, root = nil) ⇒ Object
12 13 14 15 16 |
# File 'lib/xcprofiler/derived_data.rb', line 12 def by_product_name(product_name, root = nil) root ||= default_derived_data_root pattern = File.join(root, "#{product_name}-*", "Logs", "Build", "*.xcactivitylog") by_pattern(pattern) end |
Instance Method Details
#executions ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/xcprofiler/derived_data.rb', line 49 def executions @executions ||= lines.map { |line| if line =~ /^[0-9.]+ms\s+.+?\s+.+$/ time, file, method_name = line.split(/\t/) Execution.new(time, file, method_name) end }.compact end |
#flag_enabled? ⇒ Boolean
58 59 60 |
# File 'lib/xcprofiler/derived_data.rb', line 58 def flag_enabled? lines.any? { |l| l.include?('-Xfrontend -debug-time-function-bodies') } end |
#updated_at ⇒ Object
45 46 47 |
# File 'lib/xcprofiler/derived_data.rb', line 45 def updated_at File.mtime(@path) end |
#zero? ⇒ Boolean
41 42 43 |
# File 'lib/xcprofiler/derived_data.rb', line 41 def zero? File.zero?(@path) end |