html_creator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/html_creator.rb +23 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 29d06f4b78f57982a7913358aa04ff7b71c55c441b95695bbf17d787479f1669
4
+ data.tar.gz: 168ee7fb6cebb531ac8034b9ea684bb3f34bf18059145853f27a65ee8bc628af
5
+ SHA512:
6
+ metadata.gz: 67495ffdf685f87648428835eb9bd9f10a44a18de13600926a940c27af9501ab5b48d199713c61b22cf39bcefcd4699df98c8237537bc67534ead71a2a6acd6f
7
+ data.tar.gz: 2e666527a7f159a5e6f2438d1376d00f856f850d2010091b3f9be32b3e4fc9ab6343e46dc83bb122db88b709c89b5f19c995d9e999f8dfe22c60b7452943c809
@@ -0,0 +1,23 @@
1
+ require 'sanitize'
2
+
3
+ class HTMLCreator
4
+ def html_create(content, bypass_html, file_name = 'index.html')
5
+ content = Sanitize.fragment(content) unless bypass_html
6
+ content = content unless bypass_html == false
7
+
8
+ f = File.open(file_name, "w+")
9
+ f.puts "<!DOCTYPE html>"
10
+ f.puts "<html lang=\"uk\">"
11
+ f.puts " <head>"
12
+ f.puts " <meta charset='utf-8'>"
13
+ f.puts " <title>Tamagochi</title>"
14
+ f.puts " </head>"
15
+ f.puts " <body>"
16
+ f.puts " <script>"
17
+ f.puts " </script>"
18
+ f.puts " #{content}"
19
+ f.puts " </body>"
20
+ f.puts "</html>"
21
+ f.close
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html_creator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Oleksii Tupota
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/html_creator.rb
20
+ homepage: https://github.com/Aztec0/html_creator.git
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.2.32
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: A gem what save the content in HTML file
42
+ test_files: []