Class: PageController
- Inherits:
-
Object
- Object
- PageController
- Defined in:
- lib/fillson22_make_html.rb
Class Method Summary collapse
Class Method Details
.greate(body, name: 'index.html', bypass_html: false) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fillson22_make_html.rb', line 4 def self.greate(body, name: 'index.html', bypass_html: false) body = Sanitize.fragment(body) unless bypass_html File.open(name, "w+") do |code| html_code = <<~HTML <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <title>Тамагочи</title> </head> <body> #{body} </div> </body> </html> HTML code.write(html_code) end end |