<commit_before>module Vapor::ControllerExtensions
  def self.included(base)
    base.class_eval { before_filter :apply_flow_meters }
  end
  
  def apply_flow_meters
    url = params[:url]
    if Array === url
      url = url.join('/')
    else
      url = url.to_s
    end
    if config['vapor.use_regexp'] == 'true'
      FlowMeter.all.each do |key, value|
        if url.match(Regexp.new('^'+key))
          redirect_url = value[0]<commit_msg>allow nestable catch urls: longer ones are ordered first<commit_after>module Vapor::ControllerExtensions
  def self.included(base)
    base.class_eval { before_filter :apply_flow_meters }
  end
  
  def apply_flow_meters
    url = params[:url]
    if Array === url
      url = url.join('/')
    else
      url = url.to_s
    end
    if config['vapor.use_regexp'] == 'true'
      FlowMeter.all.sort.reverse.each do |meter|
        key = meter[0]
        value = meter[1]
        if url.match(Regexp.new('^'+key))
          redirect_url = value[0]
{'fraction_non_alphanumeric': 0.11907164480322906, 'fraction_numerical': 0.004036326942482341, 'mean_word_length': 2.701492537313433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1538064', 'n_tokens_mistral': 336, 'n_tokens_neox': 332, 'n_words': 74}