content_flip 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/content_flip.rb +20 -0
  3. metadata +43 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5de9f631ba56d8c03dc85d1ce0da2e5247802f8562a875cab91cd5dc7679d6b8
4
+ data.tar.gz: fb012dea7c80c670e6b5827e61f3bab97d7466640a171c1ce11830d85d33fa38
5
+ SHA512:
6
+ metadata.gz: 4a691f8717053ba06aa9d3dbc0d72f424001e83a7a0fd42390be7d58661380391b95dbaf146cd7ae50e103edce6f9cbf1e6921601e2ea35e0c22c4aba366b399
7
+ data.tar.gz: 45d49dbdac1c800a152c1f5411dcea733782a07ec71d8f01d12714a970332704ccc29d2df1bb3178c6830c5c421071ca7ab9a71098a8af3dc7bd461d802e694f
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'erb'
4
+
5
+ def get_content(content, file, bypass_html = false)
6
+ if bypass_html
7
+ @content = content
8
+ else
9
+ a = content.gsub(%r{<script.*?>[\s\S]*</script>}i, '')
10
+ @content = a.gsub(%r{</?[^>]*>}, '')
11
+ end
12
+
13
+ file = file.empty? ? 'index' : file
14
+ template = File.read('page.html.erb')
15
+ renderer = ERB.new(template).result
16
+
17
+ File.open("#{file}.html", 'w') do |f|
18
+ f.write(renderer)
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: content_flip
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mira Matsakova
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2010-04-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Add content to body
14
+ email: matsakovamira156@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/content_flip.rb
20
+ homepage: https://rubygems.org/gems/hola
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.0.1
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Add content
43
+ test_files: []