Sha256: ededcce73c09517da96d3cbc625758918e92ec55e6baaca43fd92ab0466b3007
Contents?: true
Size: 941 Bytes
Versions: 2
Compression:
Stored size: 941 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'], ['config' ,'database.yml' ], ['config' ,'initialize.rb' ], ['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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sweetsie-0.1.1 | lib/sweetsie/generators/new_project_generator.rb |
sweetsie-0.1.0 | lib/sweetsie/generators/new_project_generator.rb |