lib/reality/git/attribute_rule.rb in gitattributes-2.2.0 vs lib/reality/git/attribute_rule.rb in gitattributes-2.3.0
- old
+ new
@@ -17,11 +17,11 @@
# Represents a rule within the attributes file
class AttributeRule
ATTR_ORDER = %w(text binary eol encoding eofnl)
def initialize(pattern, attributes)
- @pattern = pattern
+ @pattern = pattern.gsub('[[:space:]]', ' ')
@attributes = {}
@priority = 1
attributes.each do |k, v|
if k.to_s == 'priority'
@priority = v
@@ -34,10 +34,10 @@
attr_reader :pattern
attr_reader :attributes
attr_reader :priority
def to_s
- rule = self.pattern
+ rule = self.pattern.gsub(' ','[[:space:]]')
attributes = self.attributes.dup
ATTR_ORDER.each do |key|
unless attributes[key].nil?
rule = "#{rule}#{attr_value(key, attributes[key])}"