Class: GetHtml
- Inherits:
-
Object
- Object
- GetHtml
- Defined in:
- lib/html_ina.rb
Class Method Summary collapse
Class Method Details
.get(content, bypass_html: false, file_name: 'index.html') ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/html_ina.rb', line 2 def self.get(content, bypass_html: false, file_name: 'index.html') paste = content.gsub(/[<>]/, '') unless bypass_html File.open(file_name, 'w+') do |f| html = " <!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>\#{file_name}</title>\n </head>\n <body>\n <div class=\"info\">\n \#{content}\n </div>\n </body>\n </html>\n HTML\n f.write(html)\n end\nend\n" |