lib/usher/splitter.rb in usher-0.6.6 vs lib/usher/splitter.rb in usher-0.6.7
- old
+ new
@@ -8,15 +8,17 @@
SingleCharacterSplitterInstance.new(delimiters)
end
class SingleCharacterSplitterInstance
+ attr_reader :url_split_regex
+
def initialize(delimiters)
- @url_split_regex = Regexp.new("[#{delimiters.collect{|d| Regexp.quote(d)}.join}]|[^#{delimiters.collect{|d| Regexp.quote(d)}.join}]+")
+ @url_split_regex = Regexp.new("[^#{delimiters.collect{|d| Regexp.quote(d)}.join}]+|[#{delimiters.collect{|d| Regexp.quote(d)}.join}]")
end
def split(path)
- path.scan(@url_split_regex)
+ path.scan(url_split_regex)
end
end
class MultiCharacterSplitterInstance
\ No newline at end of file