Sha256: a7d8aacb9136ce91b4a5ba5495d317dd61a52443dde81ad20f14ab881f2fea64

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

# -*- encoding: utf-8 -*-

module GitShizzle::IndexSpecifications
  class Base
    def include?(index)
      false
    end

    def register_match(index)
      matches << index
    end

    def matches
      @matches ||= []
    end

    def unmatched
    end

    private
    def assert_numeric(index, *spec)
      spec << index if spec.empty?

      all_numeric = spec.all? { |s|
        s.is_a? Numeric or /\d+/.match(s)
      }

      raise IndexParserError.new(index) unless all_numeric
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git_shizzle-0.2.8 lib/git_shizzle/index_specifications/base.rb
git_shizzle-0.2.6 lib/git_shizzle/index_specifications/base.rb