<commit_before># frozen_string_literal: true

module RoutingHelper
  extend ActiveSupport::Concern
  include Rails.application.routes.url_helpers
  include ActionView::Helpers::AssetTagHelper

  included do
    def default_url_options
      ActionMailer::Base.default_url_options
    end
  end

  def full_asset_url(source)
    Rails.configuration.x.use_s3 ? source : File.join(root_url, ActionController::Base.helpers.asset_url(source))
  end
end<commit_msg>Avoid duplicate hostname without s3<commit_after># frozen_string_literal: true

module RoutingHelper
  extend ActiveSupport::Concern
  include Rails.application.routes.url_helpers
  include ActionView::Helpers::AssetTagHelper

  included do
    def default_url_options
      ActionMailer::Base.default_url_options
    end
  end

  def full_asset_url(source)
    if Rails.configuration.x.use_s3
	  source
	else
	  asset_url = ActionController::Base.helpers.asset_url(source)
	  asset_url =~ /^http/ ? asset_url : File.join(root_url, asset_url)
	end
  end
end
{'fraction_non_alphanumeric': 0.07283464566929133, 'fraction_numerical': 0.002952755905511811, 'mean_word_length': 4.912790697674419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3194749', 'n_tokens_mistral': 324, 'n_tokens_neox': 321, 'n_words': 63}