phil_locator 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +27 -0
  3. data/.github/workflows/update-copyright-years-in-license-file.yml +10 -0
  4. data/.gitignore +0 -1
  5. data/.rubocop.yml +0 -4
  6. data/CHANGELOG.md +41 -0
  7. data/Gemfile +5 -3
  8. data/Gemfile.lock +89 -0
  9. data/LICENSE +1 -1
  10. data/README.md +20 -9
  11. data/VERSION +1 -1
  12. data/app/models/phil_locator/barangay.rb +20 -14
  13. data/app/models/phil_locator/city.rb +5 -11
  14. data/app/models/phil_locator/district.rb +13 -0
  15. data/app/models/phil_locator/island_group.rb +8 -0
  16. data/app/models/phil_locator/municipality.rb +13 -0
  17. data/app/models/phil_locator/province.rb +9 -6
  18. data/app/models/phil_locator/region.rb +15 -5
  19. data/app/models/phil_locator/sub_municipality.rb +13 -0
  20. data/lib/datasets/json/barangays.json +1 -0
  21. data/lib/datasets/json/cities.json +1 -0
  22. data/lib/datasets/json/districts.json +1 -0
  23. data/lib/datasets/json/island_groups.json +1 -0
  24. data/lib/datasets/json/municipalities.json +1 -0
  25. data/lib/datasets/json/provinces.json +1 -0
  26. data/lib/datasets/json/regions.json +1 -0
  27. data/lib/datasets/json/sub_municipalities.json +1 -0
  28. data/lib/datasets/yaml/barangays.yml +378406 -0
  29. data/lib/datasets/yaml/cities.yml +1315 -0
  30. data/lib/datasets/yaml/districts.yml +33 -0
  31. data/lib/datasets/yaml/island_groups.yml +7 -0
  32. data/lib/datasets/yaml/municipalities.yml +13393 -0
  33. data/lib/datasets/yaml/provinces.yml +730 -0
  34. data/lib/datasets/yaml/regions.yml +137 -0
  35. data/lib/datasets/yaml/sub_municipalities.yml +113 -0
  36. data/lib/phil_locator/configuration.rb +1 -1
  37. data/lib/phil_locator.rb +2 -2
  38. data/phil_locator.gemspec +1 -1
  39. metadata +32 -13
  40. data/.codeclimate.yml +0 -33
  41. data/data/barangays.yml +0 -210146
  42. data/data/cities.yml +0 -8236
  43. data/data/provinces.yml +0 -441
  44. data/data/regions.yml +0 -86
@@ -0,0 +1,137 @@
1
+ ---
2
+ - code: '010000000'
3
+ name: REGION I (ILOCOS REGION)
4
+ geographicLevel: Reg
5
+ cityClass: ''
6
+ incomeClassification: ''
7
+ urbanRural: ''
8
+ population: 5026128
9
+ region_code: '01'
10
+ - code: '020000000'
11
+ name: REGION II (CAGAYAN VALLEY)
12
+ geographicLevel: Reg
13
+ cityClass: ''
14
+ incomeClassification: ''
15
+ urbanRural: ''
16
+ population: 3451410
17
+ region_code: '02'
18
+ - code: '030000000'
19
+ name: REGION III (CENTRAL LUZON)
20
+ geographicLevel: Reg
21
+ cityClass: ''
22
+ incomeClassification: ''
23
+ urbanRural: ''
24
+ population: 11218177
25
+ region_code: '03'
26
+ - code: '040000000'
27
+ name: REGION IV-A (CALABARZON)
28
+ geographicLevel: Reg
29
+ cityClass: ''
30
+ incomeClassification: ''
31
+ urbanRural: ''
32
+ population: 14414774
33
+ region_code: '04'
34
+ - code: 170000000
35
+ name: MIMAROPA REGION
36
+ geographicLevel: Reg
37
+ cityClass: ''
38
+ incomeClassification: ''
39
+ urbanRural: ''
40
+ population: 2963360
41
+ region_code: '17'
42
+ - code: '050000000'
43
+ name: REGION V (BICOL REGION)
44
+ geographicLevel: Reg
45
+ cityClass: ''
46
+ incomeClassification: ''
47
+ urbanRural: ''
48
+ population: 5796989
49
+ region_code: '05'
50
+ - code: '060000000'
51
+ name: REGION VI (WESTERN VISAYAS)
52
+ geographicLevel: Reg
53
+ cityClass: ''
54
+ incomeClassification: ''
55
+ urbanRural: ''
56
+ population: 7536383
57
+ region_code: '06'
58
+ - code: '070000000'
59
+ name: REGION VII (CENTRAL VISAYAS)
60
+ geographicLevel: Reg
61
+ cityClass: ''
62
+ incomeClassification: ''
63
+ urbanRural: ''
64
+ population: 7396898
65
+ region_code: '07'
66
+ - code: '080000000'
67
+ name: REGION VIII (EASTERN VISAYAS)
68
+ geographicLevel: Reg
69
+ cityClass: ''
70
+ incomeClassification: ''
71
+ urbanRural: ''
72
+ population: 4440150
73
+ region_code: '08'
74
+ - code: '090000000'
75
+ name: REGION IX (ZAMBOANGA PENINSULA)
76
+ geographicLevel: Reg
77
+ cityClass: ''
78
+ incomeClassification: ''
79
+ urbanRural: ''
80
+ population: 3629783
81
+ region_code: '09'
82
+ - code: 100000000
83
+ name: REGION X (NORTHERN MINDANAO)
84
+ geographicLevel: Reg
85
+ cityClass: ''
86
+ incomeClassification: ''
87
+ urbanRural: ''
88
+ population: 4689302
89
+ region_code: '10'
90
+ - code: 110000000
91
+ name: REGION XI (DAVAO REGION)
92
+ geographicLevel: Reg
93
+ cityClass: ''
94
+ incomeClassification: ''
95
+ urbanRural: ''
96
+ population: 4893318
97
+ region_code: '11'
98
+ - code: 120000000
99
+ name: REGION XII (SOCCSKSARGEN)
100
+ geographicLevel: Reg
101
+ cityClass: ''
102
+ incomeClassification: ''
103
+ urbanRural: ''
104
+ population: 4545276
105
+ region_code: '12'
106
+ - code: 130000000
107
+ name: NATIONAL CAPITAL REGION (NCR)
108
+ geographicLevel: Reg
109
+ cityClass: ''
110
+ incomeClassification: ''
111
+ urbanRural: ''
112
+ population: 12877253
113
+ region_code: '13'
114
+ - code: 140000000
115
+ name: CORDILLERA ADMINISTRATIVE REGION (CAR)
116
+ geographicLevel: Reg
117
+ cityClass: ''
118
+ incomeClassification: ''
119
+ urbanRural: ''
120
+ population: 1722006
121
+ region_code: '14'
122
+ - code: 150000000
123
+ name: AUTONOMOUS REGION IN MUSLIM MINDANAO (ARMM)
124
+ geographicLevel: Reg
125
+ cityClass: ''
126
+ incomeClassification: ''
127
+ urbanRural: ''
128
+ population: 3781387
129
+ region_code: '15'
130
+ - code: 160000000
131
+ name: REGION XIII (Caraga)
132
+ geographicLevel: Reg
133
+ cityClass: ''
134
+ incomeClassification: ''
135
+ urbanRural: ''
136
+ population: 2596709
137
+ region_code: '16'
@@ -0,0 +1,113 @@
1
+ ---
2
+ - code: 133901000
3
+ name: TONDO I/II
4
+ geographicLevel: SubMun
5
+ cityClass: ''
6
+ incomeClassification: ''
7
+ urbanRural: ''
8
+ population: 631363
9
+ district_code: '1339'
10
+ - code: 133902000
11
+ name: BINONDO
12
+ geographicLevel: SubMun
13
+ cityClass: ''
14
+ incomeClassification: ''
15
+ urbanRural: ''
16
+ population: 18040
17
+ district_code: '1339'
18
+ - code: 133903000
19
+ name: QUIAPO
20
+ geographicLevel: SubMun
21
+ cityClass: ''
22
+ incomeClassification: ''
23
+ urbanRural: ''
24
+ population: 28478
25
+ district_code: '1339'
26
+ - code: 133904000
27
+ name: SAN NICOLAS
28
+ geographicLevel: SubMun
29
+ cityClass: ''
30
+ incomeClassification: ''
31
+ urbanRural: ''
32
+ population: 43069
33
+ district_code: '1339'
34
+ - code: 133905000
35
+ name: SANTA CRUZ
36
+ geographicLevel: SubMun
37
+ cityClass: ''
38
+ incomeClassification: ''
39
+ urbanRural: ''
40
+ population: 132193
41
+ district_code: '1339'
42
+ - code: 133906000
43
+ name: SAMPALOC
44
+ geographicLevel: SubMun
45
+ cityClass: ''
46
+ incomeClassification: ''
47
+ urbanRural: ''
48
+ population: 375119
49
+ district_code: '1339'
50
+ - code: 133907000
51
+ name: SAN MIGUEL
52
+ geographicLevel: SubMun
53
+ cityClass: ''
54
+ incomeClassification: ''
55
+ urbanRural: ''
56
+ population: 17464
57
+ district_code: '1339'
58
+ - code: 133908000
59
+ name: ERMITA
60
+ geographicLevel: SubMun
61
+ cityClass: ''
62
+ incomeClassification: ''
63
+ urbanRural: ''
64
+ population: 10523
65
+ district_code: '1339'
66
+ - code: 133909000
67
+ name: INTRAMUROS
68
+ geographicLevel: SubMun
69
+ cityClass: ''
70
+ incomeClassification: ''
71
+ urbanRural: ''
72
+ population: 5935
73
+ district_code: '1339'
74
+ - code: 133910000
75
+ name: MALATE
76
+ geographicLevel: SubMun
77
+ cityClass: ''
78
+ incomeClassification: ''
79
+ urbanRural: ''
80
+ population: 86196
81
+ district_code: '1339'
82
+ - code: 133911000
83
+ name: PACO
84
+ geographicLevel: SubMun
85
+ cityClass: ''
86
+ incomeClassification: ''
87
+ urbanRural: ''
88
+ population: 82466
89
+ district_code: '1339'
90
+ - code: 133912000
91
+ name: PANDACAN
92
+ geographicLevel: SubMun
93
+ cityClass: ''
94
+ incomeClassification: ''
95
+ urbanRural: ''
96
+ population: 87405
97
+ district_code: '1339'
98
+ - code: 133913000
99
+ name: PORT AREA
100
+ geographicLevel: SubMun
101
+ cityClass: ''
102
+ incomeClassification: ''
103
+ urbanRural: ''
104
+ population: 66742
105
+ district_code: '1339'
106
+ - code: 133914000
107
+ name: SANTA ANA
108
+ geographicLevel: SubMun
109
+ cityClass: ''
110
+ incomeClassification: ''
111
+ urbanRural: ''
112
+ population: 195155
113
+ district_code: '1339'
@@ -3,7 +3,7 @@ module PhilLocator
3
3
  attr_accessor :data_root_path
4
4
 
5
5
  def initialize
6
- @data_root_path = [PhilLocator.gem_full_path, "data"].join("/")
6
+ @data_root_path = [PhilLocator.gem_full_path, "lib/datasets"].join("/")
7
7
  end
8
8
  end
9
9
  end
data/lib/phil_locator.rb CHANGED
@@ -16,10 +16,10 @@ module PhilLocator
16
16
  yield configuration if block_given?
17
17
  end
18
18
 
19
- def self.data_root_path
19
+ def self.data_root_path(path = "")
20
20
  raise "`#{name}.data_root_path` MUST be a String object." unless configuration.data_root_path.is_a?(String)
21
21
 
22
- configuration.data_root_path
22
+ [configuration.data_root_path, path.to_s].join("/")
23
23
  end
24
24
 
25
25
  def self.gem_full_path
data/phil_locator.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.summary = "Registry records for regions, cities, and provinces in the Philippines."
6
6
  s.description = "Provides registry records for regions, cities, and provinces in the Philippines."
7
7
 
8
- s.required_ruby_version = ">= 2.5.3"
8
+ s.required_ruby_version = ">= 2.7.0"
9
9
  s.required_rubygems_version = ">= 2.7.7"
10
10
 
11
11
  s.license = "MIT"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phil_locator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel Aviel Domaoan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-11 00:00:00.000000000 Z
11
+ date: 2023-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_hash
@@ -30,22 +30,41 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
- - ".codeclimate.yml"
33
+ - ".github/workflows/rubocop.yml"
34
+ - ".github/workflows/update-copyright-years-in-license-file.yml"
34
35
  - ".gitignore"
35
36
  - ".rubocop.yml"
37
+ - CHANGELOG.md
36
38
  - Gemfile
39
+ - Gemfile.lock
37
40
  - LICENSE
38
41
  - README.md
39
42
  - VERSION
40
43
  - app/models/concerns/.keep
41
44
  - app/models/phil_locator/barangay.rb
42
45
  - app/models/phil_locator/city.rb
46
+ - app/models/phil_locator/district.rb
47
+ - app/models/phil_locator/island_group.rb
48
+ - app/models/phil_locator/municipality.rb
43
49
  - app/models/phil_locator/province.rb
44
50
  - app/models/phil_locator/region.rb
45
- - data/barangays.yml
46
- - data/cities.yml
47
- - data/provinces.yml
48
- - data/regions.yml
51
+ - app/models/phil_locator/sub_municipality.rb
52
+ - lib/datasets/json/barangays.json
53
+ - lib/datasets/json/cities.json
54
+ - lib/datasets/json/districts.json
55
+ - lib/datasets/json/island_groups.json
56
+ - lib/datasets/json/municipalities.json
57
+ - lib/datasets/json/provinces.json
58
+ - lib/datasets/json/regions.json
59
+ - lib/datasets/json/sub_municipalities.json
60
+ - lib/datasets/yaml/barangays.yml
61
+ - lib/datasets/yaml/cities.yml
62
+ - lib/datasets/yaml/districts.yml
63
+ - lib/datasets/yaml/island_groups.yml
64
+ - lib/datasets/yaml/municipalities.yml
65
+ - lib/datasets/yaml/provinces.yml
66
+ - lib/datasets/yaml/regions.yml
67
+ - lib/datasets/yaml/sub_municipalities.yml
49
68
  - lib/phil_locator.rb
50
69
  - lib/phil_locator/configuration.rb
51
70
  - lib/phil_locator/engine.rb
@@ -57,8 +76,8 @@ licenses:
57
76
  - MIT
58
77
  metadata:
59
78
  bug_tracker_uri: https://github.com/tenshiAMD/phil_locator/issues
60
- source_code_uri: https://github.com/tenshiAMD/phil_locator/tree/v1.2.1
61
- post_install_message:
79
+ source_code_uri: https://github.com/tenshiAMD/phil_locator/tree/v1.3.0
80
+ post_install_message:
62
81
  rdoc_options: []
63
82
  require_paths:
64
83
  - lib
@@ -66,15 +85,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
85
  requirements:
67
86
  - - ">="
68
87
  - !ruby/object:Gem::Version
69
- version: 2.5.3
88
+ version: 2.7.0
70
89
  required_rubygems_version: !ruby/object:Gem::Requirement
71
90
  requirements:
72
91
  - - ">="
73
92
  - !ruby/object:Gem::Version
74
93
  version: 2.7.7
75
94
  requirements: []
76
- rubygems_version: 3.0.6
77
- signing_key:
95
+ rubygems_version: 3.3.26
96
+ signing_key:
78
97
  specification_version: 4
79
98
  summary: Registry records for regions, cities, and provinces in the Philippines.
80
99
  test_files: []
data/.codeclimate.yml DELETED
@@ -1,33 +0,0 @@
1
- version: '2'
2
-
3
- checks:
4
- argument-count:
5
- enabled: false
6
- complex-logic:
7
- enabled: false
8
- file-lines:
9
- enabled: false
10
- method-complexity:
11
- enabled: false
12
- method-count:
13
- enabled: false
14
- method-lines:
15
- enabled: false
16
- nested-control-flow:
17
- enabled: false
18
- return-statements:
19
- enabled: false
20
- similar-code:
21
- enabled: false
22
- identical-code:
23
- enabled: false
24
-
25
- plugins:
26
- rubocop:
27
- enabled: true
28
- channel: "rubocop-0-74" # See other channels here: https://github.com/codeclimate/codeclimate-rubocop/branches/active
29
-
30
- prepare:
31
- fetch:
32
- - url: 'https://raw.githubusercontent.com/rails/rails/master/.rubocop.yml'
33
- path: ".rubocop-https---raw-githubusercontent-com-rails-rails-master--rubocop-yml"