pumi 0.43.0 → 0.44.1

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: af0e43b667636b342a7ee9257db6408a5409096bc2126050dbdf11f6f3fdbd46
4
- data.tar.gz: 85bf925a75802bcbb59fc0ef5c900e16b402187ecea0de91a5be438d281337bb
3
+ metadata.gz: 0074d955b52552bcbc18d39613c23fd1c8876d6b1ec743940e46445662845535
4
+ data.tar.gz: d8e1ea3adb1ca6f8ec5d18dadebfed0d195d8c1376e0062c3c0144627e8ef38e
5
5
  SHA512:
6
- metadata.gz: bd2ed631a79f5bc7d0adeac9ccfabd55ffc0d4904ccac219e36d698ad791f343db1629e0746ffaa759087d61e75f6996612577d48e29c1b59f856d6577a6ceef
7
- data.tar.gz: f19c86b1077e30114ddd2ea90eb30ae2ca7ad9422e362504fe63e52485096d8cc905a573fb0a13522bb8b7a0f9421b92c3e4279b5aae3b248965b3bb23253b12
6
+ metadata.gz: e3056bbb81e8e371c2e7398b02549e65e5ad5298a76bd07852f87c97fd53e4a60797af24b6d96930b9ddade84516337ec8ac2249225641ee607220a6a17713dc
7
+ data.tar.gz: fdd044e262e2ed1e0e6b20aba9a3ae15fd68a139aaea7161010bf2165678d6321021a41661a44c29267e387652c7b85e97c7631fc90ed472b2d545d7f54c3b10
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v6
13
+ - uses: actions/checkout@v7
14
14
 
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
@@ -14,7 +14,7 @@ jobs:
14
14
  with:
15
15
  token: ${{ secrets.PUMI_PERSONAL_ACCESS_TOKEN }}
16
16
 
17
- - uses: actions/checkout@v6
17
+ - uses: actions/checkout@v7
18
18
  if: ${{ steps.release.outputs.release_created }}
19
19
 
20
20
  - uses: ruby/setup-ruby@v1
@@ -3,13 +3,13 @@ name: Update Data
3
3
  on:
4
4
  schedule:
5
5
  - cron: '0 2 * * 0'
6
-
6
+ workflow_dispatch:
7
7
  jobs:
8
8
  fetch_data:
9
9
  runs-on: ubuntu-latest
10
10
 
11
11
  steps:
12
- - uses: actions/checkout@v6
12
+ - uses: actions/checkout@v7
13
13
 
14
14
  - name: Setup Ruby
15
15
  uses: ruby/setup-ruby@v1
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.43.0"
2
+ ".": "0.44.1"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.44.1](https://github.com/dwilkie/pumi/compare/v0.44.0...v0.44.1) (2026-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Update misspellings ([#138](https://github.com/dwilkie/pumi/issues/138)) ([8ee4b04](https://github.com/dwilkie/pumi/commit/8ee4b04e6d7b7c5730acb60441948d5fc14f12bd))
9
+
10
+ ## [0.44.0](https://github.com/dwilkie/pumi/compare/v0.43.0...v0.44.0) (2026-09-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * Update data ([#134](https://github.com/dwilkie/pumi/issues/134)) ([cee3021](https://github.com/dwilkie/pumi/commit/cee3021d14bc3cc1ef592559d112c44cd74037ea))
16
+
3
17
  ## [0.43.0](https://github.com/dwilkie/pumi/compare/v0.42.0...v0.43.0) (2026-06-01)
4
18
 
5
19
 
data/data/districts.yml CHANGED
@@ -734,7 +734,7 @@ districts:
734
734
  en: District
735
735
  ungegn: Srŏk
736
736
  links:
737
- wikipedia: https://en.wikipedia.org/wiki/Rolea_B%27ier_District
737
+ wikipedia: https://en.wikipedia.org/wiki/Rolea_B'ier_District
738
738
  geodata:
739
739
  lat: '12.2059838'
740
740
  long: '104.6613026'
@@ -1087,7 +1087,7 @@ districts:
1087
1087
  '0609':
1088
1088
  name:
1089
1089
  km: តាំងគោក
1090
- latin: Tang Kouk
1090
+ latin: Taing Kouk
1091
1091
  administrative_unit:
1092
1092
  km: ស្រុក
1093
1093
  latin: Srok
@@ -1448,7 +1448,7 @@ districts:
1448
1448
  en: District
1449
1449
  ungegn: Srŏk
1450
1450
  links:
1451
- wikipedia: https://en.wikipedia.org/wiki/S%27ang
1451
+ wikipedia: https://en.wikipedia.org/wiki/S'ang
1452
1452
  geodata:
1453
1453
  lat: '11.3605612'
1454
1454
  long: '105.0037187'
@@ -3692,7 +3692,7 @@ districts:
3692
3692
  en: District
3693
3693
  ungegn: Srŏk
3694
3694
  links:
3695
- wikipedia: https://en.wikipedia.org/wiki/Damnak_Chang%27aeur_District
3695
+ wikipedia: https://en.wikipedia.org/wiki/Damnak_Chang'aeur_District
3696
3696
  geodata:
3697
3697
  lat: '10.526653'
3698
3698
  long: '104.36731'
data/data/villages.yml CHANGED
@@ -14115,7 +14115,7 @@ villages:
14115
14115
  '03010907':
14116
14116
  name:
14117
14117
  km: តាំងគោក
14118
- latin: Tang Kouk
14118
+ latin: Taing Kouk
14119
14119
  administrative_unit:
14120
14120
  km: ភូមិ
14121
14121
  latin: Phum
@@ -19578,7 +19578,7 @@ villages:
19578
19578
  '03130708':
19579
19579
  name:
19580
19580
  km: តាំងគោក
19581
- latin: Tang Kouk
19581
+ latin: Taing Kouk
19582
19582
  administrative_unit:
19583
19583
  km: ភូមិ
19584
19584
  latin: Phum
@@ -46047,7 +46047,7 @@ villages:
46047
46047
  '06090501':
46048
46048
  name:
46049
46049
  km: តាំងគោក
46050
- latin: Tang Kouk
46050
+ latin: Taing Kouk
46051
46051
  administrative_unit:
46052
46052
  km: ភូមិ
46053
46053
  latin: Phum
@@ -90489,7 +90489,7 @@ villages:
90489
90489
  '15070116':
90490
90490
  name:
90491
90491
  km: តាំងគោក
90492
- latin: Tang Kouk
90492
+ latin: Taing Kouk
90493
90493
  administrative_unit:
90494
90494
  km: ភូមិ
90495
90495
  latin: Phum
@@ -23,7 +23,7 @@ module Pumi
23
23
  Misspelling.new(incorrect_text: "Prea​ek Chrey", correct_text: "Preaek Chrey"),
24
24
  Misspelling.new(incorrect_text: "Saensokh", correct_text: "Sen Sok"),
25
25
  Misspelling.new(incorrect_text: "Kaeb", correct_text: "Kep"),
26
- Misspelling.new(incorrect_text: "Taing Kouk", correct_text: "Tang Kouk"),
26
+ Misspelling.new(incorrect_text: "Tang Kouk", correct_text: "Taing Kouk"),
27
27
  Misspelling.new(incorrect_text: "Mongkol Borei", correct_text: "Mongkol Borey"),
28
28
  Misspelling.new(incorrect_text: "wat Kor", correct_text: "Wat Kor"),
29
29
  Misspelling.new(incorrect_text: "OMal", correct_text: "Ou Mal"),
@@ -43,6 +43,26 @@ module Pumi
43
43
 
44
44
  ScraperResult = Struct.new(:code, :wikipedia, :name_ungegn, keyword_init: true)
45
45
 
46
+ class URLParser
47
+ attr_reader :base_url, :link_node
48
+
49
+ def self.parse(...)
50
+ new(...).to_s
51
+ end
52
+
53
+ def initialize(base_url, link_node)
54
+ @base_url = base_url
55
+ @link_node = link_node
56
+ end
57
+
58
+ def to_s
59
+ return if link_node.nil? || link_node[:href].nil?
60
+
61
+ escaped_href = URI::DEFAULT_PARSER.escape(link_node[:href])
62
+ URI.join(base_url, escaped_href).to_s
63
+ end
64
+ end
65
+
46
66
  class WebScraper
47
67
  class ElementNotFoundError < StandardError; end
48
68
 
@@ -79,7 +99,7 @@ module Pumi
79
99
  def find_url(province)
80
100
  td = find_khmer_name_td(province)
81
101
  link = td.at_xpath("preceding-sibling::td/a[contains(@href, '/wiki/')]")
82
- URI.join(URL, link[:href]).to_s
102
+ URLParser.parse(URL, link)
83
103
  end
84
104
 
85
105
  def find_ungegn(province)
@@ -141,7 +161,7 @@ module Pumi
141
161
 
142
162
  return if link.nil?
143
163
 
144
- URI.join(URL, link[:href]).to_s
164
+ URLParser.parse(URL, link)
145
165
  end
146
166
 
147
167
  def find_ungegn(district)
@@ -181,7 +201,7 @@ module Pumi
181
201
 
182
202
  return if link.nil?
183
203
 
184
- URI.join(URL, link[:href]).to_s
204
+ URLParser.parse(URL, link)
185
205
  end
186
206
 
187
207
  def find_ungegn(commune)
data/lib/pumi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pumi
2
- VERSION = "0.43.0".freeze
2
+ VERSION = "0.44.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pumi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Wilkie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-01 00:00:00.000000000 Z
11
+ date: 2026-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler