<commit_before>PopUpArchive::Application.routes.draw do

  use_doorkeeper do
    controllers :applications => 'oauth/applications'
  end

  match '/*path' => redirect {|params, request| "https://www.popuparchive.org/#{params[:path]}" }, constraints: { host: 'pop-up-archive.herokuapp.com' }
  match '/*path' => redirect {|params, request| "https://www.popuparchive.org/#{params[:path]}" }, constraints: { host: 'beta.popuparchive.org' }
  match '/*path' => redirect {|params, request| "https://www.popuparchive.org/#{params[:path]}" }, constraints: { host: 'www.popuparchive.org', :protocol => "http://" }

  devise_for :users, controllers: { registrations: 'users/registrations', invitations: 'users/invitations', omniauth_callbacks: 'users/omniauth_callbacks' }

  namespace :admin do
    resources :taskList
    resources :soundcloudCallback
    resources :accounts
  end

  get 'media/:token/:expires/:use/:class/:id/:name.:extension', controller: 'media', action: 'show'

  post 'amara_callback', controller: 'callbacks', action: 'amara'

  namespace :api, defaults: { format: 'json' }, path: 'api' do
    scope module: :v1, constraints: ApiVersionConstraint.new(version: 1, default: true) do
      root to: 'status#info'

      get '/me' => 'users#me'
      put '/me/credit_card' => 'credit_cards#update'
      put '/me/subscription' => 'subscriptions#update'<commit_msg>use block style redirect constraints<commit_after>PopUpArchive::Application.routes.draw do

  use_doorkeeper do
    controllers :applications => 'oauth/applications'
  end

  constraints(host: /(?:pop-up-archive.herokuapp.com)|(?:beta.popuparchive.org)/) do
    match "/*path" => redirect {|params, req| "https://www.popuparchive.org/#{params[:path]}" }
  end

  constraints(protocol: 'http') do
    match '/*path' => redirect {|params, request| "https://www.popuparchive.org/#{params[:path]}" }
  end

  devise_for :users, controllers: { registrations: 'users/registrations', invitations: 'users/invitations', omniauth_callbacks: 'users/omniauth_callbacks' }

  namespace :admin do
    resources :taskList
    resources :soundcloudCallback
    resources :accounts
  end

  get 'media/:token/:expires/:use/:class/:id/:name.:extension', controller: 'media', action: 'show'

  post 'amara_callback', controller: 'callbacks', action: 'amara'

  namespace :api, defaults: { format: 'json' }, path: 'api' do
    scope module: :v1, constraints: ApiVersionConstraint.new(version: 1, default: true) do
      root to: 'status#info'

      get '/me' => 'users#me'
      put '/me/credit_card' => 'credit_cards#update'
      put '/me/subscription' => 'subscriptions#update'
{'fraction_non_alphanumeric': 0.16376042456406367, 'fraction_numerical': 0.001516300227445034, 'mean_word_length': 4.663090128755365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 5, 'lorem ipsum': 0, 'www.': 6, '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': '181180', 'n_tokens_mistral': 840, 'n_tokens_neox': 830, 'n_words': 188}