A wrapper for the coronavirus API at https://github.com/ExpDev07/coronavirus-tracker-api.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
gem install covid19
Get the latest amount of total confirmed cases, deaths, and recoveries globally:
Get case data for all locations with reported cases:
Find case data by country code with an optional argument to include timelines:
Find case data by location:
If there are errors trying to talk to the API the class will raise a
StandardError with the appropriate error message.
Command line tool
The gem also comes with a command line tool called covid19.
Usage: covid19 -h, --help Display this screen -s, --split View the latestest information split by country -c, --confirmed Order results by confirmed cases -d, --deaths Order results by deaths -p, --death-rate Order results by percentage of deaths (death rate) -r, --recovered Order results by recovered numbers
After checking out the repo, run
bin/setup to install dependencies. Then, run
rake spec to run the tests. You can also run
bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run
bundle exec rake install. To release a new version, update the version number in
version.rb, and then run
bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the
.gem file to rubygems.org.
For local testing make sure that you run
bundle exec rspec spec and then
rake install to install the gem locally.
For further information please refer to the contributing documentation.