<commit_before>
module Nucleon
module Plugin
class Configuration < CORL.plugin_class(:base)
    
  include Mixin::SubConfig

  #-----------------------------------------------------------------------------
  # Configuration plugin interface
  
  def normalize(reload)
    super
    
    logger.debug("Initializing source sub configuration")
    init_subconfig(true) unless reload
    
    logger.info("Setting source configuration project")
    @project = CORL.project(extended_config(:project, {
      :directory => _delete(:directory, Dir.pwd),
      :url       => _delete(:url),
      :revision  => _delete(:revision),
      :create    => _delete(:create, false),
      :pull      => true
    }), _delete(:project_provider))
        
    _init(:autoload, true)
    _init(:autosave, false)
    
    yield if block_given?
    
    set_location(@project)
  end
   
  #-----------------------------------------------------------------------------
  # Checks
  
  def can_persist?
    project.can_persist?
  end
      
  #-----------------------------------------------------------------------------
  # Property accessors / modifiers

  def project
    @project
  end
  
  #---
  
  def directory
    project.directory  
  end
  
  #---
  
  def autoload(default = false)
    _get(:autoload, default)
  end
  
  def autoload=autoload
    _set(:autoload, test(autoload))
  end
   
  #---
  
  def autosave(default = false)
    _get(:autosave, default)
  end
  
  def autosave=autosave<commit_msg>Adding cache reference and ignore operation to the base configuration plugin.<commit_after>
module Nucleon
module Plugin
class Configuration < CORL.plugin_class(:base)
    
  include Mixin::SubConfig

  #-----------------------------------------------------------------------------
  # Configuration plugin interface
  
  def normalize(reload)
    super
    
    logger.debug("Initializing source sub configuration")
    init_subconfig(true) unless reload
    
    logger.info("Setting source configuration project")
    @project = CORL.project(extended_config(:project, {
      :directory => _delete(:directory, Dir.pwd),
      :url       => _delete(:url),
      :revision  => _delete(:revision),
      :create    => _delete(:create, false),
      :pull      => true
    }), _delete(:project_provider))
        
    _init(:autoload, true)
    _init(:autosave, false)
    
    yield if block_given?
    
    set_location(@project)
  end
   
  #-----------------------------------------------------------------------------
  # Checks
  
  def can_persist?
    project.can_persist?
  end
      
  #-----------------------------------------------------------------------------
  # Property accessors / modifiers

  def project
    @project
  end
  
  #---
  
  def directory
    project.directory  
  end
  
  #---
  
  def cache
    project.cache
  end
  
  #---
  
  def ignore(files)
    project.ignore(files)
  end
  
  #---
  
  def autoload(default = false)
    _get(:autoload, default)
  end
  
  def autoload=autoload
    _set(:autoload, test(autoload))
  end
   
  #---
  
  def autosave(default = false)
    _get(:autosave, default)
  end
  
  def autosave=autosave
{'fraction_non_alphanumeric': 0.2334175615919141, 'fraction_numerical': 0.0, 'mean_word_length': 1.5376602564102564, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '905982', 'n_tokens_mistral': 918, 'n_tokens_neox': 894, 'n_words': 189}