forked from QuBiT/exception_logger
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new generator to copy stylesheet and javascript file
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
lib/generators/exception_logger/stylescripts/stylescripts_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |