Skip to content

Commit

Permalink
Add generator for copying assets for customization
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismytton committed Mar 9, 2013
1 parent 889c42b commit 5eaa0ad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/generators/fancybox_rails_generator.rb
@@ -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

0 comments on commit 5eaa0ad

Please sign in to comment.