MotionOcean is a RubyMotion wrapper for the DigitalOcean API v2.0.
Just a starting point so far, but everything available via the DigitalOcean API v2.0 will soon be available through this library.
Add this line to your application's Gemfile:
gem "motion-ocean", github: "brianpattison/motion-ocean"
And then execute:
$ bundle
Or install it yourself as:
$ gem install motion-ocean
The only configuration needed is to set your DigitalOcean API Token. You can generate a new token in the Apps & API section of your DigitalOcean control panel.
MotionOcean.token = "9f786ce417aaa0d96e8ce4144b43058b75a585a6b56a8f72368589be667f5ee5"
Real docs coming soon, but basically something like this:
# Retrieve all droplets
MotionOcean::Droplet.all do |droplets, error|
if droplets
# Success!
elsif error
# Doh!
end
end
# Retrieve a droplet by ID
MotionOcean::Droplet.find(123) do |droplet, error|
if droplet
# Success!
elsif error
# Doh!
end
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am "Add some feature"
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request