<commit_before>require 'semantic_navigation/helper_methods'

module SemanticNavigation
  class Railtie < Rails::Railtie

    initializer "semantic_navigation.extend_helper_methods" do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send :include, HelperMethods
      end

      conf = SemanticNavigation::Configuration
      conf.register_renderer :list, Renderers::List
      conf.register_renderer :breadcrumb, Renderers::BreadCrumb
      conf.register_renderer :bootstrap_breadcrumb, TwitterBootstrap::Breadcrumb
      conf.register_renderer :bootstrap_list, TwitterBootstrap::List
      conf.register_renderer :bootstrap_tabs, TwitterBootstrap::Tabs
      conf.register_renderer :bootstrap_pills, TwitterBootstrap::Tabs
      conf.register_renderer :bootstrap_simple_nav, SemanticNavigation::Renderers::List

      conf.styles_for :bootstrap_pills do
        navigation_default_classes [:nav, 'nav-pills']
      end
      conf.styles_for :bootstrap_simple_nav do
        navigation_default_classes [:nav]
      end
    end

    if Rails.env == "production"
      config.after_initialize {
        load "#{Rails.root}/config/initializers/semantic_navigation.rb"
      }
    else
      ActionDispatch::Callbacks.before {
        load "#{Rails.root}/config/initializers/semantic_navigation.rb"
      }
    end

  end
end<commit_msg>made backward compatibility for the configuration file path<commit_after>require 'semantic_navigation/helper_methods'

module SemanticNavigation
  class Railtie < Rails::Railtie

    initializer "semantic_navigation.extend_helper_methods" do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send :include, HelperMethods
      end

      conf = SemanticNavigation::Configuration
      conf.register_renderer :list, Renderers::List
      conf.register_renderer :breadcrumb, Renderers::BreadCrumb
      conf.register_renderer :bootstrap_breadcrumb, TwitterBootstrap::Breadcrumb
      conf.register_renderer :bootstrap_list, TwitterBootstrap::List
      conf.register_renderer :bootstrap_tabs, TwitterBootstrap::Tabs
      conf.register_renderer :bootstrap_pills, TwitterBootstrap::Tabs
      conf.register_renderer :bootstrap_simple_nav, SemanticNavigation::Renderers::List

      conf.styles_for :bootstrap_pills do
        navigation_default_classes [:nav, 'nav-pills']
      end
      conf.styles_for :bootstrap_simple_nav do
        navigation_default_classes [:nav]
      end
    end

    def self.actual_config_location
      locations =  ["#{Rails.root}/config/initializers/semantic_navigation.rb", 
                    "#{Rails.root}/config/semantic_navigation.rb"]
      actual_location = locations.find{|l| File.exists?(l)}
      throw "Please create a semantic_navigation configuration file before starting the project!" unless actual_location
      puts "DEPRECATION WARNING: Please move the configuration file from #{locations.second} 
            to #{locations.first}! Current configuration file path will be deprecated soon!" if locations.find_index(actual_location) == 1
      actual_location
    end
   
    if Rails.env == "production"
      config.after_initialize {
        load SemanticNavigation::Railtie.actual_config_location
      }
    else
      ActionDispatch::Callbacks.before {
        load SemanticNavigation::Railtie.actual_config_location
      }
    end

  end
end
{'fraction_non_alphanumeric': 0.07507418397626113, 'fraction_numerical': 0.0002967359050445104, 'mean_word_length': 3.836441893830703, 'pattern_counts': {'":': 0, '<': 5, '<?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': '228197', 'n_tokens_mistral': 931, 'n_tokens_neox': 921, 'n_words': 186}