pumi 0.16.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/.github/dependabot.yml +10 -0
- data/.github/workflows/dependabot-auto-merge.yml +17 -0
- data/.github/workflows/update_data.yml +2 -2
- data/.tool-versions +1 -1
- data/CHANGELOG.md +14 -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/data/villages.yml +16 -0
- 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 +24 -4
- 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
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Dependabot auto-merge
|
2
|
+
on: pull_request
|
3
|
+
|
4
|
+
permissions:
|
5
|
+
contents: write
|
6
|
+
pull-requests: write
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
dependabot:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
if: ${{ github.actor == 'dependabot[bot]' }}
|
12
|
+
steps:
|
13
|
+
- name: Enable auto-merge for Dependabot PRs
|
14
|
+
run: gh pr merge --auto --merge "$PR_URL"
|
15
|
+
env:
|
16
|
+
PR_URL: ${{github.event.pull_request.html_url}}
|
17
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
@@ -23,7 +23,7 @@ jobs:
|
|
23
23
|
run: ./bin/parse_data
|
24
24
|
|
25
25
|
- name: Create Pull Request
|
26
|
-
uses: peter-evans/create-pull-request@
|
26
|
+
uses: peter-evans/create-pull-request@v5
|
27
27
|
with:
|
28
28
|
token: ${{ secrets.REPO_TOKEN }}
|
29
29
|
commit-message: "feat: Update data"
|
@@ -32,7 +32,7 @@ jobs:
|
|
32
32
|
base: "master"
|
33
33
|
|
34
34
|
- name: Upload Data
|
35
|
-
uses: actions/upload-artifact@
|
35
|
+
uses: actions/upload-artifact@v3
|
36
36
|
with:
|
37
37
|
name: data_files
|
38
38
|
path: tmp
|
data/.tool-versions
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
ruby 3.2.
|
1
|
+
ruby 3.2.2
|
2
2
|
nodejs 18.15.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
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
|
+
|
10
|
+
## [0.17.0](https://github.com/dwilkie/pumi/compare/v0.16.0...v0.17.0) (2023-05-26)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* Update data ([#47](https://github.com/dwilkie/pumi/issues/47)) ([68dc668](https://github.com/dwilkie/pumi/commit/68dc668b809ba1259c985b49f503a08f4cfe2a28))
|
16
|
+
|
3
17
|
## [0.16.0](https://github.com/dwilkie/pumi/compare/v0.15.0...v0.16.0) (2023-04-24)
|
4
18
|
|
5
19
|
|
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!
|