1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
module Rails::Generators class MetalGenerator < Base argument :file_name, :type => :string def create_file template "metal.rb", "app/metal/#{file_name}.rb" end protected def class_name file_name.classify end end end