decoupage_administratif 0.4.0 → 0.6.0
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 +4 -4
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -0
- data/CHANGELOG.md +25 -0
- data/README.md +12 -0
- data/data/communes.json +33809 -33857
- data/data/epci.json +1250 -1250
- data/lib/decoupage_administratif/base_model.rb +12 -2
- data/lib/decoupage_administratif/commune.rb +55 -4
- data/lib/decoupage_administratif/search.rb +2 -2
- data/lib/decoupage_administratif/territory_strategies.rb +1 -1
- data/lib/decoupage_administratif/version.rb +2 -2
- data/lib/tasks/install.rake +4 -1
- data/sig/decoupage_administratif/base_model.rbs +2 -0
- data/sig/decoupage_administratif/commune.rbs +11 -1
- metadata +5 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c1f04c996f56a0efc901c6010341d5c14418c0e76fcdedcab4300de819cb14f
|
|
4
|
+
data.tar.gz: aa4634401f09659fbdc49264e148abd3ad1e21d6408c48e414101522267ef658
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2e6c7d57bc6cf4f5542a70c001c68d7507e7fd747e28142b1fde7262a5920c0568e232a0ada3ca33d34bb28426648f19acb6108e054005d68510ebc83eed9b9
|
|
7
|
+
data.tar.gz: 1335fa9dfecde7a8b2b6c7daf5eaf44aa52d2e3f6859b51fbbd16964782492f2766973f8176a14d5dfe8660466f9ff40c5d41a4c76ae52bd0d4d81c32a8e17c6
|
data/.rubocop.yml
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.0] - 2026-11-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Commune**: `anciens_codes` attribute exposing the former INSEE codes of the communes merged into a commune, read from the `anciensCodes` field of the source data
|
|
7
|
+
- **Commune**: `Commune.find_actuelle(code)` returns the commune actuelle for a current or former INSEE code (e.g. `Commune.find_actuelle('72287')` returns Laigné-Saint-Gervais, `72155`), and raises `NotFoundError` when nothing matches. `Commune.find` is unchanged and still rejects obsolete codes
|
|
8
|
+
|
|
9
|
+
## [0.5.0] - 2026-09-28
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **Commune**: `actuelle?` predicate, true for current communes and municipal districts (`:commune_actuelle` and `:arrondissement_municipal`)
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **BaseModel**: `find` now looks records up through a memoized index by code (`all_by_code`) instead of scanning the whole collection
|
|
16
|
+
- **Commune**: when several communes share the same code (e.g. a commune actuelle and a commune déléguée), `Commune.find` now returns the commune actuelle
|
|
17
|
+
- **Data**: embedded data updated from @etalab/decoupage-administratif 6.0.0 (was 4.0.0): communes merged or split since the previous release (34,969 current communes, was 35,029), refreshed population figures, EPCI names and members
|
|
18
|
+
- **Rake**: source dataset version extracted into the `ETALAB_DATASET_VERSION` constant in `decoupage_administratif:update`
|
|
19
|
+
- **CI**: test matrix now covers maintained Ruby versions only (3.3, 3.4, 4.0); Rubocop workflow now runs on Ruby 4.0 (was 2.6)
|
|
20
|
+
- **Dependencies**: development dependencies refreshed (Bundler 4.0, RuboCop 1.91, json 3.0) so the bundle installs on Ruby 4.0
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
- **Breaking**: support for Ruby < 3.3 dropped (`required_ruby_version` is now `>= 3.3.0`); Ruby 3.0, 3.1 and 3.2 are end-of-life
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- `DecoupageAdministratif::DATA_VERSION` now reports the version of the embedded data (6.0.0, was wrongly `5.2.0`)
|
|
27
|
+
|
|
3
28
|
## [0.4.0] - 2026-01-27
|
|
4
29
|
|
|
5
30
|
### Added
|
data/README.md
CHANGED
|
@@ -67,6 +67,12 @@ DecoupageAdministratif::Region.all
|
|
|
67
67
|
commune = DecoupageAdministratif::Commune.find('75056')
|
|
68
68
|
puts commune.nom # => "Paris"
|
|
69
69
|
|
|
70
|
+
# Retrouver la commune actuelle à partir d'un code INSEE actuel ou ancien
|
|
71
|
+
# (find lève NotFoundError pour un code obsolète, find_actuelle renvoie la commune qui l'a absorbé)
|
|
72
|
+
commune = DecoupageAdministratif::Commune.find_actuelle('72287')
|
|
73
|
+
puts commune.nom # => "Laigné-Saint-Gervais"
|
|
74
|
+
commune.anciens_codes # => ["72287"]
|
|
75
|
+
|
|
70
76
|
# Lister toutes les communes actuelles (communes actuelles + arrondissements municipaux)
|
|
71
77
|
DecoupageAdministratif::Commune.actuelles
|
|
72
78
|
|
|
@@ -234,6 +240,12 @@ DecoupageAdministratif::Region.all
|
|
|
234
240
|
commune = DecoupageAdministratif::Commune.find('75056')
|
|
235
241
|
puts commune.nom # => "Paris"
|
|
236
242
|
|
|
243
|
+
# Find the current municipality from a current or former INSEE code
|
|
244
|
+
# (find raises NotFoundError for an obsolete code, find_actuelle returns the municipality that absorbed it)
|
|
245
|
+
commune = DecoupageAdministratif::Commune.find_actuelle('72287')
|
|
246
|
+
puts commune.nom # => "Laigné-Saint-Gervais"
|
|
247
|
+
commune.anciens_codes # => ["72287"]
|
|
248
|
+
|
|
237
249
|
# List all current municipalities (current communes + municipal districts)
|
|
238
250
|
DecoupageAdministratif::Commune.actuelles
|
|
239
251
|
|