Class: ExceptionLogger::StylescriptsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/exception_logger/stylescripts/stylescripts_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



12
13
14
# File 'lib/generators/exception_logger/stylescripts/stylescripts_generator.rb', line 12

def self.banner
  "rails generate exception_logger:stylescripts [options]"
end

.source_rootObject



7
8
9
10
# File 'lib/generators/exception_logger/stylescripts/stylescripts_generator.rb', line 7

def self.source_root
  # Set source directory for the templates to the rails2 generator template directory
  @source_root ||= File.expand_path(File.join('..', '..', '..', '..', 'public'), File.dirname(__FILE__))
end

Instance Method Details

#copy_filesObject



16
17
18
19
20
21
22
# File 'lib/generators/exception_logger/stylescripts/stylescripts_generator.rb', line 16

def copy_files
  empty_directory 'public/stylesheets'
  template 'stylesheets/exception_logger.css', 'app/assets/stylesheets/exception_logger.css'

  empty_directory 'public/javascripts'
  template 'javascripts/exception_logger.js', 'app/assets/javascripts/exception_logger.js'
end