<commit_before>require "#{RAILS_ROOT}/vendor/adva/plugins/engines/boot"
require "#{RAILS_ROOT}/vendor/adva/plugins/cells/boot"

# TODO make this a cattr_accessor on Engines::Plugin?
Engines::Plugin.class_eval do
  def default_code_paths
    %w(app/controllers app/helpers app/models app/observers lib)
  end
end

# initialize Rails::Configuration with our own default values to spare users
# some hassle with the installation and keep the environment cleaner
#
# we need to do this because Rails does not allow to define multiple config
# initializer blocks, extend the existing one or change it in any way.
#
# might be more "elegant" to wrap around Rails::Initializer.run and extend
# the configuration object
#
# TODO how to improve this?

Rails::Configuration.class_eval do
  def default_plugins
    [ :engines_config, :better_nested_set, :safemode, :adva_cms, :all ]
  end

  def default_plugin_paths
    paths = ["#{root_path}/vendor/adva/engines", "#{root_path}/vendor/adva/plugins", "#{root_path}/vendor/plugins"]
    paths << "#{root_path}/vendor/adva/test" if ENV['RAILS_ENV'] == 'test'
    paths
  end
end

# Rails::GemDependency does not allow to freeze gems anywhere else than vendor/gems<commit_msg>change boot.rb according to Engines removal<commit_after># require "#{RAILS_ROOT}/vendor/adva/plugins/engines/boot"
require "#{RAILS_ROOT}/vendor/adva/plugins/cells/boot"

# initialize Rails::Configuration with our own default values to spare users
# some hassle with the installation and keep the environment cleaner
#
# we need to do this because Rails does not allow to define multiple config
# initializer blocks, extend the existing one or change it in any way.
#
# might be more "elegant" to wrap around Rails::Initializer.run and extend
# the configuration object
#
# TODO how to improve this?

Rails::Configuration.class_eval do
  def default_load_paths
    %w(app/controllers app/helpers app/models app/observers lib)
  end
  
  def default_plugins
    # [ :engines_config, :better_nested_set, :safemode, :adva_cms, :all ]
    [ :better_nested_set, :safemode, :adva_cms, :all ]
  end

  def default_plugin_paths
    paths = ["#{root_path}/vendor/adva/engines", "#{root_path}/vendor/adva/plugins", "#{root_path}/vendor/plugins"]
    paths << "#{root_path}/vendor/adva/test" if ENV['RAILS_ENV'] == 'test'
    paths
  end
end

Rails::Plugin.class_eval do
  def app_paths
    ['models', 'helpers', 'observers'].map { |path| File.join(directory, 'app', path) } << controller_path
  end
end

# Rails::GemDependency does not allow to freeze gems anywhere else than vendor/gems
{'fraction_non_alphanumeric': 0.10575067541489773, 'fraction_numerical': 0.0, 'mean_word_length': 4.811659192825112, 'pattern_counts': {'":': 0, '<': 9, '<?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': '888209', 'n_tokens_mistral': 831, 'n_tokens_neox': 812, 'n_words': 255}