BusTicker / BusTicker-Server

MIT License
0 stars 0 forks source link

implemented with when/rest and tap/argeparse/havarsine #12

Closed brennanMKE closed 9 years ago

brennanMKE commented 10 years ago

There are TODO comments inline where there is still work to do. The tests do run and are working well. Copy tests.sh to mytests.sh and replace with API-KEY to run the tests. You can specify mock or acts for the provider.

The tap (Test Anything Protocol) and the argparse module I am using are both very good and add some polish to the project in addition to using when and rest. Building on these modules will make it easy to update them going forward and assist with testing. I've set up app.js and tests.js to work separately using the providers based on the given command-line arguments. Only the mcts provider uses the bustime.js dependency while the mock.js provider just loads data from json files.

More tests can be added to test for additional details such as ensuring the distance between points is reasonably accurate as well as the bounding box functions which are not fully implemented. Perhaps Taylor could take a stab at that. I did work off of a reference module which I did not want to use because it did not seem like a stable version. It was also over-complicated so I extracted the logic necessary for creating the bounding box. I did not extract the logic for testing if a coordinate is in the bounding box. That can be complex due to the nature of geospecial coordinates having positive and negative values based on the coordinate. I need to study it more to fully understand how that works. It does not appear to be a simple one line statement.

https://www.npmjs.org/package/tap https://www.npmjs.org/package/argparse https://www.npmjs.org/package/when https://www.npmjs.org/package/rest

@tdhsmith @Aaron-Hartwig @jpwidmer