removed Gemfile's injection

by default : Markerb define then markerb email views generated otherwise
erb
This commit is contained in:
Bounmy Stephane
2011-09-30 22:41:02 -07:00
parent a629654a15
commit 76bff0d4de
2 changed files with 12 additions and 50 deletions

View File

@@ -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