decoupage_administratif 0.3.1 → 0.5.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 +8 -2
- data/data/communes.json +33809 -33857
- data/data/epci.json +1250 -1250
- data/lib/decoupage_administratif/base_model.rb +34 -3
- data/lib/decoupage_administratif/commune.rb +27 -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/decoupage_administratif.rb +9 -1
- data/lib/tasks/install.rake +4 -1
- data/sig/decoupage_administratif/base_model.rbs +3 -0
- data/sig/decoupage_administratif/commune.rbs +7 -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: 6e20eab2bf66bb533a1ec049858e0c0191eb82d03010c9f50fd518bb839a7a30
|
|
4
|
+
data.tar.gz: 6ff84f46bf003fa476825b10e688e964f9b42df0f3954ef9a3ae648f99942450
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d5ff05eec823b9cc156d006b75900e95c9c2bccc303872534906f75fee34d404d9e6d41ab3850d0be3b59b7b7334be4462c6c1e8f3b14e7fd37ba9d0e228611
|
|
7
|
+
data.tar.gz: 16df16c8519aae8074bfe81fba4f54a4a432dfde277c63f4014fc6c0cfd29d556f99ba16d57717280dacf5fb8b2bed99a29ad6b4ed03f8feebd6d068c5959b1f
|
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.5.0] - 2026-09-28
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Commune**: `actuelle?` predicate, true for current communes and municipal districts (`:commune_actuelle` and `:arrondissement_municipal`)
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- **BaseModel**: `find` now looks records up through a memoized index by code (`all_by_code`) instead of scanning the whole collection
|
|
10
|
+
- **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
|
|
11
|
+
- **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
|
|
12
|
+
- **Rake**: source dataset version extracted into the `ETALAB_DATASET_VERSION` constant in `decoupage_administratif:update`
|
|
13
|
+
- **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)
|
|
14
|
+
- **Dependencies**: development dependencies refreshed (Bundler 4.0, RuboCop 1.91, json 3.0) so the bundle installs on Ruby 4.0
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
- **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
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `DecoupageAdministratif::DATA_VERSION` now reports the version of the embedded data (6.0.0, was wrongly `5.2.0`)
|
|
21
|
+
|
|
22
|
+
## [0.4.0] - 2026-01-27
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **Commune**: `codes_postaux` attribute exposing postal codes from source data (e.g., `commune.codes_postaux # => ["72110"]`)
|
|
26
|
+
- **BaseModel**: `where` now supports filtering on array attributes (e.g., `Commune.where(codes_postaux: ["72110", "72600"])`)
|
|
27
|
+
|
|
3
28
|
## [0.3.1] - 2025-11-15
|
|
4
29
|
|
|
5
30
|
### Fixed
|
data/README.md
CHANGED
|
@@ -85,7 +85,10 @@ puts epci.nom
|
|
|
85
85
|
puts epci.communes
|
|
86
86
|
|
|
87
87
|
# Rechercher une commune par nom (insensible à la casse)
|
|
88
|
-
DecoupageAdministratif::Commune.where('paris', case_insensitive: true)
|
|
88
|
+
DecoupageAdministratif::Commune.where(nom: 'paris', case_insensitive: true)
|
|
89
|
+
|
|
90
|
+
# Rechercher des communes par codes postaux
|
|
91
|
+
DecoupageAdministratif::Commune.where(codes_postaux: ['72110', '72600'])
|
|
89
92
|
|
|
90
93
|
# Lister les départements d'une région
|
|
91
94
|
region = DecoupageAdministratif::Region.find_by(nom: 'Bretagne')
|
|
@@ -249,7 +252,10 @@ puts epci.nom
|
|
|
249
252
|
puts epci.communes
|
|
250
253
|
|
|
251
254
|
# Search for a municipality by name (case-insensitive)
|
|
252
|
-
DecoupageAdministratif::Commune.where('paris', case_insensitive: true)
|
|
255
|
+
DecoupageAdministratif::Commune.where(nom: 'paris', case_insensitive: true)
|
|
256
|
+
|
|
257
|
+
# Search municipalities by postal codes
|
|
258
|
+
DecoupageAdministratif::Commune.where(codes_postaux: ['72110', '72600'])
|
|
253
259
|
|
|
254
260
|
# List departments of a region
|
|
255
261
|
region = DecoupageAdministratif::Region.find_by(nom: 'Bretagne')
|