<commit_before># Add necessary Rails path
#$LOAD_PATH.unshift "#{SPREE_ROOT}/vendor/rails/railties/lib"
#require 'rubygems'
#gem 'rails', '>=2.2.2'

require 'initializer'
require 'spree/extension_loader'

module Spree

  class Configuration < Rails::Configuration
    attr_accessor :extension_paths
    attr_accessor :extensions
    attr_accessor :view_paths

    def initialize   
      self.view_paths = []
      self.extension_paths = default_extension_paths
      self.extensions = [ :all ]
      super
    end

    def default_extension_paths
      env = ENV["RAILS_ENV"] || RAILS_ENV
      paths = [SPREE_ROOT + '/vendor/extensions', RAILS_ROOT + '/vendor/extensions'].uniq
      # There's no other way it will work, config/environments/test.rb loads too late
      # TODO: Should figure out how to include this extension path only for the tests that need it
      paths.unshift(SPREE_ROOT + "/test/fixtures/extensions") if env == "test"
      paths
    end

    private

      def library_directories
        Dir["#{SPREE_ROOT}/vendor/*/lib"]
      end

      def framework_root_path   
        RAILS_ROOT + '/vendor/rails'
      end

      # Provide the load paths for the Spree installation
      def default_load_paths       
        paths = ["#{SPREE_ROOT}/test/mocks/#{environment}"]

        # Add the app's controller directory
        paths.concat(Dir["#{SPREE_ROOT}/app/controllers/"])

        # Then components subdirectories.
        paths.concat(Dir["#{SPREE_ROOT}/components/[_a-z]*"])

        # Followed by the standard includes.
        paths.concat %w(
          app
          app/models
          app/controllers
          app/helpers
          config
          lib
          vendor
        ).map { |dir| "#{SPREE_ROOT}/#{dir}" }.select { |dir| File.directory?(dir) }

        paths.concat builtin_directories
        paths.concat library_directories 
      end

      def default_plugin_paths
        [
          "#{RAILS_ROOT}/vendor/plugins",
          "#{SPREE_ROOT}/lib/plugins",
          "#{SPREE_ROOT}/vendor/plugins"
        ]<commit_msg>Rails metal classes not loading properly.<commit_after># Add necessary Rails path
#$LOAD_PATH.unshift "#{SPREE_ROOT}/vendor/rails/railties/lib"
#require 'rubygems'
#gem 'rails', '>=2.2.2'

require 'initializer'
require 'spree/extension_loader'

module Spree

  class Configuration < Rails::Configuration
    attr_accessor :extension_paths
    attr_accessor :extensions
    attr_accessor :view_paths

    def initialize   
      self.view_paths = []
      self.extension_paths = default_extension_paths
      self.extensions = [ :all ]
      super
    end

    def default_extension_paths
      env = ENV["RAILS_ENV"] || RAILS_ENV
      paths = [SPREE_ROOT + '/vendor/extensions', RAILS_ROOT + '/vendor/extensions'].uniq
      # There's no other way it will work, config/environments/test.rb loads too late
      # TODO: Should figure out how to include this extension path only for the tests that need it
      paths.unshift(SPREE_ROOT + "/test/fixtures/extensions") if env == "test"
      paths
    end

    private

      def library_directories
        Dir["#{SPREE_ROOT}/vendor/*/lib"]
      end

      def framework_root_path   
        RAILS_ROOT + '/vendor/rails'
      end

      # Provide the load paths for the Spree installation
      def default_load_paths       
        paths = ["#{SPREE_ROOT}/test/mocks/#{environment}"]

        # Add the app's controller directory
        paths.concat(Dir["#{SPREE_ROOT}/app/controllers/"])

        # Then components subdirectories.
        paths.concat(Dir["#{SPREE_ROOT}/components/[_a-z]*"])

        # Followed by the standard includes.
        paths.concat %w(
          app
          app/metal
          app/models
          app/controllers
          app/helpers
          app/services
          config
          lib
          vendor
        ).map { |dir| "#{SPREE_ROOT}/#{dir}" }.select { |dir| File.directory?(dir) }

        paths.concat builtin_directories
        paths.concat library_directories 
      end

      def default_plugin_paths
        [
          "#{RAILS_ROOT}/vendor/plugins",
          "#{SPREE_ROOT}/lib/plugins",
          "#{SPREE_ROOT}/vendor/plugins"
        ]
{'fraction_non_alphanumeric': 0.10362817168603272, 'fraction_numerical': 0.0014228124258951862, 'mean_word_length': 2.3825180433039295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2816503', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1239, 'n_words': 293}