html_ina 0.1.0

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/html_ina.rb +22 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f1df4067e04568800f1e579b4b8e05c4bde52b7d389e775298d3fda951724728
4
+ data.tar.gz: 6408867913e706f51f55391ae20fd088115ef40da177a5fe0da886370b0ecc8d
5
+ SHA512:
6
+ metadata.gz: 886eb0ed45923f83bb1f3fb9d2adc38fad6253fccc44029be7d26e2a3e779926bc1270cfa862281e4a8f2bebe45b839a35f9cb3da41fbdff2560330a8bfc10a6
7
+ data.tar.gz: 2c80df8aaa7be63f6c0f1667b928e6fa0eb9484be11d7c1c4f8f0d33e344e1cf15df02c494e3019fb0c88ec0f2a7d23e0b9b36736575d94d49931e808e4bb396
data/lib/html_ina.rb ADDED
@@ -0,0 +1,22 @@
1
+ require 'sanitize'
2
+
3
+ class HTMLSaver
4
+ def self.save(body, file_name: 'index.html', bypass_html: false)
5
+ body = Sanitize.fragment(body) unless bypass_html
6
+ File.open(file_name, 'w+') do |f|
7
+ html = <<~HTML
8
+ <!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <title>#{file_name}</title>
12
+ <meta charset="utf-8">
13
+ </head>
14
+ <body>
15
+ #{body}
16
+ </body>
17
+ </html>
18
+ HTML
19
+ f.write(html)
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html_ina
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nazar Volynets
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Gem which accepts content and stores content and passed it to the html
14
+ page
15
+ email: nazarvolynets55@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/html_ina.rb
21
+ homepage: https://github.com/setwith
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.22
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Passed content to the html page
44
+ test_files: []