<commit_before>require 'patches/rails_route_set'

TravisCi::Application.routes.draw do
  root :to => 'home#index'

  # this is a special route for cctray support, and it must appear before other repository routes
  match "*owner_name/*name/cc", :to => 'repositories#show', :format => 'xml', :schema => 'cctray'
  match "*owner_name/*name.png", :to => 'repositories#show', :format => 'png'
  match "*owner_name/*name.json", :to => 'repositories#show', :format => 'json'
  match "*owner_name/*name.xml", :to => 'repositories#show', :format => 'xml'

  match "*owner_name/*name/builds.xml", :to => 'builds#index', :format => 'xml'
  match "*owner_name/*name/builds.json", :to => 'builds#index', :format => 'json'

  match "*owner_name/*name/builds/:id.xml", :to => 'builds#show', :format => 'xml'
  match "*owner_name/*name/builds/:id.json", :to => 'builds#show', :format => 'json'

  devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

  as :user do
    get 'users/sign_out', :to => 'devise/sessions#destroy', :as => :destroy_session
  end

  resources :repositories, :only => [:index, :show] do
    resources :builds, :only => [:index, :show]
  end

  resources :builds,   :only => :show
  resources :requests, :only => :create
  resources :tasks,    :only => [:show, :update, :log]
  resources :jobs,     :only => :index
  resources :workers,  :only => :index

  resource :profile, :only => :show do
    get :service_hooks, :to => 'service_hooks#index'
    put :service_hooks, :to => 'service_hooks#update'
  end

  match "/stats" => "statistics#index"
<commit_msg>use constraints instead of globs to tighten the routes a bit.<commit_after>require 'patches/rails_route_set'

TravisCi::Application.routes.draw do
  root :to => 'home#index'

  constraints :owner_name => /[^\/]+/, :name => /[^\/]+/ do
    match ":owner_name/:name.png", :to => 'repositories#show', :format => 'png'
    match ":owner_name/:name.json", :to => 'repositories#show', :format => 'json'
    match ":owner_name/:name.xml", :to => 'repositories#show', :format => 'xml'
    match ":owner_name/:name/cc.xml", :to => 'repositories#show', :format => 'xml', :schema => 'cctray'

    match ":owner_name/:name/builds.xml", :to => 'builds#index', :format => 'xml'
    match ":owner_name/:name/builds.json", :to => 'builds#index', :format => 'json'

    match ":owner_name/:name/builds/:id.xml", :to => 'builds#show', :format => 'xml'
    match ":owner_name/:name/builds/:id.json", :to => 'builds#show', :format => 'json'
  end

  devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

  as :user do
    get 'users/sign_out', :to => 'devise/sessions#destroy', :as => :destroy_session
  end

  resources :repositories, :only => [:index, :show] do
    resources :builds, :only => [:index, :show]
  end

  resources :builds,   :only => :show
  resources :requests, :only => :create
  resources :tasks,    :only => [:show, :update, :log]
  resources :jobs,     :only => :index
  resources :workers,  :only => :index

  resource :profile, :only => :show do
    get :service_hooks, :to => 'service_hooks#index'
    put :service_hooks, :to => 'service_hooks#update'
  end

  match "/stats" => "statistics#index"

{'fraction_non_alphanumeric': 0.19216533004318323, 'fraction_numerical': 0.0, 'mean_word_length': 4.378109452736318, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 15}, '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': '6838910', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1132, 'n_words': 277}