README.md in parking_ticket-0.1.2 vs README.md in parking_ticket-1.0.0

- old
+ new

@@ -1,11 +1,9 @@ # ParkingTicket -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/parking_ticket`. To experiment with that code, run `bin/console` for an interactive prompt. +This gem is a wrapper around the majors residential parking tickets api (for now only PayByPhone is supported). -TODO: Delete this and the text above, and describe your gem - ## Installation Add this line to your application's Gemfile: ```ruby @@ -20,24 +18,47 @@ $ gem install parking_ticket ## Usage -TODO: Write usage instructions here +To make the gem work above your parking account you need set some environment variables : -## Development +#PayByPhone : +- `PAYBYPHONE_PASSWORD` : your PayByPhone password +- `PAYBYPHONE_USERNAME` : your PayByPhone username (usually your phone number) +- `PAYBYPHONE_LICENSEPLATE` : tyhe license plate of the car that must be covered +- `PAYBYPHONE_ZIPCODE` : the zipcode you're resident in +- `PAYBYPHONE_CARDNUMBER` : the credit card used to pay parking tickets (must be formated as folow xxxxxx------xxxx) -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. +#Other apis to come -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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). +Two methods comes with the gem : -## Contributing +#`ParkingTicket.current_ticket` +=> returns an object representing a currently running residential ticket for your car. It returns nil if no ticket are found. -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/parking_ticket. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/parking_ticket/blob/master/CODE_OF_CONDUCT.md). +#`ParkingTicket.renew` +=> register a new residential ticket for your car, this won't work if current_ticket returns something. -## License +Then you can create a scrypt like this one : -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). +``` +#your_scrypt.rb +require 'parking_ticket' -## Code of Conduct +ticket_client = ParkingTicket.new -Everyone interacting in the ParkingTicket project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/parking_ticket/blob/master/CODE_OF_CONDUCT.md). +unless ticket_client.current_ticket + ticket_client.renew +end + +``` + +And play as often as you want to ensure that you always have a ticket for your car. +(But this is very HTTP request consuming, a lot of wasted request will be performed, i am sure that you can do better than that.) + +Exemple of application : [parkautomat](https://github.com/troptropcontent/parkautomat) + + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).