Class: Vanity::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/vanity/views_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_view_filesObject


4
5
6
7
# File 'lib/generators/vanity/views_generator.rb', line 4

def create_view_files
  Vanity::ViewsGenerator.source_root(destination_directory)
  directory source_directory, destination_directory
end

#destination_directoryObject


9
10
11
# File 'lib/generators/vanity/views_generator.rb', line 9

def destination_directory
  File.join(Rails.root, 'app', 'views', 'vanity')
end

#source_directoryObject


13
14
15
# File 'lib/generators/vanity/views_generator.rb', line 13

def source_directory
  File.join(File.dirname(__FILE__), '..', '..', 'vanity', 'templates')
end