Class: RakeDotNet::NCoverConsoleCmd
- Inherits:
-
Object
- Object
- RakeDotNet::NCoverConsoleCmd
- Defined in:
- lib/rake_dotnet.rb
Instance Method Summary collapse
- #bi ⇒ Object
- #cmd ⇒ Object
- #cmdToRun ⇒ Object
- #exclude_assemblies ⇒ Object
- #iis ⇒ Object
-
#initialize(report_dir, dll_to_execute, params) ⇒ NCoverConsoleCmd
constructor
A new instance of NCoverConsoleCmd.
- #run ⇒ Object
- #working_dir ⇒ Object
Constructor Details
#initialize(report_dir, dll_to_execute, params) ⇒ NCoverConsoleCmd
Returns a new instance of NCoverConsoleCmd.
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 |
# File 'lib/rake_dotnet.rb', line 848 def initialize(report_dir, dll_to_execute, params) params ||= {} arch = params[:arch] || ENV['PROCESSOR_ARCHITECTURE'] @exe = params[:ncover_exe] || File.join(TOOLS_DIR, 'ncover', arch, 'ncover.console.exe') @dll_to_execute = dll_to_execute ofname = File.split(dll_to_execute)[1].sub(/(\.dll)/, '') + '.coverage.xml' @output_file = File.join(report_dir, ofname) @exclude_assemblies_regex = params[:exclude_assemblies_regex] || ['.*Tests.*'] @exclude_assemblies_regex.push('ISymWrapper') @profile_iis = params[:profile_iis] || false @working_dir = params[:working_dir] || Pathname.new(@dll_to_execute).dirname @is_complete_version = `#{@exe}`.include?('NCover Complete v') end |
Instance Method Details
#bi ⇒ Object
870 871 872 |
# File 'lib/rake_dotnet.rb', line 870 def bi return "//bi #{Versioner.new.get.to_s}" end |
#cmd ⇒ Object
892 893 894 |
# File 'lib/rake_dotnet.rb', line 892 def cmd "\"#{@exe}\" #{cmdToRun} //x #{@output_file} #{exclude_assemblies} #{bi} #{working_dir} #{iis}" end |
#cmdToRun ⇒ Object
865 866 867 868 |
# File 'lib/rake_dotnet.rb', line 865 def cmdToRun x = XUnitConsoleCmd.new(@dll_to_execute, '', nil, {}) x.cmd end |
#exclude_assemblies ⇒ Object
883 884 885 886 887 888 889 890 |
# File 'lib/rake_dotnet.rb', line 883 def exclude_assemblies return '' unless @is_complete_version if @exclude_assemblies_regex.instance_of?(Array) && @exclude_assemblies_regex.length > 0 return '//eas ' + @exclude_assemblies_regex.join(';') end return '//eas ' + @exclude_assemblies_regex if @exclude_assemblies_regex.instance_of?(String) return '' end |
#iis ⇒ Object
878 879 880 881 |
# File 'lib/rake_dotnet.rb', line 878 def iis return '' unless @is_complete_version return "//iis" if @profile_iis end |
#run ⇒ Object
896 897 898 899 |
# File 'lib/rake_dotnet.rb', line 896 def run puts cmd if VERBOSE sh cmd end |
#working_dir ⇒ Object
874 875 876 |
# File 'lib/rake_dotnet.rb', line 874 def working_dir return "//w #{@working_dir}" end |