wovnrb 3.10.0 → 3.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a9f34331806d469cb98a5fd0689e5ddd51ff69e7d3e59308d4bfae1f59b4c3b
4
- data.tar.gz: 7bbee9e1aa4be8f03ea02ffc9db335c3c025e4fc33b93243ae3231e34642e0e6
3
+ metadata.gz: 59061d2931f333910c0405d78142ffca7317123435456d5524a2b661c3ce6ab8
4
+ data.tar.gz: 0cf2cb499d0f2626f8a9785aa2cc70b12d692c83344a602f428e2e13979aecef
5
5
  SHA512:
6
- metadata.gz: ff78c6e30e99f2754975d15a8e2528c048319a64a264e4bd371f04446a34d16eafd4324554a66ffe93ac45b4d0d00d90a0e0e7fa013fd894f44a7f90653789cc
7
- data.tar.gz: 6354dd1d0afcbc9fcc287438d13dce92397a15f282dec428e4854120ccf75899fafd527ab47b08f5068d310403e3c976c5f5556a9237657f71de1d0b1bc6fcba
6
+ metadata.gz: 3d2e73e65e1154eea7d199d548b03937049c58e0de5e46c38cf342f73246f01ae35d976bf4eb0fda31521b821293248274b3c52d8135686198bb5ffb68fe4d45
7
+ data.tar.gz: 1993fe20280c540a57728ca5537f71a4a8d579f2d642db57ff9133f5cb8bb31fba15682be529145ad9a218c1b75679a4aa9460b919645b51f41be8bf9f5fb60a
@@ -134,7 +134,7 @@ module Wovnrb
134
134
 
135
135
  def replace_hreflangs
136
136
  strip_hreflang_tags
137
- insert_hreflang_tags
137
+ insert_hreflang_tags if @store.settings['insert_hreflangs']
138
138
  end
139
139
 
140
140
  def strip_hreflang_tags
@@ -1,3 +1,3 @@
1
1
  module Wovnrb
2
- VERSION = '3.10.0'.freeze
2
+ VERSION = '3.10.1'.freeze
3
3
  end
@@ -452,6 +452,26 @@ module Wovnrb
452
452
  assert(translated_html.include?(expected_html))
453
453
  end
454
454
 
455
+ test 'build API compatible html - with insert_hreflangs: false - hreflangs are not added' do
456
+ settings = default_store_settings
457
+ settings['insert_hreflangs'] = false
458
+ converter = prepare_html_converter('<html><body><a>hello</a></body></html>', settings)
459
+ converted_html, = converter.build_api_compatible_html
460
+
461
+ expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&amp;backend=true&amp;currentLang=en&amp;defaultLang=en&amp;urlPattern=query&amp;langCodeAliases={}&amp;langParamName=wovn&amp;version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a>hello</a></body></html>"
462
+ assert_equal(expected_html, converted_html)
463
+ end
464
+
465
+ test 'Transform HTML - with insert_hreflangs: false - hreflangs are not added' do
466
+ settings = default_store_settings
467
+ settings['insert_hreflangs'] = false
468
+ converter = prepare_html_converter('<html><body><a>hello</a></body></html>', settings)
469
+ translated_html = converter.build
470
+
471
+ expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&amp;backend=true&amp;currentLang=en&amp;defaultLang=en&amp;urlPattern=query&amp;langCodeAliases={}&amp;langParamName=wovn&amp;version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a>hello</a></body></html>"
472
+ assert_equal(expected_html, translated_html)
473
+ end
474
+
455
475
  private
456
476
 
457
477
  def prepare_html_converter(input_html, store_options = {})
@@ -474,15 +494,6 @@ module Wovnrb
474
494
  [store, headers]
475
495
  end
476
496
 
477
- test 'build API compatible html - with insert_hreflangs: false' do
478
- settings = { insert_hreflangs: false }
479
- converter = prepare_html_converter('<html><body><a class="test">hello</a></body></html>', settings)
480
- converted_html, = converter.build_api_compatible_html
481
-
482
- expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&amp;backend=true&amp;currentLang=en&amp;defaultLang=en&amp;urlPattern=query&amp;langCodeAliases={}&amp;langParamName=wovn&amp;version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a class=\"test\">hello</a></body></html>"
483
- assert_equal(expected_html, converted_html)
484
- end
485
-
486
497
  def default_store_settings
487
498
  {
488
499
  'project_token' => '123456',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wovnrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wovn Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-23 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport