Class: Yolo::Tasks::Ios::Coverage
- Defined in:
- lib/yolo/tasks/ios/coverage.rb
Overview
Executes all code coverage related tasks
Instance Method Summary collapse
-
#build_path ⇒ String
Uses Xcode to find the full path to the build objects.
-
#define ⇒ Object
Defines rake tasks available to the Coverage class.
-
#initialize ⇒ Coverage
constructor
Initializes the class with default settings.
Methods inherited from BaseTask
Constructor Details
Instance Method Details
#build_path ⇒ String
Uses Xcode to find the full path to the build objects
23 24 25 26 27 28 29 30 |
# File 'lib/yolo/tasks/ios/coverage.rb', line 23 def build_path files = [] Find.find(@xcode.build_path) do |path| files << path if path =~ /.*#{name}-.*\/Build\/Intermediates\/#{name}.build\/.*-iphonesimulator\/#{name}.build\/Objects-normal/ end latest = files.sort_by { |filename| File.mtime(filename)}.last # get the latest latest.split("/")[0..-2].join("/") if latest # remove the file and get the dir end |
#define ⇒ Object
Defines rake tasks available to the Coverage class
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/yolo/tasks/ios/coverage.rb', line 35 def define super namespace :yolo do namespace :coverage do desc "Calculates the specified scheme(s) test coverage." task :calculate do Yolo::Tools::Ios::Coverage.calculate(build_path.gsub(" ", "\\ "), Dir.pwd) end end end end |