rust-transit / gtfs-structure

Read a GTFS file
MIT License
56 stars 32 forks source link

Add a new `RawGTFS::SourceFormat` field and strip file paths. #147

Closed antoine-de closed 10 months ago

antoine-de commented 10 months ago

The new SourceFormat store the fact that the GTFS has been read from a directory or a zip.

Also strip the base path in the files field of the RawGTFS. This way, if the data were were from a directory with: RawGTFS::new("some/path/to/read"), the files will contains stops.txt and not some/path/to/read/stops.txt. It's more consistent to the way it will be if the data is read from a zip (and makes it possible to know if the data were in a subfolder).

antoine-de commented 10 months ago

Note: I did not bump the version, I plan to add another PR bumping a dependency and removing some warnings

antoine-de commented 10 months ago

Note: I added a test to make it explicit that subdirectory does not work when reading from a path (like I though it would :grin: )