<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception

  include AuthenticationsHelper
  include MarkdownHelper
  include SimpleCaptcha::ControllerHelpers

  around_action :catch_halt

  before_filter :set_locale

  def render(*args)
    super
    throw :halt
  end

  def redirect_to(*args)
    super
    throw :halt
  end

  protected

  def catch_halt
    catch :halt do
      yield
    end
  end

  private

  def set_locale
    I18n.locale = http_accept_language.compatible_language_from(I18n.available_locales) || :en
  end
end
<commit_msg>Redirect away from Heroku url<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception

  include AuthenticationsHelper
  include MarkdownHelper
  include SimpleCaptcha::ControllerHelpers

  around_action :catch_halt

  before_filter :redirect_if_heroku
  before_filter :set_locale

  def render(*args)
    super
    throw :halt
  end

  def redirect_to(*args)
    super
    throw :halt
  end

  protected

  def catch_halt
    catch :halt do
      yield
    end
  end

  private

  def redirect_if_heroku
    redirect_to "https://gitreports.com#{request.fullpath}" if request.host == 'https://gitreports.herokuapp.com'
  end

  def set_locale
    I18n.locale = http_accept_language.compatible_language_from(I18n.available_locales) || :en
  end
end

{'fraction_non_alphanumeric': 0.05793991416309013, 'fraction_numerical': 0.005722460658082976, 'mean_word_length': 3.857638888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1446443', 'n_tokens_mistral': 444, 'n_tokens_neox': 421, 'n_words': 104}