Sha256: 4d3590de9b926f054e1baddf47ae39274f872bda24485966a60d2a9bc5631dfd

Contents?: true

Size: 1.3 KB

Versions: 40

Compression:

Stored size: 1.3 KB

Contents

module Bake

  class ProjectFilter

    def initialize(options)
      @@filterList = nil
      @@valid = nil
      @@options = options
    end

    def self.projects
      calcFilter_internal() if @@filterList.nil?
      return @@filterList
    end

    def self.is_valid?
      calcFilter_internal() if @@valid.nil?
      return @@valid
    end

    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

    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

    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

  end

end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
bake-toolkit-2.72.0 lib/bakeqac/filter.rb
bake-toolkit-2.71.0 lib/bakeqac/filter.rb
bake-toolkit-2.70.1 lib/bakeqac/filter.rb
bake-toolkit-2.70.0 lib/bakeqac/filter.rb
bake-toolkit-2.69.0 lib/bakeqac/filter.rb
bake-toolkit-2.68.1 lib/bakeqac/filter.rb
bake-toolkit-2.68.0 lib/bakeqac/filter.rb
bake-toolkit-2.67.0 lib/bakeqac/filter.rb
bake-toolkit-2.66.0 lib/bakeqac/filter.rb
bake-toolkit-2.65.2 lib/bakeqac/filter.rb
bake-toolkit-2.65.1 lib/bakeqac/filter.rb
bake-toolkit-2.65.0 lib/bakeqac/filter.rb
bake-toolkit-2.64.4 lib/bakeqac/filter.rb
bake-toolkit-2.64.3 lib/bakeqac/filter.rb
bake-toolkit-2.64.2 lib/bakeqac/filter.rb
bake-toolkit-2.64.1 lib/bakeqac/filter.rb
bake-toolkit-2.64.0 lib/bakeqac/filter.rb
bake-toolkit-2.63.2 lib/bakeqac/filter.rb
bake-toolkit-2.63.1 lib/bakeqac/filter.rb
bake-toolkit-2.63.0 lib/bakeqac/filter.rb