<commit_before>Rails.application.routes.draw do
  mount Payola::Engine => '/payola', as: :payola
  require 'sidekiq/web'
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == ENV["SIDEKIQ_USERNAME"] && password == ENV["SIDEKIQ_PASSWORD"]
  end if Rails.env.production?
  mount Sidekiq::Web => '/sidekiq'

  get '/home', to: 'dashboard#home'

  namespace :api do
    post '/check', to: 'status#check'

    get '/', to: 'docs#index'
    get '/search', to: 'search#index'
    get '/bower-search', to: 'bower_search#index'
    get '/searchcode', to: 'projects#searchcode'

    get '/subscriptions', to: 'subscriptions#index'
    get '/subscription/:platform/:name', to: 'subscriptions#show'
    post '/subscription/:platform/:name', to: 'subscriptions#create'
    put '/subscription/:platform/:name', to: 'subscriptions#update'
    delete '/subscription/:platform/:name', to: 'subscriptions#destroy'

    get '/github/issues/help-wanted', to: 'github_issues#help_wanted'
    get '/github/issues/first-pull-request', to: 'github_issues#first_pull_request'

    get '/github/search', to: 'github_repositories#search'

    get '/github/:login/repositories', to: 'github_users#repositories'
    get '/github/:login/projects', to: 'github_users#projects'

    get '/github/:owner/:name/dependencies', to: 'github_repositories#dependencies', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name/projects', to: 'github_repositories#projects', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name', to: 'github_repositories#show', constraints: { :name => /[^\/]+/ }

    get '/github/:login', to: 'github_users#show'

    get '/:platform/:name/:version/tree', to: 'tree#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\-\%]+/, :version => /[\w\.\-]+/ }
    get '/:platform/:name/:version/dependencies', to: 'projects#dependencies', constraints: { :platform => /[\w\-]+/, :name => /[\w\-\%]+/, :version => /[\w\.\-]+/ }
    get '/:platform/:name/dependent_repositories', to: 'projects#dependent_repositories', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name/dependents', to: 'projects#dependents', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name/tree', to: 'tree#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name', to: 'projects#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
  end

  namespace :admin do
    resources :projects do
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    resources :project_suggestions
    resources :github_repositories do
      member do
        put 'deprecate'
        put 'unmaintain'
      end
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    get '/stats', to: 'stats#index', as: :stats
    get '/stats/github', to: 'stats#github', as: :github_stats
  end

  get '/trending', to: 'projects#trending', as: :trending_projects
  get '/explore', to: 'explore#index'
  get '/collections', to: 'collections#index'
  get '/explore/:language-:keyword-libraries', to: 'collections#show'

  get '/github/issues', to: 'github_issues#index', as: :issues

  get '/pricing', to: 'account_subscriptions#plans', as: :pricing
  resources :account_subscriptions

  get '/recommendations', to: 'recommendations#index', as: :recommendations

  post '/hooks/github', to: 'hooks#github'

  get '/repositories', to: 'dashboard#index', as: :repositories
  get '/dashboard', to: redirect("/repositories")
  get '/muted', to: 'dashboard#muted', as: :muted
  post '/repositories/sync', to: 'dashboard#sync', as: :sync
  post '/watch/:github_repository_id', to: 'dashboard#watch', as: :watch
  post '/unwatch/:github_repository_id', to: 'dashboard#unwatch', as: :unwatch

  resource :account do
    member do
      get 'delete'
    end
  end

  root to: 'projects#index'

  get '/404', to: 'errors#not_found'
  get '/422', to: 'errors#unprocessable'
  get '/500', to: 'errors#internal'

  resources :licenses, constraints: { :id => /.*/ }
  resources :languages
  resources :keywords, constraints: { :id => /.*/ }
  resources :subscriptions
  resources :repository_subscriptions
  get '/subscribe/:project_id', to: 'subscriptions#subscribe', as: :subscribe

  get '/stats', to: redirect('/admin/stats')

  get 'bus-factor', to: 'projects#bus_factor', as: :bus_factor
  get '/unlicensed-libraries', to: 'projects#unlicensed', as: :unlicensed
  get 'unmaintained-libraries', to: 'projects#unmaintained', as: :unmaintained
  get 'deprecated-libraries', to: 'projects#deprecated', as: :deprecated
  get 'removed-libraries', to: 'projects#removed', as: :removed
<commit_msg>Fix keywords pages with dots in<commit_after>Rails.application.routes.draw do
  mount Payola::Engine => '/payola', as: :payola
  require 'sidekiq/web'
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == ENV["SIDEKIQ_USERNAME"] && password == ENV["SIDEKIQ_PASSWORD"]
  end if Rails.env.production?
  mount Sidekiq::Web => '/sidekiq'

  get '/home', to: 'dashboard#home'

  namespace :api do
    post '/check', to: 'status#check'

    get '/', to: 'docs#index'
    get '/search', to: 'search#index'
    get '/bower-search', to: 'bower_search#index'
    get '/searchcode', to: 'projects#searchcode'

    get '/subscriptions', to: 'subscriptions#index'
    get '/subscription/:platform/:name', to: 'subscriptions#show'
    post '/subscription/:platform/:name', to: 'subscriptions#create'
    put '/subscription/:platform/:name', to: 'subscriptions#update'
    delete '/subscription/:platform/:name', to: 'subscriptions#destroy'

    get '/github/issues/help-wanted', to: 'github_issues#help_wanted'
    get '/github/issues/first-pull-request', to: 'github_issues#first_pull_request'

    get '/github/search', to: 'github_repositories#search'

    get '/github/:login/repositories', to: 'github_users#repositories'
    get '/github/:login/projects', to: 'github_users#projects'

    get '/github/:owner/:name/dependencies', to: 'github_repositories#dependencies', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name/projects', to: 'github_repositories#projects', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name', to: 'github_repositories#show', constraints: { :name => /[^\/]+/ }

    get '/github/:login', to: 'github_users#show'

    get '/:platform/:name/:version/tree', to: 'tree#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\-\%]+/, :version => /[\w\.\-]+/ }
    get '/:platform/:name/:version/dependencies', to: 'projects#dependencies', constraints: { :platform => /[\w\-]+/, :name => /[\w\-\%]+/, :version => /[\w\.\-]+/ }
    get '/:platform/:name/dependent_repositories', to: 'projects#dependent_repositories', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name/dependents', to: 'projects#dependents', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name/tree', to: 'tree#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
    get '/:platform/:name', to: 'projects#show', constraints: { :platform => /[\w\-]+/, :name => /[\w\.\-\%]+/ }
  end

  namespace :admin do
    resources :projects do
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    resources :project_suggestions
    resources :github_repositories do
      member do
        put 'deprecate'
        put 'unmaintain'
      end
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    get '/stats', to: 'stats#index', as: :stats
    get '/stats/github', to: 'stats#github', as: :github_stats
  end

  get '/trending', to: 'projects#trending', as: :trending_projects
  get '/explore', to: 'explore#index'
  get '/collections', to: 'collections#index'
  get '/explore/:language-:keyword-libraries', to: 'collections#show'

  get '/github/issues', to: 'github_issues#index', as: :issues

  get '/pricing', to: 'account_subscriptions#plans', as: :pricing
  resources :account_subscriptions

  get '/recommendations', to: 'recommendations#index', as: :recommendations

  post '/hooks/github', to: 'hooks#github'

  get '/repositories', to: 'dashboard#index', as: :repositories
  get '/dashboard', to: redirect("/repositories")
  get '/muted', to: 'dashboard#muted', as: :muted
  post '/repositories/sync', to: 'dashboard#sync', as: :sync
  post '/watch/:github_repository_id', to: 'dashboard#watch', as: :watch
  post '/unwatch/:github_repository_id', to: 'dashboard#unwatch', as: :unwatch

  resource :account do
    member do
      get 'delete'
    end
  end

  root to: 'projects#index'

  get '/404', to: 'errors#not_found'
  get '/422', to: 'errors#unprocessable'
  get '/500', to: 'errors#internal'

  resources :licenses, constraints: { :id => /.*/ }, :defaults => { :format => 'html' }
  resources :languages
  resources :keywords, constraints: { :id => /.*/ }, :defaults => { :format => 'html' }
  resources :subscriptions
  resources :repository_subscriptions
  get '/subscribe/:project_id', to: 'subscriptions#subscribe', as: :subscribe

  get '/stats', to: redirect('/admin/stats')

  get 'bus-factor', to: 'projects#bus_factor', as: :bus_factor
  get '/unlicensed-libraries', to: 'projects#unlicensed', as: :unlicensed
  get 'unmaintained-libraries', to: 'projects#unmaintained', as: :unmaintained
  get 'deprecated-libraries', to: 'projects#deprecated', as: :deprecated
  get 'removed-libraries', to: 'projects#removed', as: :removed

{'fraction_non_alphanumeric': 0.19409194924069065, 'fraction_numerical': 0.0018722696068233825, 'mean_word_length': 3.821965897693079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, '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': '60177', 'n_tokens_mistral': 3201, 'n_tokens_neox': 3177, 'n_words': 755}