class GizmoMogwai::Generator

Public Instance Methods

clone_mogwai(file_name, options) click to toggle source
# File lib/gizmo_mogwai.rb, line 8
def clone_mogwai(file_name, options)
     template_file = options[:template_file]
              project_dir = options[:project_dir]
              spec_dir = options[:spec_dir]

              file_path = "#{project_dir}/#{file_name}.rb"
              template = ERB.new File.new(template_file).read, nil, "%"
              @class_name = file_name.split('_').map{|word| word.capitalize}.join('')
              
              create_file file_path do
                      template.result binding
              end
              generator = RSpecKickstarter::Generator.new(spec_dir)
  generator.write_spec(file_path, false, false)
end