<commit_before>require 'yaml'

module GollumRails
    class Config
      attr_reader :config
      def self.read_config
        config = self.open_config
        DependencyInjector.set({:config => config})
      end
      def self.read_rails_conf(app)
        DependencyInjector.set({:rails_conf => self.open_gollum_rails_conf(app)})
      end
      def self.config_location
      end

      def self.lang_from_rails
      end

      def self.settings_from_rails
        Rails.settings
      end

      def self.rails_root
        Rails.root
      end

      def self.rails_config_dir
      end
      
      #######
      private
      #######
      #gives a hardcoded configuration file
      def self.open_config
        YAML.load_file(::File.join(::File.dirname(__FILE__), 'messages.yml'))
      end
      def self.open_gollum_rails_conf(app)
        YAML.load_file(::File.read(app.root.join("config", "gollum.yml")))
      end

    end
end<commit_msg>should load a file instead of a string<commit_after>require 'yaml'

module GollumRails
    class Config
      attr_reader :config
      def self.read_config
        config = self.open_config
        DependencyInjector.set({:config => config})
      end
      def self.read_rails_conf(app)
        DependencyInjector.set({:rails_conf => self.open_gollum_rails_conf(app)})
      end
      def self.config_location
      end

      def self.lang_from_rails
      end

      def self.settings_from_rails
        Rails.settings
      end

      def self.rails_root
        Rails.root
      end

      def self.rails_config_dir
      end
      
      #######
      private
      #######
      #gives a hardcoded configuration file
      def self.open_config
        YAML.load_file(::File.join(::File.dirname(__FILE__), 'messages.yml'))
      end
      def self.open_gollum_rails_conf(app)
        YAML.load_file(app.root.join("config", "gollum.yml"))
      end

    end
end
{'fraction_non_alphanumeric': 0.0931321540062435, 'fraction_numerical': 0.0, 'mean_word_length': 2.189054726368159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7289422', 'n_tokens_mistral': 640, 'n_tokens_neox': 597, 'n_words': 116}