copy_tuner_client 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/copy_tuner_client/copyray_middleware.rb +12 -6
- data/lib/copy_tuner_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757532de573065d4b93a08c8bd5061a17c8fbef293d5f14a8ff24bb3815f3323
|
4
|
+
data.tar.gz: 5d6ceefe8fcb9b2d21ad9592e07d8e0ac68c9ef8684824e57e2a24d5f22afeb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1effa31089ac5b0b480196ff1fb9700b92b80a2137393467923c84150a252688c2bc4b33f5a1a63c84a58af9128866a22a784111dcd16842a24b0a00437e11f
|
7
|
+
data.tar.gz: 8e987b21c4b30714b056f2685f57b9b4157f505fb4ef6857b853ab1dd82b3bbaffd442f8add04c8ffed8d0c80d1f52e2eb00d2a452be6859cd42aa048c5ef602
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -37,14 +37,14 @@ module CopyTunerClient
|
|
37
37
|
if CopyTunerClient::TranslationLog.initialized?
|
38
38
|
json = CopyTunerClient::TranslationLog.translations.to_json
|
39
39
|
# Use block to avoid back reference \?
|
40
|
-
html
|
40
|
+
append_to_html_body(html, "<div id='copy-tuner-data' data-copy-tuner-translation-log='#{ERB::Util.html_escape json}' data-copy-tuner-url='#{CopyTunerClient.configuration.project_url}'></div>")
|
41
41
|
else
|
42
42
|
html
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
def inject_copy_tuner_bar(html)
|
47
|
-
html
|
47
|
+
append_to_html_body(html, render_copy_tuner_bar)
|
48
48
|
end
|
49
49
|
|
50
50
|
def render_copy_tuner_bar
|
@@ -59,19 +59,25 @@ module CopyTunerClient
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def append_css(html)
|
62
|
-
html
|
62
|
+
append_to_html_body(html, css_tag)
|
63
63
|
end
|
64
64
|
|
65
65
|
def append_js(html)
|
66
|
-
html.
|
67
|
-
"#{helpers.javascript_include_tag(:copyray)}\n#{Regexp.last_match}"
|
68
|
-
end
|
66
|
+
append_to_html_body(html, helpers.javascript_include_tag(:copyray))
|
69
67
|
end
|
70
68
|
|
71
69
|
def css_tag
|
72
70
|
helpers.stylesheet_link_tag :copyray, media: :all
|
73
71
|
end
|
74
72
|
|
73
|
+
def append_to_html_body(html, content)
|
74
|
+
content = content.html_safe if content.respond_to?(:html_safe)
|
75
|
+
return html unless html.include?('</body>')
|
76
|
+
|
77
|
+
position = html.rindex('</body>')
|
78
|
+
html.insert(position, content + "\n")
|
79
|
+
end
|
80
|
+
|
75
81
|
def file?(headers)
|
76
82
|
headers["Content-Transfer-Encoding"] == "binary"
|
77
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copy_tuner_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SonicGarden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|