lib/roda/plugins/optimized_segment_matchers.rb
# Optimized version of +r.is String+ that yields the next segment only if it
# is the final segment.
Optimized version of +r.is String+ that yields the next segment only if it
is the final segment.
Optimized version of + r . is String + that yields the next segment only if it is the final segment .
def is_segment
          rp = @remaining_path
          if rp.getbyte(0) == 47 && !rp.index('/', 1) && (len = rp.length) > 1
            @remaining_path = ""
            always{yield rp[1, len]}
          end
        end
def is_segment rp = @remaining_path if rp . getbyte ( 0 ) == 47 && ! rp . index ( '/' , 1 ) && ( len = rp . length ) > 1 @remaining_path = "" always { yield rp [ 1 , len ] } end end
Optimized version of +r.is String+ that yields the next segment only if it
is the final segment.
Optimized version of + r . is String + that yields the next segment only if it is the final segment .