<commit_before>module Merb::Generators
  
  class ControllerGenerator < NamespacedGenerator

    def self.source_root
      File.join(super, 'component', 'controller')
    end
    
    desc <<-DESC
      Generates a new controller.
    DESC
    
    option :testing_framework, :desc => 'Testing framework to use (one of: spec, test_unit)'
    
    first_argument :name, :required => true, :desc => "controller name"
    
    invoke :helper
    
    template :controller do
      source('app/controllers/%file_name%.rb')
      destination("app/controllers", base_path, "#{file_name}.rb")
    end
    
    template :index do
      source('app/views/%file_name%/index.html.erb')
      destination("app/views", base_path, "#{file_name}/index.html.erb")
    end
    
    template :controller_spec, :testing_framework => :rspec do
      source('spec/controllers/%file_name%_spec.rb')
      destination("spec/controllers", base_path, "#{file_name}_spec.rb")
    end
    
    template :controller_test_unit, :testing_framework => :test_unit do
      source('test/controllers/%file_name%_test.rb')
      destination("test/controllers", base_path, "#{file_name}_test.rb")
    end
    
  end
  
  add :controller, ControllerGenerator
  
end<commit_msg>made erb template engine explicit for controller generator<commit_after>module Merb::Generators
  
  class ControllerGenerator < NamespacedGenerator

    def self.source_root
      File.join(super, 'component', 'controller')
    end
    
    desc <<-DESC
      Generates a new controller.
    DESC
    
    option :testing_framework, :desc => 'Testing framework to use (one of: spec, test_unit)'
    option :template_engine, :default => :erb, :desc => 'Template engine to use (one of: erb, haml, markaby, etc...)'
    
    first_argument :name, :required => true, :desc => "controller name"
    
    invoke :helper
    
    template :controller do
      source('app/controllers/%file_name%.rb')
      destination("app/controllers", base_path, "#{file_name}.rb")
    end
    
    template :index_erb, :template_engine => :erb do
      source('app/views/%file_name%/index.html.erb')
      destination("app/views", base_path, "#{file_name}/index.html.erb")
    end
    
    template :controller_spec, :testing_framework => :rspec do
      source('spec/controllers/%file_name%_spec.rb')
      destination("spec/controllers", base_path, "#{file_name}_spec.rb")
    end
    
    template :controller_test_unit, :testing_framework => :test_unit do
      source('test/controllers/%file_name%_test.rb')
      destination("test/controllers", base_path, "#{file_name}_test.rb")
    end
    
  end
  
  add :controller, ControllerGenerator
  
end
{'fraction_non_alphanumeric': 0.12261682242990654, 'fraction_numerical': 0.0, 'mean_word_length': 3.3091787439613527, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, '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': '7030928', 'n_tokens_mistral': 820, 'n_tokens_neox': 813, 'n_words': 181}