<commit_before>module MobileViewsController
  
  module ClassMethods
  
    def has_mobile_views(args={})
      filter_args = args.select {|k,v| %w(only except).include?(k.to_s)}
      before_filter :has_mobile_views, filter_args
    end
  
  end

  module InstanceMethods

    def mobile_device?
      if session[MobileViews.mobile_mode_session_var]
        session[MobileViews.mobile_mode_session_var] == "1"
      else
        request.user_agent =~ MobileViews.mobile_user_agent_regex &&
                (MobileViews.mobile_user_agent_exception_regex.nil? || request.user_agent !~ MobileViews.mobile_user_agent_exception_regex)
      end<commit_msg>Change before_filter to before_action. Rails 5.0<commit_after>module MobileViewsController
  
  module ClassMethods
  
    def has_mobile_views(args={})
      filter_args = args.select {|k,v| %w(only except).include?(k.to_s)}
      before_action :has_mobile_views, filter_args
    end
  
  end

  module InstanceMethods

    def mobile_device?
      if session[MobileViews.mobile_mode_session_var]
        session[MobileViews.mobile_mode_session_var] == "1"
      else
        request.user_agent =~ MobileViews.mobile_user_agent_regex &&
                (MobileViews.mobile_user_agent_exception_regex.nil? || request.user_agent !~ MobileViews.mobile_user_agent_exception_regex)
      end
{'fraction_non_alphanumeric': 0.08065720687079911, 'fraction_numerical': 0.002987303958177745, 'mean_word_length': 3.7183098591549295, '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': '921257', 'n_tokens_mistral': 415, 'n_tokens_neox': 410, 'n_words': 66}