<commit_before>module Jpmobile
  class TemplateDetails < ActionView::TemplateDetails
    def initialize(locale, handler, format, variant, mobile)
      @mobile = mobile

      super(locale, handler, format, variant)
    end

    def matches?(requested)
      requested.formats_idx[@format] &&
        requested.locale_idx[@locale] &&
        requested.variants_idx[@variant] &&
        requested.handlers_idx[@handler] &&
        requested.mobile_idx[@mobile]
    end

    def sort_key_for(requested)
      [
        requested.formats_idx[@format],
        requested.locale_idx[@locale],
        requested.variants_idx[@variant],
        requested.handlers_idx[@handler],
        requested.mobile_idx[@mobile],
      ]
    end

    class Requested < ActionView::TemplateDetails::Requested
      attr_reader :mobile, :mobile_idx
<commit_msg>Change mobile template priority<commit_after>module Jpmobile
  class TemplateDetails < ActionView::TemplateDetails
    def initialize(locale, handler, format, variant, mobile)
      @mobile = mobile

      super(locale, handler, format, variant)
    end

    def matches?(requested)
      requested.formats_idx[@format] &&
        requested.locale_idx[@locale] &&
        requested.variants_idx[@variant] &&
        requested.handlers_idx[@handler] &&
        requested.mobile_idx[@mobile]
    end

    def sort_key_for(requested)
      [
        requested.formats_idx[@format],
        requested.locale_idx[@locale],
        requested.variants_idx[@variant],
        requested.mobile_idx[@mobile],
        requested.handlers_idx[@handler],
      ]
    end

    class Requested < ActionView::TemplateDetails::Requested
      attr_reader :mobile, :mobile_idx

{'fraction_non_alphanumeric': 0.10247349823321555, 'fraction_numerical': 0.0, 'mean_word_length': 3.184729064039409, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1057383', 'n_tokens_mistral': 468, 'n_tokens_neox': 481, 'n_words': 83}