Skip to content

Commit

Permalink
new generator to copy stylesheet and javascript file
Browse files Browse the repository at this point in the history
  • Loading branch information
QuBiT committed Aug 24, 2010
1 parent c413615 commit 50ef933
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'rails/generators'

module ExceptionLogger
class StylescriptsGenerator < Rails::Generators::Base
desc "Copies exception_logger.css to public/stylesheets/ and copies exception_logger.js to public/javascripts/"

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

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

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

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

0 comments on commit 50ef933

Please sign in to comment.