<commit_before># config/routes.rb:
# Mapping URLs to controllers for FOIFA.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/
#
# $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $

ActionController::Routing::Routes.draw do |map|
    
    # The priority is based upon order of creation: first created -> highest priority.

    # Sample of regular route:
    # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
    # Keep in mind you can assign values other than :controller and :action

    # Allow easy extension from themes. Note these will have the highest priority.
    require File.join('config', 'custom-routes')
    
    map.with_options :controller => 'general' do |general|
        general.frontpage           '/',            :action => 'frontpage'
        general.blog '/blog', :action => 'blog'
        general.custom_css '/stylesheets/custom.css', :action => 'custom_css'
        general.search_redirect '/search',      :action => 'search_redirect'
        # XXX combined is the search query, and then if sorted a "/newest" at the end.
        # Couldn't find a way to do this in routes which also picked up multiple other slashes
        # and dots and other characters that can appear in search query. So we sort it all
        # out in the controller.
        general.search_general '/search/*combined/all', :action => 'search', :view => 'all'
        general.search_general '/search/*combined', :action => 'search'
        general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true

        general.random_request '/random', :action => 'random_request'

        general.fai_test '/test', :action => 'fai_test'
    end

    map.with_options :controller => 'request' do |request|
        request.request_list_recent   '/list/recent',        :action => 'list', :view => 'recent'
        request.request_list_all   '/list/all',        :action => 'list', :view => 'all'
        request.request_list_successful   '/list/successful',        :action => 'list', :view => 'successful'
        request.request_list_unsuccessful   '/list/unsuccessful',        :action => 'list', :view => 'unsuccessful'
        request.request_list_awaiting   '/list/awaiting',        :action => 'list', :view => 'awaiting'
        request.request_list   '/list',        :action => 'list'

        request.select_authority     '/select_authority',     :action => 'select_authority'<commit_msg>Tweak the custom routes mechanism<commit_after># config/routes.rb:
# Mapping URLs to controllers for FOIFA.
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/
#
# $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $

# Allow easy extension from themes. Note these will have the highest priority.
load File.join('config', 'custom-routes.rb')

ActionController::Routing::Routes.draw do |map|
    
    # The priority is based upon order of creation: first created -> highest priority.

    # Sample of regular route:
    # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
    # Keep in mind you can assign values other than :controller and :action

    map.with_options :controller => 'general' do |general|
        general.frontpage           '/',            :action => 'frontpage'
        general.blog '/blog', :action => 'blog'
        general.custom_css '/stylesheets/custom.css', :action => 'custom_css'
        general.search_redirect '/search',      :action => 'search_redirect'
        # XXX combined is the search query, and then if sorted a "/newest" at the end.
        # Couldn't find a way to do this in routes which also picked up multiple other slashes
        # and dots and other characters that can appear in search query. So we sort it all
        # out in the controller.
        general.search_general '/search/*combined/all', :action => 'search', :view => 'all'
        general.search_general '/search/*combined', :action => 'search'
        general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true

        general.random_request '/random', :action => 'random_request'

        general.fai_test '/test', :action => 'fai_test'
    end

    map.with_options :controller => 'request' do |request|
        request.request_list_recent   '/list/recent',        :action => 'list', :view => 'recent'
        request.request_list_all   '/list/all',        :action => 'list', :view => 'all'
        request.request_list_successful   '/list/successful',        :action => 'list', :view => 'successful'
        request.request_list_unsuccessful   '/list/unsuccessful',        :action => 'list', :view => 'unsuccessful'
        request.request_list_awaiting   '/list/awaiting',        :action => 'list', :view => 'awaiting'
        request.request_list   '/list',        :action => 'list'

        request.select_authority     '/select_authority',     :action => 'select_authority'
{'fraction_non_alphanumeric': 0.12976947535771066, 'fraction_numerical': 0.008346581875993641, 'mean_word_length': 2.9755134281200633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7172592', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1408, 'n_words': 443}