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.1.0 lib/milkode/common/ignore_checker.rb
milkode-1.0.2 lib/milkode/common/ignore_checker.rb
milkode-1.0.0 lib/milkode/common/ignore_checker.rb
milkode-0.9.9.9 lib/milkode/common/ignore_checker.rb
milkode-0.9.9 lib/milkode/common/ignore_checker.rb
milkode-0.9.8 lib/milkode/common/ignore_checker.rb
milkode-0.9.7 lib/milkode/common/ignore_checker.rb
milkode-0.9.6 lib/milkode/common/ignore_checker.rb
milkode-0.9.5 lib/milkode/common/ignore_checker.rb
milkode-0.9.4 lib/milkode/common/ignore_checker.rb
milkode-0.9.3.1 lib/milkode/common/ignore_checker.rb
milkode-0.9.3 lib/milkode/common/ignore_checker.rb
milkode-0.9.2 lib/milkode/common/ignore_checker.rb
milkode-0.9.1.1 lib/milkode/common/ignore_checker.rb
milkode-0.9.1 lib/milkode/common/ignore_checker.rb
milkode-0.9.0 lib/milkode/common/ignore_checker.rb
milkode-0.8.1 lib/milkode/common/ignore_checker.rb
milkode-0.8.0 lib/milkode/common/ignore_checker.rb
milkode-0.7.1 lib/milkode/common/ignore_checker.rb
milkode-0.7.0 lib/milkode/common/ignore_checker.rb