Class: RakeDotNet::NCoverReportingCmd
- Inherits:
-
Object
- Object
- RakeDotNet::NCoverReportingCmd
- Defined in:
- lib/rake_dotnet.rb
Instance Method Summary collapse
- #build_id ⇒ Object
- #cmd ⇒ Object
- #coverage_files ⇒ Object
-
#initialize(report_dir, coverage_files, params) ⇒ NCoverReportingCmd
constructor
A new instance of NCoverReportingCmd.
- #output_path ⇒ Object
- #output_reports ⇒ Object
- #project_name ⇒ Object
- #run ⇒ Object
- #sort_order ⇒ Object
Constructor Details
#initialize(report_dir, coverage_files, params) ⇒ NCoverReportingCmd
Returns a new instance of NCoverReportingCmd.
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 |
# File 'lib/rake_dotnet.rb', line 903 def initialize(report_dir, coverage_files, params) @report_dir = report_dir @coverage_files = coverage_files || [] params ||= {} arch = params[:arch] || ENV['PROCESSOR_ARCHITECTURE'] @exe = params[:ncover_reporting_exe] || File.join(TOOLS_DIR, 'ncover', arch, 'ncover.reporting.exe') @is_complete_version = `#{@exe}`.include?('NCover Reporting Complete v') # required @reports = params[:reports] || ['Summary', 'UncoveredCodeSections', 'FullCoverageReport'] @output_path = File.join(@report_dir) # optional @sort_order = params[:sort] || 'CoveragePercentageAscending' @project_name = params[:project_name] || PRODUCT_NAME end |
Instance Method Details
#build_id ⇒ Object
929 930 931 |
# File 'lib/rake_dotnet.rb', line 929 def build_id return "//bi #{Versioner.new.get.to_s}" end |
#cmd ⇒ Object
960 961 962 |
# File 'lib/rake_dotnet.rb', line 960 def cmd return "\"#{@exe}\" #{coverage_files} #{build_id} #{output_reports} #{output_path} #{sort_order} #{project_name}" end |
#coverage_files ⇒ Object
921 922 923 924 925 926 927 |
# File 'lib/rake_dotnet.rb', line 921 def coverage_files list = '' @coverage_files.each do |cf| list += "\"#{cf}\" " end return list end |
#output_path ⇒ Object
948 949 950 |
# File 'lib/rake_dotnet.rb', line 948 def output_path return "//op \"#{@output_path}\"" end |
#output_reports ⇒ Object
933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
# File 'lib/rake_dotnet.rb', line 933 def output_reports cmd = '' if @is_complete_version @reports.each do |r| cmd += "//or #{r} " end else classic_version_reports_allowed = ['Summary', 'SymbolModule', 'SymbolModuleNamespace', 'SymbolModuleNamespaceClass', 'SymbolModuleNamespaceClassMethod'] @reports.each do |r| cmd += "//or #{r} " if classic_version_reports_allowed.include?(r) end end return cmd end |
#project_name ⇒ Object
956 957 958 |
# File 'lib/rake_dotnet.rb', line 956 def project_name return "//p #{@project_name}" unless @project_name.nil? end |
#run ⇒ Object
964 965 966 967 |
# File 'lib/rake_dotnet.rb', line 964 def run puts cmd if VERBOSE sh cmd end |
#sort_order ⇒ Object
952 953 954 |
# File 'lib/rake_dotnet.rb', line 952 def sort_order return "//so #{@sort_order}" end |