class Moromi::Error::Generators::ViewsGenerator

Private Instance Methods

copy_html_templates() click to toggle source
# File lib/generators/moromi/error/views_generator.rb, line 25
def copy_html_templates
  filename_pattern = File.join self.class.source_root, "*.html.#{template_engine}"
  Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
    copy_file f, "app/views/moromi/error/#{f}"
  end
end
copy_jb_templates() click to toggle source
# File lib/generators/moromi/error/views_generator.rb, line 39
def copy_jb_templates
  filename_pattern = File.join self.class.source_root, "*.json.jb"
  Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
    copy_file f, "app/views/moromi/error/#{f}"
  end
end
copy_jbuilder_templates() click to toggle source
# File lib/generators/moromi/error/views_generator.rb, line 32
def copy_jbuilder_templates
  filename_pattern = File.join self.class.source_root, "*.json.jbuilder"
  Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
    copy_file f, "app/views/moromi/error/#{f}"
  end
end
template_engine() click to toggle source
# File lib/generators/moromi/error/views_generator.rb, line 46
def template_engine
  options[:template_engine]&.to_s&.downcase || 'erb'
end