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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5292b35d55909c67cc984178dd4d4f28a7a6054cb45148f62dcdfbdf171d1ad9
4
- data.tar.gz: 851e4eb11c886a7f4637063503234aa53e7229a7e0b834cac3dc56fcfc846a95
3
+ metadata.gz: 066cd0470f76fedc66d88f2798f1c3c539def95da58bbbae430fe84c96fd1ebc
4
+ data.tar.gz: b76d8d82cf50a5b24a177eb3749ae0ddb58ba52bfbdf7543ff166d227242ca07
5
5
  SHA512:
6
- metadata.gz: 7ce650a6a5a791a68d28ec26946bd6c8518fecbe9f7b3bdb1b1920cb4aec8a32fdf5ea947232d150a03d17bf55197ad6c147fc916e3a1516bfb710f2f90eec72
7
- data.tar.gz: af3ec2635388df2890b5b81f517b66c9af96b0a86d85b8bbca5638696faf4630a28b396cd86bfe0bf8852e704e8c23dc6080c787a1e0c2216e68244dc52c0cb0
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
- data_parser = Pumi::DataParser.new
11
- data = data_parser.load_data!
12
- data_parser.write_data!(data)
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!