ghost_in_the_post 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/lib/ghost_in_the_post/js_inline.rb +2 -7
- data/lib/ghost_in_the_post/version.rb +1 -1
- data/spec/dummy/Gemfile.lock +1 -1
- data/spec/dummy/log/development.log +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7aa0dd4f405673caca79f8fb8557b7c5cbb5cb55
|
|
4
|
+
data.tar.gz: 82e2565a50909c07b0e88f9185b99ffe58450d2c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a86e3b383b4a1f514b51ff044ae4039fe464f5ef7c2710aa9e8576238a65285129377a32d5b0e67b31fbed79291fec9d885f5e22335ae3a81f707beab258789e
|
|
7
|
+
data.tar.gz: 97b696dcfb777805d9e991e0157ea7aa9b05df04d5d37a7a0c1956a711ccaba4452c2810dd40a553cd1ae8aee0bdc0c1f45834699642693f0be0e874cce244fe
|
|
@@ -12,7 +12,7 @@ module GhostInThePost
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def inline
|
|
15
|
-
|
|
15
|
+
@dom.at_xpath('html/body').add_child("<script>#{generate_flat_js}</script>")
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def remove_all_script
|
|
@@ -29,11 +29,6 @@ module GhostInThePost
|
|
|
29
29
|
|
|
30
30
|
private
|
|
31
31
|
|
|
32
|
-
def create_script_element(script_blocks, body)
|
|
33
|
-
return unless body
|
|
34
|
-
body.add_child("<script>#{@dom.create_cdata(script_blocks.join("\n"))}</script>")
|
|
35
|
-
end
|
|
36
|
-
|
|
37
32
|
def generate_flat_js
|
|
38
33
|
injectable_scripts.map do |script|
|
|
39
34
|
asset = find_asset_in_pipeline(script)
|
|
@@ -41,7 +36,7 @@ module GhostInThePost
|
|
|
41
36
|
raise AssetNotFoundError.new("cannot find asset #{normalize_asset_name(script)}")
|
|
42
37
|
end
|
|
43
38
|
asset.to_s unless asset.nil?
|
|
44
|
-
end.compact
|
|
39
|
+
end.compact.join("\n")
|
|
45
40
|
end
|
|
46
41
|
|
|
47
42
|
def injectable_scripts
|
data/spec/dummy/Gemfile.lock
CHANGED
|
@@ -530,3 +530,7 @@ AutoMailer#normal_email: processed outbound mail in 561.1ms
|
|
|
530
530
|
Rendered auto_mailer/normal_email.text (0.9ms)
|
|
531
531
|
|
|
532
532
|
AutoMailer#normal_email: processed outbound mail in 518.5ms
|
|
533
|
+
Rendered auto_mailer/normal_email.html.erb (237.4ms)
|
|
534
|
+
Rendered auto_mailer/normal_email.text (0.6ms)
|
|
535
|
+
|
|
536
|
+
AutoMailer#normal_email: processed outbound mail in 499.7ms
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ghost_in_the_post
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Anema
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|