wovnrb 1.0.9 → 1.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 664891e7c37cb4963af455731e9887e3a7a8465e
4
- data.tar.gz: 52001654f1c0b5d73a2c12f0e5701840a36f1275
3
+ metadata.gz: 6cc73d9dfe2ed5ef29f35c27e352fae25af5cb4b
4
+ data.tar.gz: 793854cea59a84a8e486326fde09526ab38c2e63
5
5
  SHA512:
6
- metadata.gz: 76ab34adcf751b8025b7855103e2453f7e320549d49609af352971ed56169757661fbd990fe2a471a40eb6cf14a8d490966b3bf1199137bc0c511735fdd06aef
7
- data.tar.gz: b36b536fc41e431c1df4384a61fcf832b8eb90e78aeec85c8ac657ad3d204ec22f7174c8fc737988193582e8b8183a2e16ee3f9aabb06a228d144864b4e78d61
6
+ metadata.gz: 1c211b45755b7f3e728eb8a5a0d852e627b3137d7de1ffb68322b2ea3b31fa8b5127c1b2d477a989a8a9315d58855d49340c0a50a838a0b91248dc2c0d7cca5d
7
+ data.tar.gz: 9aa78cdedf10dd61e2da3a394fd3fc37585c845e69c10e0562f08e6f282e9ea65e22749e983d8d5c02e97ae3c951b2ede5a5a063a4ebb3a7f3ffd815924c0721
@@ -1,3 +1,3 @@
1
1
  module Wovnrb
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.10"
3
3
  end
data/lib/wovnrb.rb CHANGED
@@ -105,7 +105,7 @@ module Wovnrb
105
105
  # If this page has wovn-ignore in the html tag, don't do anything
106
106
  if ignore_all || !d.xpath('//html[@wovn-ignore]').empty? || is_amp_page?(d)
107
107
  ignore_all = true
108
- output = d.to_html.gsub(/href="([^"]*)"/) { |m| "href=\"#{URI.decode($1)}\"" }
108
+ output = d.to_html(save_with: 0).gsub(/href="([^"]*)"/) { |m| "href=\"#{URI.decode($1)}\"" }
109
109
  put_back_noscripts!(output, noscripts)
110
110
  new_body.push(output)
111
111
  next
@@ -115,7 +115,7 @@ module Wovnrb
115
115
  output = lang.switch_dom_lang(d, @store, values, url, headers)
116
116
  else
117
117
  ScriptReplacer.new(@store).replace(d, lang)
118
- output = d.to_html
118
+ output = d.to_html(save_with: 0)
119
119
  end
120
120
  put_back_noscripts!(output, noscripts)
121
121
  new_body.push(output)
@@ -182,16 +182,9 @@ class WovnrbTest < Minitest::Test
182
182
  url = h.url
183
183
  swapped_body = i.switch_lang([body], values, url, 'ja', h)
184
184
 
185
- expected_body = "<html>
186
- <head>
187
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
188
- <script src=\"//j.wovn.io/1\" async=\"true\" data-wovnio=\"key=&amp;backend=true&amp;currentLang=ja&amp;defaultLang=en&amp;urlPattern=path&amp;langCodeAliases={}&amp;version=#{Wovnrb::VERSION}\"> </script>
189
- </head>
190
- <body>
191
- <h1>Mr. Belvedere Fan Club</h1>
185
+ expected_body = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"//j.wovn.io/1\" async=\"true\" data-wovnio=\"key=&amp;backend=true&amp;currentLang=ja&amp;defaultLang=en&amp;urlPattern=path&amp;langCodeAliases={}&amp;version=#{Wovnrb::VERSION}\"> </script></head><body><h1>Mr. Belvedere Fan Club</h1>
192
186
  <div><p>Hello</p></div>
193
- </body>
194
- </html>
187
+ </body></html>
195
188
  "
196
189
  assert_equal([expected_body], swapped_body)
197
190
  end
@@ -209,18 +202,13 @@ class WovnrbTest < Minitest::Test
209
202
  </html>
210
203
  HTML
211
204
  expected_body = <<HTML
212
- <html amp="">
213
- <head>
214
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
215
- <noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
216
- </head>
205
+ <html amp=""><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript></head>
217
206
  <body>
218
207
  <h1>Mr. Belvedere Fan Club</h1>
219
208
  <div><p>Hello</p></div>
220
209
 
221
210
 
222
- </body>
223
- </html>
211
+ </body></html>
224
212
  HTML
225
213
  values = generate_values
226
214
  url = headers.url
@@ -241,15 +229,12 @@ HTML
241
229
  </html>
242
230
  HTML
243
231
  expected_body = <<HTML
244
- <html ⚡="">
245
- <head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>
246
- <body>
232
+ <html ⚡=""><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>
247
233
  <h1>Mr. Belvedere Fan Club</h1>
248
234
  <div><p>Hello</p></div>
249
235
 
250
236
 
251
- </body>
252
- </html>
237
+ </body></html>
253
238
  HTML
254
239
  values = generate_values
255
240
  url = headers.url
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wovnrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Sandford
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-09-04 00:00:00.000000000 Z
12
+ date: 2018-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogumbo
@@ -412,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
412
  version: '0'
413
413
  requirements: []
414
414
  rubyforge_project:
415
- rubygems_version: 2.2.0
415
+ rubygems_version: 2.6.11
416
416
  signing_key:
417
417
  specification_version: 4
418
418
  summary: Gem for WOVN.io