<commit_before>module SpreeEssentialContent
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name 'spree_essential_content'

    #initializer "spree.essential_content.preferences", :before => :load_config_initializers do |app|
    #  Spree::EssentialContent::Config = Spree::BlogConfiguration.new
    #end

    initializer "spree.essential_content.paperclip", :before => :load_config_initializers do |app|
      Paperclip::Attachment.default_options.merge!(
        :style => :medium
      )    
    end

    config.autoload_paths += %W(#{config.root}/lib)

    # use rspec for tests
    config.generators do |g|
       g.test_framework :rspec,
         fixtures: true,
         view_specs: false,
         helper_specs: false,
         routing_specs: false,
         controller_specs: true,
         request_specs: false
       g.fixture_replacement :factory_girl, dir: "spec/factories"
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end

      Dir.glob File.expand_path("../../../app/overrides/**/*.rb", __FILE__) do |c|
        Rails.application.config.cache_classes ? require(c) : load(c)
      end
    end

    config.to_prepare &method(:activate).to_proc
  end
end<commit_msg>Set post_product admin scripts to properly precompile.<commit_after>module SpreeEssentialContent
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name 'spree_essential_content'

    #initializer "spree.essential_content.preferences", :before => :load_config_initializers do |app|
    #  Spree::EssentialContent::Config = Spree::BlogConfiguration.new
    #end

    initializer "spree.essential_content.paperclip", :before => :load_config_initializers do |app|
      Paperclip::Attachment.default_options.merge!(
        :style => :medium
      )
    end

    config.autoload_paths += %W(#{config.root}/lib)

    # use rspec for tests
    config.generators do |g|
       g.test_framework :rspec,
         fixtures: true,
         view_specs: false,
         helper_specs: false,
         routing_specs: false,
         controller_specs: true,
         request_specs: false
       g.fixture_replacement :factory_girl, dir: "spec/factories"
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end

      Dir.glob File.expand_path("../../../app/overrides/**/*.rb", __FILE__) do |c|
        Rails.application.config.cache_classes ? require(c) : load(c)
      end
    end

    config.to_prepare &method(:activate).to_proc

    # sets the manifests / assets to be precompiled, even when initialize_on_precompile is false
    initializer "spree.assets.precompile", :group => :all do |app|
      app.config.assets.precompile += %w[
        spree/backend/post_product/new.js
        spree/backend/post_product/index.js
      ]
    end
  end
end
{'fraction_non_alphanumeric': 0.11812297734627832, 'fraction_numerical': 0.0, 'mean_word_length': 2.947637292464879, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '6254944', 'n_tokens_mistral': 983, 'n_tokens_neox': 957, 'n_words': 192}