Sha256: 8d5b58fb248a2172b6cb19e2c1c5b4d33115a0fb791cc7d40e0f750bec934ce2

Contents?: true

Size: 637 Bytes

Versions: 48

Compression:

Stored size: 637 Bytes

Contents

# -*- coding: utf-8 -*-
#
# @file 
# @brief
# @author ongaeshi
# @date   2012/03/02

require 'milkode/common/ignore_setting.rb'

module Milkode
  #
  # Sample:
  #   c = IgnoreChecker.new
  #   c.add IgnoreSetting.new("/", ["/rdoc", "/test/data", "*.lock"])
  #   c.add IgnoreSetting.new("/pkg", ["*.gem"])
  #   c.ignore?('/lib/test.rb')  #=> false
  #   c.ignore?('/pkg/hoge.gem') #=> true
  #
  class IgnoreChecker
    attr_reader :settings
    
    def initialize
      @settings = []
    end

    def add(setting)
      @settings << setting
    end

    def ignore?(path)
      @settings.any?{|s| s.ignore? path }
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
milkode-1.8.9.2 lib/milkode/common/ignore_checker.rb
milkode-1.8.9.1 lib/milkode/common/ignore_checker.rb
milkode-1.8.9 lib/milkode/common/ignore_checker.rb
milkode-1.8.8 lib/milkode/common/ignore_checker.rb
milkode-1.8.7 lib/milkode/common/ignore_checker.rb
milkode-1.8.6 lib/milkode/common/ignore_checker.rb
milkode-1.8.5 lib/milkode/common/ignore_checker.rb
milkode-1.8.4 lib/milkode/common/ignore_checker.rb
milkode-1.8.3 lib/milkode/common/ignore_checker.rb
milkode-1.8.2 lib/milkode/common/ignore_checker.rb
milkode-1.8.1 lib/milkode/common/ignore_checker.rb
milkode-1.8.0 lib/milkode/common/ignore_checker.rb
milkode-1.7.1 lib/milkode/common/ignore_checker.rb
milkode-1.7.0 lib/milkode/common/ignore_checker.rb
milkode-1.6.1 lib/milkode/common/ignore_checker.rb
milkode-1.6.0 lib/milkode/common/ignore_checker.rb
milkode-1.5.0 lib/milkode/common/ignore_checker.rb
milkode-1.4.0 lib/milkode/common/ignore_checker.rb
milkode-1.3.0 lib/milkode/common/ignore_checker.rb
milkode-1.2.0 lib/milkode/common/ignore_checker.rb