2017-08-14 13:08:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-21 09:08:33 -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:
|
2016-12-23 05:20:01 -05:00
|
|
|
private
|
2010-03-21 14:30:42 -04:00
|
|
|
|
2016-08-06 13:55:02 -04:00
|
|
|
def formats
|
|
|
|
[format]
|
|
|
|
end
|
2013-12-19 19:12:55 -05:00
|
|
|
|
2016-08-06 13:55:02 -04:00
|
|
|
def format
|
|
|
|
:html
|
|
|
|
end
|
2010-03-21 14:30:42 -04:00
|
|
|
|
2016-08-06 13:55:02 -04:00
|
|
|
def handler
|
|
|
|
:erb
|
|
|
|
end
|
2010-03-21 14:30:42 -04:00
|
|
|
|
2017-03-03 22:05:18 -05:00
|
|
|
def filename_with_extensions(name, file_format = format)
|
|
|
|
[name, file_format, handler].compact.join(".")
|
2016-08-06 13:55:02 -04:00
|
|
|
end
|
2009-06-25 06:57:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|