1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/generators/devise/views_generator.rb

27 lines
848 B
Ruby
Raw Normal View History

2010-12-25 05:07:52 -05:00
require 'tmpdir'
module Devise
module Generators
class ViewsGenerator < Rails::Generators::Base
source_root File.expand_path("../../../../app/views", __FILE__)
desc "Copies all Devise views to your application."
argument :scope, :required => false, :default => nil,
:desc => "The scope to copy views to"
class_option :template_engine, :type => :string, :aliases => "-t",
:desc => "Template engine for the views. Available option is only 'erb'."
def copy_views
template = options[:template_engine].to_s
case template
when "haml", "slim"
warn "#{template} templates have been removed from Devise gem"
else
directory "devise", "app/views/#{scope || :devise}"
end
end
end
end
end