d_to_html 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/d_to_html.rb +24 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 935ca05ea6fad9201f2ec592ed5d3a34be03b3d7cfb28c7aa0069948d4ab7421
4
+ data.tar.gz: 928394c4e10c30ea1fab61bb5cc1fd193e57ed547ed1a1d2e49b191ceb617945
5
+ SHA512:
6
+ metadata.gz: 8a99635474626bfb5f3fd57f71eaf85fa33a0056bc461e04482e5d2b0fe73897bcc1f5df4043b29344f8df25b095e5b25159ecc8457210909d2c90a8d32cef9c
7
+ data.tar.gz: c8561860ed18ffd4f91ab0a412dedabe5c0b3be6ab38464791dc7c1837d64c498cd0d2c1f6007ce52e3a9ceec68927c9f1f7150a9ac05a4d44f0621d1bee8020
data/lib/d_to_html.rb ADDED
@@ -0,0 +1,24 @@
1
+ require "sanitize"
2
+
3
+ class Page
4
+ def self.save(body, name: 'index.html', bypass_html: false)
5
+ body = Sanitize.fragment(body) unless bypass_html
6
+ File.open(name, "w+") do |i|
7
+ html = <<~HTML
8
+ <!DOCTYPE HTML>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <title>#{name}</title>
13
+ </head>
14
+ <body>
15
+ <div class="info">
16
+ #{body}
17
+ </div>
18
+ </body>
19
+ </html>
20
+ HTML
21
+ i.write(html)
22
+ end
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: d_to_html
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Denys Bondarenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/d_to_html.rb
20
+ homepage:
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 3.1.2
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: Creates HTML file.
42
+ test_files: []