When a traveling wave meets a gap on its way