Sha256: 3c4b48758064e39d91957deb182f06909a07309801f674ed097caf75bdcf2403

Contents?: true

Size: 928 Bytes

Versions: 1

Compression:

Stored size: 928 Bytes

Contents

class NewProjectGenerator < Templater::Generator
  def self.source_root
    File.join %W| #{File.dirname(__FILE__)} .. .. .. templates project |
  end

  first_argument :root, :required => true

  empty_directory :root, '%root%'
  empty_directory :log, File.join('%root%', 'log')
  empty_directory :db, File.join('%root%', 'db')
  empty_directory :config, File.join('%root%', 'config')
  empty_directory :test, File.join('%root%', 'test')
  empty_directory :script, File.join('%root%', 'script')
  empty_directory :'test/models', File.join('%root%', 'test', 'models')
  empty_directory :'test/tasks', File.join('%root%', 'test', 'tasks')

  files = [
   ['Rakefile'],
   ['initialize.rb'],
   ['config' ,'database.yml'   ],
   ['script' ,'generate'       ],
   ['test'   ,'test_helper.rb' ],
  ]

  files.each do |file_array|
    file file_array.last.to_sym, File.join(*file_array), File.join('%root%',*file_array)
  end  

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sweetsie-0.0.2 lib/sweetsie/generators/new_project_generator.rb