<commit_before>module SpreeMultiTheme
  class Engine < Rails::Engine
    APP_THEME = YAML.load_file("config/settings.yml")
    %x{for m in "`ls #{File.expand_path('../../themes',__FILE__)}`"; do echo "options: \\"$m\\"" > #{File.expand_path('../../config/themes.yml',__FILE__)} ; done}

    railtie_name "spree_multi_theme"
    @current_theme = APP_THEME['theme']
    @current_theme = 'theme1' if  @current_theme.empty?

    config.autoload_paths += %W(#{config.root}/lib)
    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), "../themes/#{@current_theme}/app/overrides/*.rb")) do |c|
        Rails.application.config.cache_classes ? require(c) : load(c)
      end
    end
    paths["app/assets"] << "themes/#{@current_theme}/app/assets"
    paths["app/views"] << "themes/#{@current_theme}/app/views"
    paths["vendor/assets"] << "themes/#{@current_theme}/vendor/assets"

    config.to_prepare &method(:activate).to_proc
  end
end<commit_msg>changes in lib<commit_after>module SpreeMultiTheme
  class Engine < Rails::Engine

    begin
     APP_THEME = YAML.load_file("config/settings.yml")
    rescue
     text='theme: " "'
     File.open("config/settings.yml", 'w') {|f| f.write(text) }
     APP_THEME = YAML.load_file("config/settings.yml")
  end
    %x{for m in "`ls #{File.expand_path('../../themes',__FILE__)}`"; do echo "options: \\"$m\\"" > #{File.expand_path('../../config/themes.yml',__FILE__)} ; done}

    railtie_name "spree_multi_theme"
    @current_theme = APP_THEME['theme']
    @current_theme = 'theme1' if  @current_theme.empty?

    config.autoload_paths += %W(#{config.root}/lib)
    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), "../themes/#{@current_theme}/app/overrides/*.rb")) do |c|
        Rails.application.config.cache_classes ? require(c) : load(c)
      end
    end
    paths["app/assets"] << "themes/#{@current_theme}/app/assets"
    paths["app/views"] << "themes/#{@current_theme}/app/views"
    paths["vendor/assets"] << "themes/#{@current_theme}/vendor/assets"

    config.to_prepare &method(:activate).to_proc
  end
end
{'fraction_non_alphanumeric': 0.18977055449330785, 'fraction_numerical': 0.0009560229445506692, 'mean_word_length': 3.811494252873563, 'pattern_counts': {'":': 0, '<': 17, '<?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': '1844579', 'n_tokens_mistral': 757, 'n_tokens_neox': 722, 'n_words': 109}