2010-06-12 01:13:58 +00:00
|
|
|
module Locomotive
|
|
|
|
class InstallGenerator < Rails::Generators::Base
|
|
|
|
|
|
|
|
def self.source_root
|
2010-07-13 00:46:17 +00:00
|
|
|
@_locomotive_source_root ||= File.expand_path('../templates', __FILE__)
|
2010-06-12 01:13:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def copy_initializer
|
2010-07-13 00:46:17 +00:00
|
|
|
template 'locomotive.rb', 'config/initializers/locomotive.rb'
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
def seed_db
|
|
|
|
append_file 'db/seeds.rb', %{
|
|
|
|
# Uncomment the following lines if you want to create the first website / account
|
|
|
|
#account = Account.create! :name => 'Admin', :email => 'admin@example.com', :password => 'locomotive', :password_confirmation => 'locomotive'
|
|
|
|
#site = Site.new :name => 'Locomotive test website', :subdomain => 'test'
|
|
|
|
#site.memberships.build :account => account, :admin => true
|
|
|
|
#site.save!}
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
def show_readme
|
|
|
|
readme 'README'
|
2010-06-12 01:13:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|