Class: TamedBeast::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Actions
Defined in:
lib/generators/tamed_beast/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/generators/tamed_beast/install_generator.rb', line 7

def self.source_root
  File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#add_default_routesObject



11
12
13
# File 'lib/generators/tamed_beast/install_generator.rb', line 11

def add_default_routes
  route(File.read(File.join(File.dirname(__FILE__), 'templates/routes.rb') ), "config/routes.rb")
end

#copy_pluginsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/generators/tamed_beast/install_generator.rb', line 15

def copy_plugins
  to = File.join(Rails.root, 'vendor/plugins/')
  
  from = File.join(File.dirname(__FILE__), '../../../vendor/plugins/white_list')
  copy_files(from, to, :plugin, "vendor/plugins/white_list")
  
  from = File.join(File.dirname(__FILE__), '../../../vendor/plugins/white_list_formatted_content')
  copy_files(from, to, :plugin, "vendor/plugins/white_list_formatted_content")
  
  from = File.join(File.dirname(__FILE__), '../../../test/')
  contents = Dir.glob( File.join(from, '**', '*') )
  copy_files(from, Rails.root, :test, contents)
end