Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generator for copying assets for customization
- Loading branch information
1 parent
889c42b
commit 5eaa0ad
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
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,13 @@ | ||
class FancyboxRailsGenerator < Rails::Generators::Base | ||
source_root File.expand_path("../../../vendor/assets", __FILE__) | ||
|
||
desc "Copy FancyBox into lib/ for customization" | ||
def copy_assets | ||
dir = Pathname.new(self.class.source_root) | ||
Dir[self.class.source_root + '/**/*'].each do |entry| | ||
next if File.directory?(entry) | ||
file = Pathname.new(entry).relative_path_from(dir) | ||
copy_file file, "lib/assets/#{file}" | ||
end | ||
end | ||
end |