Class: Hanamismith::Builders::Layout

Inherits:
Rubysmith::Builders::Abstract
  • Object
show all
Defined in:
lib/hanamismith/builders/layout.rb

Overview

Builds app layout.

Instance Method Summary collapse

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/hanamismith/builders/layout.rb', line 11

def call
  path = "%project_name%/app/templates/layouts/app.html.erb.erb"
  builder.call(settings.with(template_path: path))
         .render
         .replace("<!-- title -->", "<%= content_for :title %>")
         .replace("<!-- favicon -->", favicon)
         .replace("<!-- icon -->", icon)
         .replace("<!-- apple_icon -->", apple_icon)
         .replace("<!-- manifest -->", manifest)
         .replace("<!-- stylesheet -->", stylesheet)
         .replace("<!-- javascript -->", javascript)
         .replace("<!-- yield -->", "<%= yield %>")
         .replace("<!-- flash:alert -->", flash(:alert))
         .replace("<!-- flash:notice -->", flash(:notice))

  true
end