2010-12-25 05:07:52 -05:00
|
|
|
require 'tmpdir'
|
|
|
|
|
2010-06-13 07:04:24 -04:00
|
|
|
module Devise
|
|
|
|
module Generators
|
|
|
|
class ViewsGenerator < Rails::Generators::Base
|
2010-07-04 11:08:00 -04:00
|
|
|
source_root File.expand_path("../../../../app/views", __FILE__)
|
2010-06-13 07:04:24 -04:00
|
|
|
desc "Copies all Devise views to your application."
|
|
|
|
|
|
|
|
argument :scope, :required => false, :default => nil,
|
|
|
|
:desc => "The scope to copy views to"
|
|
|
|
|
2011-04-05 16:06:27 -04:00
|
|
|
# class_option :template_engine, :type => :string, :aliases => "-t",
|
|
|
|
# :desc => "Template engine for the views. Available options are 'erb', 'haml' and 'slim'."
|
2010-06-13 07:04:24 -04:00
|
|
|
|
|
|
|
def copy_views
|
2011-04-05 16:06:27 -04:00
|
|
|
directory "devise", "app/views/#{scope || :devise}"
|
2010-06-13 07:04:24 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-01-11 05:56:43 -05:00
|
|
|
end
|