html_ina 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/html_ina.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a824d2ae50b5bacd051c313a5cdf5be231e620ef46e5189472e0c361c9355a92
|
4
|
+
data.tar.gz: 892dc4dedbade199b7af5826880234a98739473cfae66451954475983e4dd067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a350167324d97c1c201b3663bf28554c9817e7216949e0dd72202abb59e788bda0c24a3864eef18725d14e4610ee80e9eb76187c9ede5fa3bf31eed4e77701e
|
7
|
+
data.tar.gz: 82a7db0e40eda04786201a5f55ed2aa4f142924f51b8158534849c3e773d54cab8cd210be663ffa0a5227bbf2c22ec6e2438c668e72d02a1bac1b5ea062d8717
|
data/lib/html_ina.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
|
1
|
+
class GetHtml
|
2
|
+
def get(content, bypass_html: false, file_name: 'index.html')
|
3
|
+
paste = content.gsub(/[<>]/, '') unless bypass_html
|
2
4
|
|
3
|
-
class HTMLSaver
|
4
|
-
def self.save(body, file_name: 'index.html', bypass_html: false)
|
5
|
-
body = Sanitize.fragment(body) unless bypass_html
|
6
5
|
File.open(file_name, 'w+') do |f|
|
7
|
-
|
8
|
-
<!
|
6
|
+
html = <<~HTML
|
7
|
+
<!doctype html>
|
9
8
|
<html lang="en">
|
10
9
|
<head>
|
11
|
-
|
12
|
-
|
10
|
+
<meta charset="UTF-8">
|
11
|
+
<title>#{file_name}</title>
|
13
12
|
</head>
|
14
13
|
<body>
|
15
|
-
|
14
|
+
<div class="info">
|
15
|
+
#{content}
|
16
|
+
</div>
|
16
17
|
</body>
|
17
18
|
</html>
|
18
19
|
HTML
|
19
20
|
f.write(html)
|
20
|
-
end
|
21
21
|
end
|
22
22
|
end
|