<commit_before>module Rails
  module Generators
    module Actions

      attr_accessor :after_gems, :template_options 

      # Adds a # before the found content
      def comment(path, content)
        gsub_file path, content, "##{content}"
      end

      # Executes all procs 
      def execute_after_gems
        @after_gems.each {|proc| proc.call } 
      end      

      # Initializes the parameters
      def initialize_parameters
        @after_gems = []
        @template_options = {}
      end

      # Asks if a recipe should be applied and stores the recipe option
      def recipe?(recipe)
        template_options[recipe.to_sym] = yes?(("Install #{recipe.to_s}?"))
      end

      # Retrieves the file path to a given recipe
      def recipe_path(recipe, group = '')
        File.join File.dirname(__FILE__), 'recipes', group.to_s, "#{recipe.to_s}.rb" 
      end

      # Commit all current changes on version control
      def repo_commit(msg)
        git :add => '-u'
        git :add => '.'
        git :commit => "-m \"#{msg}\""             
      end

      # Initializer the version control repository
      def repo_init
        git :init
      end

    end
  end
end<commit_msg>Added template read methods<commit_after>module Rails
  module Generators
    module Actions

      attr_accessor :after_gems, :template_options 

      # Adds a # before the found content
      def comment(path, content)
        gsub_file path, content, "##{content}"
      end

      # Executes all procs 
      def execute_after_gems
        @after_gems.each {|proc| proc.call } 
      end      

      # Initializes the parameters
      def initialize_parameters
        @after_gems = []
        @template_options = {}
      end

      # Asks if a recipe should be applied and stores the recipe option
      def recipe?(recipe)
        template_options[recipe.to_sym] = yes?(("Install #{recipe.to_s}?"))
      end

      # Retrieves the file path to a given recipe
      def recipe_path(recipe, group = '')
        File.join File.dirname(__FILE__), 'recipes', group.to_s, "#{recipe.to_s}.rb" 
      end

      # Commit all current changes on version control
      def repo_commit(msg)
        git :add => '-u'
        git :add => '.'
        git :commit => "-m \"#{msg}\""             
      end

      # Initializer the version control repository
      def repo_init
        git :init
      end

      def template_content(template)
        File.read template_path(template)
      end

      def template_path(template)
        File.join File.dirname(__FILE__), 'templates', template 
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.08962623951182304, 'fraction_numerical': 0.0, 'mean_word_length': 2.0714285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7183536', 'n_tokens_mistral': 778, 'n_tokens_neox': 742, 'n_words': 228}