Project

caruby2go

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby gem that wraps the car2go API -- only supports the public API at present
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 2.12
~> 0.10
~> 0.2
~> 10.0
~> 3.2
~> 0.4

Runtime

~> 0.19.1
 Project Readme

Circle CI

caruby2go

caruby2go is a gem that exposes the car2go api.

For all operations you need to get your own consumer key from car2go.

Installation

Add this line to your application's Gemfile:

gem 'caruby2go'

And then execute:

$ bundle

Or install it yourself as:

$ gem install caruby2go

Packaging

$ rake build

Executing build (in this project's root) will build and install the gem locally.

Publishing

$ gem push pkg/caruby2go-<version>.gem

Usage

caruby2go requires you to have a car2go consumer key

In your project

caruby2go_client = Caruby2go.new(ENV['CAR2GO_CONSUMER_KEY'], 'twincities')
caruby2go_client.vehicles

By default the Car2Go API URL is used, but you have the option to pass in an alternate URL. I added this option so I could use Runscape to monitor API calls.

 caruby2go_client = Caruby2go.new(ENV['CAR2GO_CONSUMER_KEY'], 'twincities', 'https://www-car2go-com-eeeeeeee.runscope.net/api/v2.1')

Included script

Find car locations for a city

$ CONSUMER_KEY=<your_consumer_key> bin/caruby2go p twincities

Finding a city name

Use the locationName value (spaces removed) from the following call

$ CONSUMER_KEY=<your_consumer_key> bin/caruby2go l

Freerider has a script that will return an alphabetized, formatted list of all valid locations, too.

Reference implementations

  • bin/caruby2go in this project

  • Freerider is a gem which uses caruby2go to access car2go's API to track Car2Go vehicle movement.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/caruby2go/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request