pumi 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +5 -0
- data/bin/parse_data +16 -3
- data/data/communes.yml +562 -0
- data/data/districts.yml +402 -0
- data/data/provinces.yml +52 -2
- data/lib/pumi/data_file.rb +32 -0
- data/lib/pumi/data_source/ncdd.rb +100 -0
- data/lib/pumi/data_source/wikipedia.rb +665 -0
- data/lib/pumi/data_source.rb +7 -0
- data/lib/pumi/location.rb +3 -1
- data/lib/pumi/parser.rb +20 -13
- data/lib/pumi/scraper/result.rb +5 -0
- data/lib/pumi/version.rb +1 -1
- data/lib/pumi.rb +2 -1
- data/pumi.gemspec +1 -0
- metadata +21 -3
- data/lib/pumi/data_parser.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 066cd0470f76fedc66d88f2798f1c3c539def95da58bbbae430fe84c96fd1ebc
|
4
|
+
data.tar.gz: b76d8d82cf50a5b24a177eb3749ae0ddb58ba52bfbdf7543ff166d227242ca07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb5c438c69836bb3476f755872f089b399ee6897d1e588b80ad0e8c17d15845a77a99555e1462e71c75104a1f79faf78ef1e0ae29b4314c11ffb92868e3f000
|
7
|
+
data.tar.gz: f091f341ec8749c4d392a11bf87a286315f626384a6c4ab5a5a14a712be4b8f73092439718f12b979166cf30a267c99180ca54c543583c8379bc1332a66ee9ba
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.18.0](https://github.com/dwilkie/pumi/compare/v0.17.0...v0.18.0) (2023-05-27)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* Add Wikipedia data ([#49](https://github.com/dwilkie/pumi/issues/49)) ([f1cca6f](https://github.com/dwilkie/pumi/commit/f1cca6f81588a94872910284f686846a7876b7fe))
|
9
|
+
|
3
10
|
## [0.17.0](https://github.com/dwilkie/pumi/compare/v0.16.0...v0.17.0) (2023-05-26)
|
4
11
|
|
5
12
|
|
data/README.md
CHANGED
@@ -75,6 +75,11 @@ And then execute:
|
|
75
75
|
# Find a province by its Khmer name
|
76
76
|
Pumi::Province.where(name_km: "បន្ទាយមានជ័យ")
|
77
77
|
|
78
|
+
# Get a list of links for a province
|
79
|
+
province = Pumi::Province.find_by_id("12")
|
80
|
+
province.links
|
81
|
+
# => {:wikipedia=>"https://en.wikipedia.org/wiki/Phnom_Penh"}
|
82
|
+
|
78
83
|
# Working with Districts (ស្រុក / ខណ្ឌ)
|
79
84
|
|
80
85
|
# Get all districts
|
data/bin/parse_data
CHANGED
@@ -7,6 +7,19 @@
|
|
7
7
|
require "bundler/setup"
|
8
8
|
require "pumi"
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
Pumi::DataSource::NCDD.new.load_data!
|
11
|
+
|
12
|
+
Pumi::DataSource::Wikipedia.new(
|
13
|
+
scraper: Pumi::DataSource::Wikipedia::CambodianProvincesScraper.new,
|
14
|
+
data_file: Pumi::DataFile.new(:provinces)
|
15
|
+
).load_data!
|
16
|
+
|
17
|
+
Pumi::DataSource::Wikipedia.new(
|
18
|
+
scraper: Pumi::DataSource::Wikipedia::CambodianDistrictsScraper.new,
|
19
|
+
data_file: Pumi::DataFile.new(:districts)
|
20
|
+
).load_data!
|
21
|
+
|
22
|
+
Pumi::DataSource::Wikipedia.new(
|
23
|
+
scraper: Pumi::DataSource::Wikipedia::CambodianCommunesScraper.new,
|
24
|
+
data_file: Pumi::DataFile.new(:communes)
|
25
|
+
).load_data!
|