4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# 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 style="font-size:5rem;width:100%;text-align:center;">
#{emodzi}
</div>
</body>
</html>
HTML
code.write(html_code)
end
end
|