Class: Bake::ProjectFilter
- Inherits:
-
Object
- Object
- Bake::ProjectFilter
- Defined in:
- lib/bakeqac/filter.rb
Class Method Summary collapse
- .calcFilter_internal ⇒ Object
- .is_valid? ⇒ Boolean
- .localFile(str) ⇒ Object
- .projects ⇒ Object
- .writeFilter(filter) ⇒ Object
Instance Method Summary collapse
-
#initialize(options) ⇒ ProjectFilter
constructor
A new instance of ProjectFilter.
Constructor Details
#initialize(options) ⇒ ProjectFilter
Returns a new instance of ProjectFilter.
5 6 7 8 9 |
# File 'lib/bakeqac/filter.rb', line 5 def initialize() @@filterList = nil @@valid = nil @@options = end |
Class Method Details
.calcFilter_internal ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/bakeqac/filter.rb', line 39 def self.calcFilter_internal @@filterList = [] filter_filename = "#{@@options.qacdata}/filter.txt" @@valid = File.exist?(filter_filename) if @@valid File.open(filter_filename, "r") do |f| f.each_line { |line| @@filterList << line.strip } end end end |
.is_valid? ⇒ Boolean
16 17 18 19 |
# File 'lib/bakeqac/filter.rb', line 16 def self.is_valid? calcFilter_internal() if @@valid.nil? return @@valid end |
.localFile(str) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/bakeqac/filter.rb', line 21 def self.localFile(str) return true if (not is_valid?) || (not @@options.qacfilefilter) projects.any? { |fil| str.include?(fil+"/") && !str.include?(fil+"/test/") && !str.include?(fil+"/mock/") && !str.include?(fil+"/.qacdata/") && !str.include?("/mergedIncludes") } end |
.projects ⇒ Object
11 12 13 14 |
# File 'lib/bakeqac/filter.rb', line 11 def self.projects calcFilter_internal() if @@filterList.nil? return @@filterList end |
.writeFilter(filter) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/bakeqac/filter.rb', line 30 def self.writeFilter(filter) filter_filename = "#{@@options.qacdata}/filter.txt" File.open(filter_filename, "w+") do |f| filter.uniq! filter.delete_if { |f| (f.end_with? "/gtest") or (f.end_with? "/gmock") } f.puts(filter) end end |