mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
removed Gemfile's injection
by default : Markerb define then markerb email views generated otherwise erb
This commit is contained in:
@@ -77,34 +77,6 @@ module Devise
|
||||
def target_path
|
||||
"app/views/#{scope || :devise}/mailer"
|
||||
end
|
||||
|
||||
def inject_makerb_content
|
||||
if gemfile
|
||||
append_file gemfile_path, gemfile_content unless gemfile =~ gemfile_content_regexp
|
||||
else
|
||||
create_file gemfile_path, gemfile_content
|
||||
end
|
||||
end
|
||||
|
||||
def gemfile_path
|
||||
@gemfile_path ||= File.join(destination_root, "Gemfile")
|
||||
end
|
||||
|
||||
def gemfile_content
|
||||
"gem 'markerb'"
|
||||
end
|
||||
|
||||
def gemfile_content_regexp
|
||||
/gem ['|"]markerb['|"]/
|
||||
end
|
||||
|
||||
def gemfile
|
||||
begin
|
||||
File.read(gemfile_path)
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ViewsGenerator < Rails::Generators::Base
|
||||
@@ -119,7 +91,7 @@ module Devise
|
||||
:default => defined?(SimpleForm) ? "simple_form_for" : "form_for"
|
||||
|
||||
hook_for :markerb, :desc => "Generate markerb instead of erb mail views",
|
||||
:default => :erb,
|
||||
:default => defined?(Markerb) ? :markerb : :erb,
|
||||
:type => :boolean
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user