fillson22_make_html 0.1.0 → 0.3.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 +4 -4
  2. data/lib/fillson22_make_html.rb +24 -10
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc685696c8376fc9f648e58f9c29848c71deb128267977efc3b9344cb9813aad
4
- data.tar.gz: 308ce46e27b0a7051a5d0923971b779a31773dc00de9369fcc5c34fb6f0bc610
3
+ metadata.gz: 404fb9fc529685e64a255a1fac1b4db234fc087c3f0f80aa4713c075ddb30fe7
4
+ data.tar.gz: 171f7ad5e14b9671c6e8c523fef9e1835ea8a0867769a9a1c3797b8b84d224fa
5
5
  SHA512:
6
- metadata.gz: fc385eab829ab2c97cc631c9294783ebc4ec6a27d84e17f8d5456f014fea80c2fca3a353d9dccac52c22cd8c0532c3495fbb072a5e610a5298513dbb58fca693
7
- data.tar.gz: cabe5cbda215b520d8f751dcefcfc7dd84e0eb1d1f973bb2e274abfbe03cfdcbfb428fc785ace60cc77ee79e72d39c31510add6734fcb0e562814fd3cedefca3
6
+ metadata.gz: befdf83ac88263722bb07747106a2a1e3cfb62e8548e238deb5806a5b063ebdc88febd07b1265bc2e28ebf087d7fc2046dc327a4f10e1718f3d2aee58e3d5a97
7
+ data.tar.gz: 3afde1bb65b7fbe9a845648fd79137d562785500f3fa70d2a8c8830b147eeaefbd1e538a3c538d9c6b95f476f0bf65a9b8e919fecd28c4852ce14b890e1907cf
@@ -1,11 +1,25 @@
1
- def greate_file
2
- fileHtml = File.open("index.html", "w+")
3
- fileHtml.puts "<HTML><BODY>"
4
- fileHtml.puts "<p> Имя - #{@name} </p>"
5
- fileHtml.puts "<p> Сыт - #{@full} </p>"
6
- fileHtml.puts "<p> Усталость - #{@fatigue} </p>"
7
- fileHtml.puts "<p> Возраст - #{@age} </p>"
8
- fileHtml.puts "<p> Здоровье - #{@health} </p>"
9
- fileHtml.puts "</BODY></HTML>"
10
- fileHtml.close()
1
+ require "sanitize"
2
+
3
+ class List
4
+ def self.greate(body, name: 'index.html', bypass_html: false)
5
+ body = Sanitize.fragment(body) unless bypass_html
6
+ File.open(name, "w+") do |code|
7
+ html_code = <<~HTML
8
+ <!DOCTYPE html>
9
+ <html lang="ru">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <title>Тамагочи</title>
13
+ </head>
14
+ <body>
15
+ #{body}
16
+ <div style="font-size:5rem;width:100%;text-align:center;">
17
+ #{emodzi}
18
+ </div>
19
+ </body>
20
+ </html>
21
+ HTML
22
+ code.write(html_code)
23
+ end
24
+ end
11
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fillson22_make_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iliya Filippov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-05 00:00:00.000000000 Z
11
+ date: 2022-11-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/fillson22_make_html.rb
20
- homepage: https://github.com/fillson22/RubyHW/HW3/Fillson22_make_html
20
+ homepage: https://github.com/fillson22/Fillson22_make_html
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}