arosa 0.1.9 → 0.2.0

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
  SHA256:
3
- metadata.gz: 7685471c75ede43f503a18f563da2f1374994f01ad3dffaea4a65c96faf9d6e9
4
- data.tar.gz: 3e122ff6e1eac8bd6d0140bc3367329383538a7b9b7b6ee90ad4cbed37adbcea
3
+ metadata.gz: 70e5e34726227bff7463740555b527bbd1287d3aec1b8a8cd88866e0a92669df
4
+ data.tar.gz: 70a7da01a44cb4a098a066e5dbac3048fcef89a488b5f5745386708698c67abd
5
5
  SHA512:
6
- metadata.gz: 986b0ecdcd2d8e3fdb1f328b729276da2f7f370b30ff3261c2665d9c221ebd9ece4713e1303241cad61aad75829ad2c93b5e1e778ffb431420e9430d909ccf78
7
- data.tar.gz: ef76f0213eabda3b4ef5a7ff760403cd3dc6e0f60fa2b08a3f68cc3bed36161e59ee7d14b083d81cf872b0b8136704b73a794b18e035f1a91aaacb4b0afd82e9
6
+ metadata.gz: b1d567d1f2b70a018687def15d1f68aaf9101e0cdab130962383b81afd42230a25f7297523170fec9c28634d1f7d7df98a75f06d55d4f87ab332c95297439f19
7
+ data.tar.gz: d9b969d5a72dc6bb8664b35ed867a1e188114b52c976f1e650403dae719b02bd52c1ece3a009b1116e481231cf74a6e2b7efd071ce0a560719ce42bfd3389ad9
data/lib/arosa/meta.rb CHANGED
@@ -159,13 +159,16 @@ module Arosa
159
159
  end
160
160
 
161
161
  def strip_locale(fullpath, locales)
162
+ path = fullpath
162
163
  locales.each do |locale|
163
164
  prefix = "/#{locale}"
164
- next unless fullpath.start_with?("#{prefix}/") || fullpath == prefix
165
+ next unless path.start_with?("#{prefix}/") || path == prefix
165
166
 
166
- return fullpath.delete_prefix(prefix)
167
+ path = path.delete_prefix(prefix)
168
+ break
167
169
  end
168
- fullpath
170
+ path = "" if path == "/"
171
+ path
169
172
  end
170
173
 
171
174
  def build_hreflang_href(locale, pattern, fullpath, origin, skip_prefix: false)
data/lib/arosa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arosa
4
- VERSION = "0.1.9"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arosa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuenti