<commit_before>module Locomotive
  module Plugins
    
    DEFAULT_PATH = File.join(RAILS_ROOT, 'vendor','plugins','locomotive')
    
    class << self
      attr_accessor :discovered
      
      def [](plugin_name)
        discovered[plugin_name]
      end
    end
    
    self.discovered = {}
    
    # Find and include all Locomotive plugins
    def self.discover

      discovered.clear
      
      puts "finding plugins"
            
      installed_plugins.each do |p|
        puts "\t#{p}"
        require File.join(DEFAULT_PATH, p, 'lib', 'locomotive', 'plugins', p)
        discovered[p] = Locomotive::Plugins.const_get(p.camelize)
      end
    end
    
    def self.find_all
      discovered.values
    end
    
    # Generates a list of installed plugins from the directory structure
    # in vendor/plugins/locomotive.<commit_msg>added comments<commit_after>module Locomotive
  module Plugins
    
    DEFAULT_PATH = File.join(RAILS_ROOT, 'vendor','plugins','locomotive')
    
    class << self
      attr_accessor :discovered
      
      # Accessor to query plugins by their name
      # Returns the plugin with plugin_name if it is known
      def [](plugin_name)
        discovered[plugin_name]
      end
    end
    
    self.discovered = {}
    
    # Find and include all Locomotive plugins
    def self.discover

      discovered.clear
      
      puts "finding plugins"
            
      installed_plugins.each do |p|
        puts "\t#{p}"
        require File.join(DEFAULT_PATH, p, 'lib', 'locomotive', 'plugins', p)
        discovered[p] = Locomotive::Plugins.const_get(p.camelize)
      end
    end
    
    def self.find_all
      discovered.values
    end
    
    # Generates a list of installed plugins from the directory structure
    # in vendor/plugins/locomotive.
{'fraction_non_alphanumeric': 0.08213096559378469, 'fraction_numerical': 0.0, 'mean_word_length': 2.1968085106382977, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6115571', 'n_tokens_mistral': 534, 'n_tokens_neox': 543, 'n_words': 138}