2009-09-24 17:01:31 -04:00
|
|
|
require 'rails/generators/named_base'
|
2009-06-25 06:57:58 -04:00
|
|
|
|
2012-10-10 16:18:37 -04:00
|
|
|
module Erb # :nodoc:
|
|
|
|
module Generators # :nodoc:
|
2009-07-01 06:38:08 -04:00
|
|
|
class Base < Rails::Generators::NamedBase #:nodoc:
|
2010-03-21 14:30:42 -04:00
|
|
|
protected
|
|
|
|
|
2013-12-19 19:12:55 -05:00
|
|
|
def formats
|
2014-03-04 07:42:15 -05:00
|
|
|
[format]
|
2013-12-19 19:12:55 -05:00
|
|
|
end
|
|
|
|
|
2010-03-21 14:30:42 -04:00
|
|
|
def format
|
|
|
|
:html
|
|
|
|
end
|
|
|
|
|
|
|
|
def handler
|
|
|
|
:erb
|
|
|
|
end
|
|
|
|
|
2014-02-20 17:39:45 -05:00
|
|
|
def filename_with_extensions(name, format = self.format)
|
2010-03-21 14:30:42 -04:00
|
|
|
[name, format, handler].compact.join(".")
|
|
|
|
end
|
2009-06-25 06:57:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|