mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Added verification for HAML >= 2.3.
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
90e8253205
commit
cbd35a846a
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,7 @@ class DeviseViewsGenerator < Rails::Generators::Base
|
|||
directory "devise", "app/views/devise/#{scope}"
|
||||
when "haml"
|
||||
require 'haml'
|
||||
verify_haml_version
|
||||
create_and_copy_haml_views
|
||||
end
|
||||
end
|
||||
|
@ -40,4 +41,11 @@ class DeviseViewsGenerator < Rails::Generators::Base
|
|||
|
||||
directory devise_haml_source_root, "app/views/devise/#{scope}"
|
||||
end
|
||||
|
||||
def verify_haml_version
|
||||
unless Haml.version[:major] >= 2 and Haml.version[:minor] >= 3
|
||||
say "To generate HAML templates, you need to install HAML 2.3 or above."
|
||||
exit
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue